penguinfuz has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to create an interface of sorts to INSERT data into a PostgreSQL database; What I'm having trouble with is passing the "description" to postgres, since the FIELD is an character array.
The bit of relevent code...The error I recieve...print "\nEnter a brief description: "; chomp($desc = <STDIN>); $data = $dbh->quote($desc); $sth = $dbh->prepare(" INSERT INTO $tbl_name (product_id, model_number, description) VALUES ($prod_id, $mod_num, $data) ");
I have also tried using an array; However, it seems I was really doing the same thing. 8\
... chomp(my @desc = <STDIN>);$data = $dbh->quote($desc[0]); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::Pg INSERT enlightenment
by dws (Chancellor) on Feb 06, 2001 at 06:47 UTC | |
|
Re: DBD::Pg INSERT enlightenment
by beppu (Hermit) on Feb 06, 2001 at 07:04 UTC | |
by penguinfuz (Pilgrim) on Feb 06, 2001 at 07:37 UTC | |
by beppu (Hermit) on Feb 06, 2001 at 08:33 UTC | |
by penguinfuz (Pilgrim) on Feb 06, 2001 at 10:14 UTC | |
by beppu (Hermit) on Feb 06, 2001 at 12:30 UTC | |
by repson (Chaplain) on Feb 06, 2001 at 13:47 UTC | |
|
Re: DBD::Pg INSERT enlightenment
by wardk (Deacon) on Feb 07, 2001 at 05:07 UTC | |
by penguinfuz (Pilgrim) on Feb 08, 2001 at 08:15 UTC |