Why does executing the PreparedStatement class cause a TRUNC fails: ORA-00932: inconsistent datatypes error?
Submitted by: AdministratorAccording to Oracle Metalink Bug Database Doc ID: 144784.1, in the absence of explicit data typecasting, OCI assumes that a bind variable is a CHAR data type. If the SQL statement intends to use the bind variable as a DATE data type, but OCI thought it was a CHAR, the SQL parser will have a conflict in data types. The fix is to explicitly use data conversion functions to convert the bind variables in the problem queries. For example, a select string of
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(?)";
should be changed to:
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(TO_DATE(?))";
Submitted by: Administrator
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(?)";
should be changed to:
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(TO_DATE(?))";
Submitted by: Administrator
Read Online BEA Weblogic Job Interview Questions And Answers
Top BEA Weblogic Questions
☺ | Can I use the getAttribute() and setAttribute() methods of Version 2.2 of the Java Servlet API to parse XML documents? |
☺ | Which of the following are the benefits of MDB (Message Driven Beans) over standard JMS consumers? |
☺ | Why do I get an error while trying to retrieve the text for ORA-12705? |
☺ | Why am I getting an ORA-01000: maximum open cursors exceeded error, even though I closed all ResultSet, Statement, and Connection objects? |
☺ | Can WebLogic Server start with a UNIX boot? |
Top Application Program Categories
☺ | AutoCAD Interview Questions. |
☺ | Microsoft Office Interview Questions. |
☺ | Microsoft Outlook Interview Questions. |
☺ | Microsoft Excel Interview Questions. |
☺ | MATLAB Interview Questions. |