Home » Developer & Programmer » JDeveloper, Java & XML » Cannot extract hour from date field (Oracle 10.1.0.2 with OCI jdbc driver)
Cannot extract hour from date field (Oracle 10.1.0.2 with OCI jdbc driver) [message #92493] Fri, 13 August 2004 05:51
Mathieu Peltier
Messages: 1
Registered: August 2004
Junior Member
Hi,

I use Oracle 10.1.0.2 with OCI driver. I have got a problem with the following Java code:

... create connection and statement ...
s.executeUpdate("CREATE TABLE test(d DATE)");
s.executeUpdate("INSERT INTO test VALUES ({t '11:14:15'})");
ResultSet rs = s.executeQuery("SELECT {FN HOUR(d)} FROM test");

The last line throws the following exception:
ORA-30076: invalid extract field for extract source

I have tried also the syntax "SELECT EXTRACT(HOUR FROM d) FROM test" as explained in the SQL Reference Guide, but I get the same error - it seems that only year, month or day can be extracted in fact.

Could someone help me?
thanks in advance,
Previous Topic: Cookies
Next Topic: problem deploying EJBs on JBoss 3.2.2
Goto Forum:
  


Current Time: Tue Nov 26 01:19:24 CST 2024