on 09-27-2006 3:35 PM
I am trying to execute a stored procedure in the sender JDBC. I am using EXECUTE <stored_proc name>.But it returns the error The JDBC driver returned the following error message: 'java.sql.SQLException: [SQL0084] SQL statement not allowed What could be issue?
AR
Hi,
Are you trying to connect to an Oracle DB?
If yes, then Sender JDBC adapters do not support Oracle Stored Procedures. Reason being that Sender JDBC adapters expect a Resultset as its output, but Oracle Stored Procedures return a Cursor.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Antonio,
The best way to check if the Statement is correct is to make execute the stored procedure from your DB client.
Also, make sure DB2 returns a Resultset for its Stored Procedure and not cursors. And, make sure that there is a Stored Procedure contains exactly one Select statment.
regards,
Bhavesh
I am checking the stored procedure, and is it ok to use a read statement instead of a select inside the stored procedure. As all data in DB2, are stored as files. The primary condition for XI driven store procedure should be only 1 single select. Is it acceptable to have a READ statement to pick the data inside the store procedure?
Sorry.......
I was saying Select only in sender commn. channel.
BTW, why dont you use SELECT from commn. channel? Is it a problem? I just heard from AS400 team member, that read statement returns a single record. If that is what you need, you can do it using SELECT with appropriate where clause.
Regards,
Jai Shankar.
Actually we were having problems in selecting a limited number of records and it works fine with a select if we can specify the number of rows to be selected but at the same time we need to update after the selected rows. This is possible only when the Where clauses are the same. This is the reason for going for a stored procedure. If its possible by SELECT /UPDATE that would be awesome..
If you need to process records one by one use the "min" operator in your where clause(This is exactly what I have done). If you need some 10, 20 records try "top" operator. I am not sure about this top operator. But a experienced DB2 person will defenitely be able to give you a solution.
Regards,
Jai Shankar.
Hi,
As I told you, Ihave not tried "top" operator. I am giving you a sample sql where I have used "min".
SELECT <Libraryname>.<table1>.field1, <library name>.<table1>.field2, <library name>.<table1>.field3, <library name>.<table2>.field1, <library name>.<table2>.field2, <library name>.<table2>.field3, from <library name>.<table1>,<library name>.<table2> where <library name>.<table1>.field1 = (select min(<library name>.<table1>.field1) from <library name>.<table1>)
Hope this helps you.
Regards,
Jai Shankar.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.