Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Database Application Development
Oracle Call Interface (OCI)
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Dec 19, 2012 3:20 AM by
Problem in querying date values in prepared stmts in OCI
Nov 27, 2012 4:23 AM
Can you please guide me about my following problem?
I am trying to fetch the data from system table "FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$" in Oracle Express edition 10.2.0.3 database, using the OCI library on Windows with C++
This table has a TIMESTAMP column of date type.
I've the following query as below:
select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > to_date('31/OCT/12 23:59:59', 'DD-MON-YY HH24:MI:SS') order by TIME_STAMP asc;
For this, first I am preparing the query as below:
select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > :PKVAL order by TIME_STAMP asc;
Before calling OCIExecute(), I am setting the PKVAL buffer to following value:
"to_date('31/OCT/12 23:59:59', 'DD-MON-YY HH24:MI:SS') "
& calling the OCIBindByName function with data type as SQLT_DATE.
But when the OCIExecute is called, my program crashes with access violation
Can you please guide me what is the correct way to pass the date value in query to OCI? How do we bind the date values?
Thanks in advance for your time and help.
This content has been marked as final.
Show 1 reply
Re: Problem in querying date values in prepared stmts in OCI
Dec 19, 2012 3:20 AM
in response to
Use SQLT_TIMESTAMP instead of DATE