Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Difficulty inserting a large object using DBD::Pg (kudra: do doesn't fix)

by kudra (Vicar)
on Jun 29, 2000 at 17:50 UTC ( #20368=note: print w/ replies, xml ) Need Help??


in reply to Difficulty inserting a large object using DBD::Pg

I've never had a problem with the semicolon, but leaving it out seems to make no difference.

Yes, I do get an error with what you suggested. Here's what I tried:

$value = "foo"; # test value $dbh->do("insert into foo(id, test) values (6,?)",undef,$value);
It also gives a pg_atoi error for dbh->errstr:
ERROR: pg_atoi: error in "foo": can't parse "foo"


Comment on Re: Difficulty inserting a large object using DBD::Pg (kudra: do doesn't fix)
Select or Download Code
Replies are listed 'Best First'.
RE: Re: Difficulty inserting a large object using DBD::Pg
by Dalvross (Acolyte) on Jun 29, 2000 at 18:48 UTC
    Why don't you try this. Make sure the database table is the type you wish to use and then just use
    $sth->bind_param(1,"$value")
    this should place the value of $value into the database field as long as the database field is of a type to handle that input.
      This does not work because it attempts to resolve the type itself, and defaults to varchar, as it did when I explicitly selected the type. It's another pg_atoi error.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://20368]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-07 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls