in reply to Re^2: DBI Sqlite insert function
in thread DBI Sqlite insert function
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBI Sqlite insert function
by ScOut3R (Sexton) on Jul 01, 2008 at 16:31 UTC |