Oracle select date using bind var

General discussion forum about all databases other than SqlBase.
jdineiro

Oracle select date using bind var

Post by jdineiro » 16 May 2014, 16:48

TD6.2 ...executing this statement generates an oracle error ORA-00932 inconsistent datatypes
Select :dtDateIn + 1 from Dual Into :dtDateOut

dtDateIn and dtDateOut are Date/Time vars

To get around it, I needed to format date as a string and execute this instead
Set sDate = SalFmtFormatDateTime ( dtDateIn, 'dd-MMM-yy' )
Select to_date(:sDate) + 1 from Dual Into :dtDateOut

First statement works in TD3.2. Similar bug reported for DB2 for TD6.1 (bug#18477)

VEspinal

Re: Oracle select date using bind var

Post by VEspinal » 16 May 2014, 22:08

Hi:

Try this:
"SELECT CAST(:dtDateIn AS DATE) +1 INTO :dtDateOut FROM dual"

HTH

Regards,
Victor Espinal

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests