on 06-16-2005 8:53 PM
Hi!
I have a problem.
I created a sequence un SQL Studio, there I can obtain the next value of the sequence using:
SELECT user.seqname.nextval from dual
but I'm not able to retrieve it from a java program with sqlj. When I try the previous query, It says that 'dual' is not a table...
How do you get the next value of a sequence from sqlj?
Thank you!!!
Hi Sergio,
you must use JDBC to do this. You can get the connection from you SQLJ connect context and use that with JDBC.
Good luck!
Cheers,
Jeff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answer, but I tried that, too...
I executed the following query with JDBC: "SELECT testseq.nextval from dual"
and I got:
java.lang.SQLException: The SQL statement "SELECT "TESTSEQ"."NEXTVAL" FROM "DUAL"" contains the semantics error[s]: table "DUAL" unknown
I don't know what i'm doing wrong...
Hmmm...now that I think about this I think I last did this with 6.20 J2EE Engine when there was no underlying DB...I don't think Open SQL allows you to select from sequences since it doesn't know about them. Try this, create a new datasource to MaxDB, and set the connection type to Native or Vendor SQL...get a connection to that datasource and send your SQL sequence selection to it....I bet that will work.
Good luck!
Jeff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.