in reply to Working with Postgresql serial data type in Perl
If you want to enter a specific integer, just pass it on to the database.
If not, construct your query in a way that simply doesn't enter any value for the serial column. For example if the table has columns id and name, and id is serial, simply write something like
my $sth = $dbh->prepare('INSERT INTO your_table(name) VALUES (?)'); $sth->execute($your_name);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Working with Postgresql serial data type in Perl
by vendion (Scribe) on Dec 18, 2010 at 21:16 UTC | |
by erix (Prior) on Dec 18, 2010 at 21:34 UTC | |
by vendion (Scribe) on Dec 19, 2010 at 01:28 UTC |