Problems on inserting with DBD::Pg - Mailing list pgsql-general

From Simon Crute
Subject Problems on inserting with DBD::Pg
Date
Msg-id 989350524.9919.0.nnrp-08.9e981bad@news.demon.co.uk
Whole thread Raw
Responses Re: Problems on inserting with DBD::Pg  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,
  I'm using perl 5.6, DBD::Pg with Peter's patch to enable full error
messages (Thanks !!) and I'm having a problem doing an insert. Here's the
extracts of code.


here's the prepare of the statement handle.

$sth_insert = $dbh->prepare("INSERT INTO PEOPLE (userid, title, fname,
sname, email, add_house, add_street, add_area, add_town, add_county,
dd_country, add_code, tel1, tel2, fax, sms, preferred_contact,
registered_date, last_logon_date)
      VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE,SYSDATE)")
or die "<p> unable to prepare statement /n<p> $DBI::errst<p></body></html>";

then later the execute


$sth_insert->execute($userid,$title,$forename,$surname,$email,$house,$street
,$blankadd,$town,$county,$country,
$pcode,$tel1,$tel2,$fax,$sms,$preferred_contact) or die "<p> unable to
insert statement /n<p> $DBI::errstr<p></body></html>";

The error message reported is

[Tue May  8 20:25:27 2001] newuser.plx: DBD::Pg::st execute failed: ERROR:
parser: parse error at or near "ail" at /......./cgi/newuser.plx line 161.


Now, line 161 is the execute line. The only occurrences of "ail" (without
the quotes) anywhere near that line is in $email.

Anyone any ideas why it's failing there ? (the basic code worked when we
were using DBD::Oracle, all we've changed is the connect and dbh->prepare
code)

Thanks.




(full versions.
Perl 5.6
Redhat 6.2 based system (2.2.14-5.0)
postgres 7.1
DBD::Pg .98 + patch
DBI 1.14
)





pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: != or <>
Next
From: Marcos Cruz
Date:
Subject: Help: Change the SQL query length