inter sp calls 
Author Message
 inter sp calls

Hi evereybody,

I would need help on a basic problem, that I unfortunately cannot solve.

Considering 2 stored procedures sp1 and sp2. Both are developed in Java.
* sp1 retrieves a double. It works in the Stored Procedure Builder so far
* sp2 creates a CallableStatement to invoke sp1 with the CALL SQL STATEMENT.

Executing sp2 turns to hell since I get the SQL1131N  (Wrong interruption in
DARI ...) or SQL0751N (Function tried to exectute wrong instruction ...).

How do I program a sp call from a stored procedure ?

I  really look forward reading your advice,

Al



Sat, 30 Jul 2005 17:53:06 GMT
 inter sp calls

What version of db2? Recursive CALL for Java is not supported until v8.


Quote:
> Hi evereybody,

> I would need help on a basic problem, that I unfortunately cannot solve.

> Considering 2 stored procedures sp1 and sp2. Both are developed in Java.
> * sp1 retrieves a double. It works in the Stored Procedure Builder so far
> * sp2 creates a CallableStatement to invoke sp1 with the CALL SQL
STATEMENT.

> Executing sp2 turns to hell since I get the SQL1131N  (Wrong interruption
in
> DARI ...) or SQL0751N (Function tried to exectute wrong instruction ...).

> How do I program a sp call from a stored procedure ?

> I  really look forward reading your advice,

> Al



Sun, 31 Jul 2005 02:19:27 GMT
 inter sp calls
Here's the code I use, it seems to work fine...

  //Step #2: Get all Procedures
  strSQL = "SELECT APP.RATING_LOGIC_PROCEDURES.PROCEDURE FROM
APP.RATING_LOGIC_PROCEDURES, APP.SERVICES" +
           " WHERE APP.SERVICES.CODE='" + strServiceCode + "' AND" +
           " APP.SERVICES.CARRIER_CODE='" + strCarrierCode + "' AND" +
           "
APP.RATING_LOGIC_PROCEDURES.RATING_LOGIC_CODE=APP.SERVICES.RATING_LOGIC_CODE
" +
           " ORDER BY 'ORDER' ASC";
  stmtSQL = objCon.createStatement();
  rs = stmtSQL.executeQuery(strSQL);
  while (rs.next())
  {
   strProcedure = rs.getString("PROCEDURE");
   strProcedure = "{call " + strProcedure + "(?, ?, ?)}";

   objProcCall = objCon.prepareCall(strProcedure);
   objProcCall.setInt(1, intPackageID);
   objProcCall.setString(2, strServiceCode);
   objProcCall.setString(3, strCarrierCode);

   try
   {
    objProcCall.executeQuery();
   }
   catch(Exception e)
   {
    throw new Exception("Error running sub-procedure.");
   }
  }
  rs.close();
  stmtSQL.close();


Quote:
> Hi evereybody,

> I would need help on a basic problem, that I unfortunately cannot solve.

> Considering 2 stored procedures sp1 and sp2. Both are developed in Java.
> * sp1 retrieves a double. It works in the Stored Procedure Builder so far
> * sp2 creates a CallableStatement to invoke sp1 with the CALL SQL
STATEMENT.

> Executing sp2 turns to hell since I get the SQL1131N  (Wrong interruption
in
> DARI ...) or SQL0751N (Function tried to exectute wrong instruction ...).

> How do I program a sp call from a stored procedure ?

> I  really look forward reading your advice,

> Al



Sun, 31 Jul 2005 08:26:01 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Calling a SP from a SP

2. call remote server SP from SP

3. How can I call a SP inside a SP without the owner name

4. Return Value from sp to calling sp

5. calling a sp from another sp

6. Problem with results and SP calling SP in VB

7. Call an SP in a SP or write the SQL

8. Transaction and SP calling SP

9. Calling SP from application *and* another SP

10. Call SP in SELECT of other SP

11. newbie..how to call sp from sp

12. Error 18481 when calling remote SP from local SP


 
Powered by phpBB® Forum Software