vendion has asked for the wisdom of the Perl Monks concerning the following question:
I'm using the DBD::pg to work with my PostgreSQL server from my perl script. One of the columns in my database is using the Serial datatype to have the value auto incremented by Postgre. The way that I am currently working with it is by sending it a blank value
$compid = q[]but that produces this error from Postgre
DBD::Pg::db do failed: ERROR: invalid input syntax for integer: "" at repairs.pl line 352, <> line 20. Error: could not insert data into database: ERROR: invalid input syntax for integer: "" at repairs.pl line 366 main::db_add_computer('probdesc', 'n/a', 'compid', '', 'custid', '000-000000', 'service', 'n/a', 'compsn', ...) called at repairs.pl line 280 main::print_form() called at repairs.pl line 106
Anyone know what I am doing wrong here? If not then I can try asking in the IRC channel for PostgreSQL
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with Postgresql serial data type in Perl
by Corion (Patriarch) on Dec 18, 2010 at 15:38 UTC | |
by vendion (Scribe) on Dec 18, 2010 at 21:11 UTC | |
|
Re: Working with Postgresql serial data type in Perl
by moritz (Cardinal) on Dec 18, 2010 at 15:40 UTC | |
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 |