Re: DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-08 Thread E R
Ok - I guess you're right. Here's the output from DBI->trace(3): dbd_bind_ph(): bind :p1 <== '7553' (type 0 (DEFAULT (varchar))) dbd_rebind_ph_char() (1): bind :p1 <== '7553' (size 4/8/0, ptype 4(VARCHAR), otype 1 ) dbd_rebind_ph_char() (2): bind :p1 <== ''755' (size 4/8, otype 1(VARCHAR), indp 0,

Re: DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-08 Thread Charles Jardine
On 08/05/09 15:26, E R wrote: On Fri, May 8, 2009 at 5:40 AM, Charles Jardine wrote: You do not say which perl driver your are using to talk to Oracle. The DBD::Oracle driver binds all placeholders as strings by default. Are you using DBD::Oracle? Yes, I am using DBD::Oracle. What other per

Re: DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-08 Thread E R
On Fri, May 8, 2009 at 5:40 AM, Charles Jardine wrote: > > You do not say which perl driver your are using to talk to Oracle. > The DBD::Oracle driver binds all placeholders as strings by default. > > Are you using DBD::Oracle? Yes, I am using DBD::Oracle. What other perl drivers are there for O

Re: DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-08 Thread Charles Jardine
On 07/05/09 16:23, E R wrote: Hi, I have a situation where I need a number to be represented as a string in a place holder: my $x = 7553; $dbh->do("SELECT * FROM PRODUCTS WHERE VENDOR = ?", {}, $x); I'd like the above to be the same as: SELECT * FROM PRODUCTS WHERE VENDOR = '7553' The VENDOR

Re: DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-07 Thread John Scoles
Yes I think you can Give this a try ORA_STRING, ORA_LONG, ORA_RAW, ORA_LONGRAW, use DBD::Oracle qw(:ora_types); .. connect as normal $sth=$dbh->prepare("SELECT * FROM PRODUCTS WHERE VENDOR = :p_vendor"); $sth->bind_param(":p_vendor",'7553', { ora_type =>ORA_CHAR }); if ORA_CHAR dose not

DBD::Oracle - forcing a number to look like a string in a placeholder

2009-05-07 Thread E R
Hi, I have a situation where I need a number to be represented as a string in a place holder: my $x = 7553; $dbh->do("SELECT * FROM PRODUCTS WHERE VENDOR = ?", {}, $x); I'd like the above to be the same as: SELECT * FROM PRODUCTS WHERE VENDOR = '7553' The VENDOR column is a VARCHAR2, and Oracle