Solved

My procedure calling another procedure gives out error code SQL0954C after 10 executions.

Posted on 2008-06-12
5
498 Views
Last Modified: 2012-06-27
I have a Stored procedure with 2 IN parameters (dbname,schemaname) and 3 OUT parameters one for the count of calls to the 2nd Stored procedure and the other 2 to capture the error messages upon error handled. The procedure gets all the tables in the schema through a cursor and calls another Stored procedure by passing in the dbname,schemaname and table name as 3 parameters, which will insert one row per table into a metadata table.
I can see 10 rows getting inserted into the table and nothing happens after that. It is always 10 rows but the process should process around 150 rows.
I am either getting an error - SQL0954C Not enough storage is available in the application heap to process the statement.
Or at times it is just hanging up and no response. I had to ask the DBA to unlock the tables when ever it is getting struck.
0
Comment
Question by:boppanak
  • 2
5 Comments
 
LVL 45

Expert Comment

by:Kdo
ID: 21769894
Hi boppanak,

Both symptoms are potential results of the same cause.  Let's see if we can to where you're always getting the same error and deal with that.

The SQL0954C error can be resolved by increasing the size of the application heap.  The default value is often too low for complex or large queries.

If DB2 is on a unix/linux server, have the DBA try this:

  db2 connect to {my_database}
  db2 get db cfg|grep APPLHEAPSZ

DB2 will report something like:

 Default application heap (4KB)             (APPLHEAPSZ) = 230

Increase the value (perhaps 300) by having the DBA enter the following:

  db2 update db cfg using APPLHEAPSZ 300

I don't recall if that's a dynamic change or if DB2 must be restarted, but it should get you past the failure at 10 calls that you're seeing.


If that doesn't actually solve the problem, you'll need to take a detailed look at the cause.  Perhaps you can post the Stored Procedures.  It sounds like you're nesting Procedure Calls, in an almost recursive fashion, but I'd like to see the code.


Good Luck,
Kent




0
 

Author Comment

by:boppanak
ID: 21770061
The code is as follows ...
The execution procedure is edw_insert_all_tabs.db2 which will keep calling edw_insert_new.db2 once for each row retrieved through the cursor.
edw-insert-new.txt
edw-insert-all-tabs.txt
0
 
LVL 45

Accepted Solution

by:
Kdo earned 500 total points
ID: 21770520

Try putting a COMMIT in edw-insert-new, right after the EXECUTE IMMEDIATE.

Kent
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now