java.sql.SQLException: Invalid column type: getLong not implemented for class ora
cle.jdbc.driver.RowidAccessor
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.Accessor.unimpl(Accessor.java:358)
at oracle.jdbc.driver.Accessor.getLong(Accessor.java:496)
at oracle.jdbc.driver.OracleReturnResultSet.getLong(OracleReturnResultSet.java:290)
at fan.sql.StatementPeer.executeResult(StatementPeer.java:245)
at fan.sql.StatementPeer.execute(StatementPeer.java:208)
at fan.sql.Statement.execute(Statement.fan)
at fan.sql.Statement.execute(Statement.fan)
The jdbc driver is Oracle version - 10.2.0.1.0 . How can I avoid this problem ?
brianMon 17 Dec 2012
That looks like one of two problems:
trying to get update count and its not supported by JDBC driver
trying to get specific column with number type as long
Some of the update stuff seems to be most inconsistent b/w JDBC drivers. Do you know how to pull from hg and rebuild the latest sql pod from source? If you can do that we can try and debug and figure out what exactly the problem is. I've made quite a few changes since our last build.
motonaoTue 18 Dec 2012
Do you know how to pull from hg and rebuild the latest sql pod from source?
Yes, I do. I tryed to build from source and run on it.
java.sql.SQLException: Invalid column type: getLong not implemented for class oracle.jdbc.driver.RowidAccessor
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :146)
at oracle.jdbc.driver.Accessor.unimpl(Accessor.java:358)
at oracle.jdbc.driver.Accessor.getLong(Accessor.java:496)
at oracle.jdbc.driver.OracleReturnResultSet.getLong(OracleReturnResultSe t.java:290)
at fan.sql.StatementPeer.executeResult(StatementPeer.java:257)
at fan.sql.StatementPeer.execute(StatementPeer.java:220)
at fan.sql.Statement.execute(Statement.fan)
at fan.sql.Statement.execute(Statement.fan)
at fan.aeontest_0.InsAeon$main$0.doCall(/D:/test.fan:45)
:
SQL insert statement itself is succeeded, and the record is added , then the above exception occurs.
tcolarTue 18 Dec 2012
Are you trying to get the autogenerated id of the new inserted row ?
I remember several years back using SAP/Oracle with Fantom and having an issues like that.
Basically Oracle did/does not support that the "standard" way of returning generated keys and I had to use a workaround (I think using a sequence and then select mysequence.nextval after the insert IIRC).
I don't miss using Oracle at all, while SQL "standrad" is not eally respected by anybody, Oracle was particularly a pain to deal with. .
If that sounds like your issue, i can try to dig for the workaround I had (might have had to use java sql connection directly from Fantom, but can't quite remember)
I'm not trying to get the autogenerated id of the new inserted row. I just try to insert a record, and occur exception on the Statement.execute() but the record is inserted.
I try to execute same sql statement on java-jdbc code. Then when I set Statement.RETURN_GENERATED_KEYS get same oracle error , and I set Statement.NO_GENERATED_KEYS , it is OK.
motonao Mon 17 Dec 2012
I execute insert statement using sql pod
then I got exception below.
The jdbc driver is Oracle version -
10.2.0.1.0
. How can I avoid this problem ?brian Mon 17 Dec 2012
That looks like one of two problems:
Some of the update stuff seems to be most inconsistent b/w JDBC drivers. Do you know how to pull from hg and rebuild the latest sql pod from source? If you can do that we can try and debug and figure out what exactly the problem is. I've made quite a few changes since our last build.
motonao Tue 18 Dec 2012
Yes, I do. I tryed to build from source and run on it.
SQL insert statement itself is succeeded, and the record is added , then the above exception occurs.
tcolar Tue 18 Dec 2012
Are you trying to get the autogenerated id of the new inserted row ?
I remember several years back using SAP/Oracle with Fantom and having an issues like that.
Basically Oracle did/does not support that the "standard" way of returning generated keys and I had to use a workaround (I think using a sequence and then select mysequence.nextval after the insert IIRC).
I don't miss using Oracle at all, while SQL "standrad" is not eally respected by anybody, Oracle was particularly a pain to deal with. .
If that sounds like your issue, i can try to dig for the workaround I had (might have had to use java sql connection directly from Fantom, but can't quite remember)
tcolar Tue 18 Dec 2012
See this for relevant info: http://stackoverflow.com/questions/1004128/obtain-id-of-an-insert-in-the-same-statement
motonao Tue 18 Dec 2012
My explaination is confusing , sorry.
I'm not trying to get the autogenerated id of the new inserted row. I just try to insert a record, and occur exception on the Statement.execute() but the record is inserted.
brian Tue 18 Dec 2012
Okay, so Oracle says they support auto-generated keys, but you can't access them as a long.
Thanks for helping me debug
motonao Wed 19 Dec 2012
No, I don't. It has two-column primary key, and they are both varchar, need to specify value explicitly when I add a record.
The result is :
I try to access it as str, and it is successful.
But I don't know if it is useful to get list of new records' rowids.
Is there anything else that I try ?
brian Wed 19 Dec 2012
Can you try out this changeset and let me know if that fixes your problem. Thanks
motonao Thu 20 Dec 2012
That works fine for INSERT .... VALUES statements. Thank you very much.
But I tried INSERT ... SELECT statement to see multiple list return value then occured another exception . It seems like this problem.
https://forums.oracle.com/forums/thread.jspa?messageID=10263361
That statement works correctly on SQLPlus. I will post after examining a little more. Do I post it on this topic ?
brian Thu 20 Dec 2012
What is exception?
motonao Sat 22 Dec 2012
When I try to execute INSERT .... SELECT satement, SqlErr is raised.
I try to execute same sql statement on java-jdbc code. Then when I set Statement.RETURN_GENERATED_KEYS get same oracle error , and I set Statement.NO_GENERATED_KEYS , it is OK.
brian Wed 2 Jan 2013
What happens if you use
query
instead ofexecute
?motonao Tue 8 Jan 2013
When I use
execute
then smilar error is raised.