-
syntax to call procedure inside a procedure in db2
Hi ,
I want to call a procedure inside a procedure in DB2.see the code in inside IF and ELSE IF.
CREATE PROCEDURE ANSHUL.TEST_AANA (IN INV_I INTEGER )
------------------------------------------------------------------------
-- SQL Stored Procedure
------------------------------------------------------------------------
P1: BEGIN
DECLARE varFEE_BILL_TYPE_C CHAR(1);
SELECT VCST1000.FEE_BILL_TYPE_C INTO varFEE_BILL_TYPE_C
FROM
ANSHUL.VCST1000 VCST1000,
WHERE
VCST1000.INV_I=varINV_I;
IF UPPER(varINV_LINE_C)='N' THEN
-- call procedure inv_generate
-- call FEE_DETAIL_PER_INV (INV_I INTEGER, INV_LINE_C 'N')
ELSE IF UPPER(varINV_LINE_C)='D' THEN
-- call procedure inv_generate
-- call procedure FEE_DETAIL_PER_INV (INV_I INTEGER, INV_LINE_C 'S')
-- call procedure FEE_DETAIL_PER_INV (INV_I INTEGER, INV_LINE_C 'A')
END IF;
-------------------------------------------------------------------------
kindly tell me the syntax how to call???
Thanx and Regards
Anshul
END P1
-
I'm not familiar with DB2.. In MS-SQL you can use "EXEC()" command/function (or the "sp_executesql" stored procedure).
If you need to get a result set from the stored procedure, you will likely need to cache it into a temp table, like:
Create #TempTable (<column definitions...>)
Insert into #TempTable Exec sp_MySP <parameters...>
However, as I said - this is MS-SQL Server... DB2 may be different...
Bob Rouse
Dimension Data
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks