Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Viewing SQL after parameters are bound to PreparedStatement

Re: Viewing SQL after parameters are bound to PreparedStatement

From: Scott Watson <nospam_abuse_at_hotmail.com>
Date: Wed, 30 Apr 2003 15:39:07 -0400
Message-ID: <xDVra.738$nn.23457@wagner.videotron.net>


run this command before your sql statement and then disconnect.

alter session set events '10046 trace name context forever, level 12'

Go to your udmp directory on your Oracle server and and then inspect the trace file to see what is actually getting bound for your statements.

Another option is to use the to_date(?,'dd-mm-yyyy') and bind a character string or use the between so that the time is not considered. (I think the time component is what is causing you grief)

Scott Watson.

<bsnyder_at_NO-SPAM-pclnxbsnyder.digitalglobe.com> wrote in message news:pan.2003.04.30.18.11.05.836261.29355_at_NO-SPAM-pclnxbsnyder.digitalglobe.com...
> I'm having trouble with some DML that is deleting from a table using
> two oracle.sql.TIMESTAMPs. If I run the SQL by hand via SQL*Plus the
> correct rows are removed from the table. If the SQL is executed via an
> oracle.jdbc.driver.OraclePreparedStatement nothing is deleted. One of my
> guesses is that something may be wrong with those TIMESTAMPs as they're
> bound to the OraclePreparedStatement. However, I cannot determine if
> this is the case without viewing the SQL *after* those parameters have
> been bound.
>
> Does anyone know any tricks to viewing SQL from an OraclePreparedStatement
> after parameters have been bound to it?
>
> Thanks!
Received on Wed Apr 30 2003 - 14:39:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US