Oracle JDBC Question

From: Nick N. <nicksan_at_worldnet.att.net>
Date: 2000/06/02
Message-ID: <AAVZ4.286$Gb7.16053_at_bgtnsc05-news.ops.worldnet.att.net>#1/1


[Quoted] I have a prepared statement with the following SQL

SELECT ? FROM MYTABLE WHERE TRADEDATE = TO_DATE(?, 'yyyy-mm-dd')

// TRADEDATE is of type DATE

I do this

setString(1, '2000-06-02')

and execute it.

It doesn't work. I assumed that the ? would be replaced and the SQL would become

[Quoted] SELECT '2000-06-02' FROM MYTABLE WHERE TRADEDATE = TO_DATE('2000-06-02', 'yyyy-mm-dd')

[Quoted] When I change my SQL to this

SELECT TRADEDATE FROM MYTABLE WHERE TRADEDATE = TO_DATE(?, 'yyyy-mm-dd')

[Quoted] it works fine.

Don't ask why but I want to run it like th first SQL statement for reasons I [Quoted] won't get into.

I am totally lost here. Can anyone help me out?

Thanks
Nick Received on Fri Jun 02 2000 - 00:00:00 CEST

Original text of this message