Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 33873
Status: rejected
Priority: 0/
Queue: DBD-Oracle

People
Owner: champoux [...] pythian.com
Requestors: xiaoou.wu [...] oracle.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: DBD Oracle doesn't know how to bind_param with "INTERVAL ? MINUTE"
selectrow_array("SELECT SYSDATE + INTERVAL ? MINUTE FROM DUAL",undef,8); will not be correctly executed, because Oracle DBD will make it as "SELECT SYSDATE + INTERVAL 8 MINUTE FROM DUAL;", but not "SELECT SYSDATE + INTERVAL '8' MINUTE FROM DUAL;"
Can you tell me which OS (win, Lunix sun?) and which version of Perl, DBI and DBD you are using?
From: xiaoou.wu [...] oracle.com
Show quoted text
> Can you tell me which OS (win, Lunix sun?) and which version of Perl, > DBI and DBD you are using?
OS: Linux FC8 i386 Perl: 5.8.8 DBI: v1.58 DBD: v1.19 Oracle: 10g XE
From: PYTHIAN [...] cpan.org
After a little searching in the OCI docs I discovered that OCI (what DBD and anything else that works with ORacle uses) does not allow this sort of bind of what they term a INTERVAL LITERAL. My guess is they want to stop SQL injection attacks. or maybe something else It is a case of 'You can't get there from here' However there is a workaround for binding try the NUMTODSINTERVAL function like this $sth = $dbh->prepare("SELECT SYSDATE + NUMTODSINTERVAL(?, 'MINUTE') FROM DUAL"); $sth->bind_param(1,20); $sth->execute; while (my( $value ) = @{$sth->fetch || []}) { print "time: 20 mins from now it =$value length". "\n"; } This works like a charm. I could force DBD::Oracle to bind in this way however it would be so far off Oracle PSQL spec it would only cause confusion and would not be part of any Standard way of doing things. cheers John Scoles
Not a bug working to PSQL and OCI spec