in reply to Re: DBI Sqlite insert function
in thread DBI Sqlite insert function

Ah sorry, i meant to split @values into separate values.

Replies are listed 'Best First'.
Re^3: DBI Sqlite insert function
by olus (Curate) on Jul 01, 2008 at 15:24 UTC

    From what I understand from your post, you want to convert the array @values to a string that has the array's values comma separated, as that would be the correct SQL syntax. So, if you have an array:

    @values = ( 1, 2, 3 );

    and you want to put that into the SQL query you'll have to join the values:

    my $str_values = join(', ', @values); # $str_values is now '1, 2, 3' ... $db->do("insert into $table values ($str_values)") ... ...

    Still, I strongly advise the reading of the info on placeholders.

      Thank You! That's what i needed!