09-12-2008 07:42 AM - edited 03-14-2019 02:52 AM
I am using a DB Read statement to call a stored procedure in an oracle database from a simple test script, but getting a sql error everytime. Is there any way to find out what the sql error is?
The select statement looks like
SELECT ROP_USER.SHE_VALIDATE_WORK_ORDER( $StoreID , $WorkOrderID ) WORKORDERID , CURRENTSTATUS , CALLEXISTSFLAG FROM DUAL;
I have a dummy table defined that has WORKORDERID , CURRENTSTATUS , CALLEXISTSFLAG defined as VARCHAR2(50).
Thx
09-12-2008 11:08 AM
Hi,
To see the Oracle error, turn up the tracing to level 7 (expand the normal view to expanded) on the SS_DB step.
Execute the script and check the log file
and search for the Oracle error codes ORA-
curious how the PL/SQL Proc turns out, please let me know
Blair
*please rate all posts
09-12-2008 11:17 AM
I looked in the MIVR log files after turning on the debug you suggested and found the SQL 904 error. Now I have to figure out what that means.
Thanks again.
09-12-2008 11:46 AM
If its an ORA-904 error
(invalid column name)...
try this
SELECT ROP_USER.SHE_VALIDATE_WORK_ORDER( $StoreID , $WorkOrderID ) AS WORKORDERID , CURRENTSTATUS , CALLEXISTSFLAG FROM DUAL;
Try naming the Pl/sql column with an AS
PL/SQL procedures and CRS scripting Database steps have issues in my experience. I think technically Procedures don't return a value on a select, hence maybe this is where the 904 error comes in
I have been able to retrieve a PL/SQL Function, as opposed to a Procedure from a
select statement from dual on a DB Read CRS step. There are limitations in Oracle with PL/SQL functions versus PL/SQL procedures, but Functions do return a value and can be called be selected from.
If you must use a Procedure are comfortable with Java create a custom class to retrieve the Oracle PL/SQL Procedure may be the way to go.
let me know how it goes
Blair
*Please rate all useful posts
09-16-2008 06:40 AM
Thanks Blair,
I changed the syntax to use an as, but now I get a 920 error.
Any idea on that error.
I am not comfortable with a custom class, but can a sql function return multiple return values?
Thanks
09-16-2008 07:32 AM
Not sure of the 920 error, I can speculate this is related to the Procedure Call in a select statement
A PL/SQL function can only return 1 Value, however you could write a seperate function for each value needed and treat them each as a column, not the most Database efficient but workable.
Keep me posted, I want to hear how it turns out
Blair
*Please rate all useful posts
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide