RE: Dynamic SQL PL

RE: Dynamic SQL PL

 

  

Hey Das Ashim K,
Will the code below work (I saved it in a file named "Test7.txt")?


CREATE PROCEDURE P (IN P1 VARCHAR(1), P2 VARCHAR(1), P3 VARCHAR(1))
BEGIN
DECLARE txt VARCHAR(2000);
SET txt = 'CALL P(P1, P2, P3)';
EXECUTE IMMEDIATE txt;
[Email Address Removed] -vf Test7.txt -[Email Address Removed] Message-----
From: Edwards Ed
[mailto:db2udbdba-ezmlmshield-x33175299.[Email address protected]
Sent: Monday, April 28, 2008 10:05 AM
To: LazyDBA Discussion
Subject: RE: Dynamic SQL PL

Will the following below work?

CREATE PROCEDURE P (IN vProcName VARCHAR(50) )
BEGIN
DECLARE txt VARCHAR(2000);
SET txt = 'CALL '|| P('ED')';
EXECUTE IMMEDIATE txt;
[Email Address Removed] Message-----
From: Das Ashim K
[mailto:db2udbdba-ezmlmshield-x62396504.[Email address protected]
Sent: Monday, April 28, 2008 9:59 AM
To: LazyDBA Discussion
Subject: RE: Dynamic SQL PL

Hi Ed,
This is an example of Dynamic SQL

What I am looking for is

CREATE PROCEDURE P (IN vProcName VARCHAR(50) )
BEGIN
DECLARE txt VARCHAR(2000);
SET txt = 'CALL '|| vProcName';
EXECUTE IMMEDIATE txt;
[Email Address Removed] Message-----
From: Edwards Ed
[mailto:db2udbdba-ezmlmshield-x38663384.[Email address protected]
Sent: Monday, April 28, 2008 9:45 AM
To: LazyDBA Discussion
Subject: RE: Dynamic SQL PL

Well, well, well!
It's Das Ashim K! hehe. How have you been?


CREATE PROCEDURE P ()
BEGIN
DECLARE txt VARCHAR(2000);
SET txt = 'CREATE TABLE T212 (C1 INT)';
EXECUTE IMMEDIATE txt;
[Email Address Removed] -vf DB2_EX_Imm.txt -[Email Address Removed]

Please take a few minutes to provide feedback on the quality of service
you received from our staff. The Department of Education values your
feedback as a customer. Commissioner of Education Dr. Eric J. Smith is
committed to continuously assessing and improving the level and quality
of services provided to you.Simply use the link below. Thank you in
advance for completing the survey.


http://data.fldoe.org/cs/default.cfm?staff=Ed.[Email address protected]




-----Original Message-----
From: Das Ashim K
[mailto:db2udbdba-ezmlmshield-x39874992.[Email address protected]
Sent: Monday, April 28, 2008 9:33 AM
To: LazyDBA Discussion
Subject: Dynamic SQL PL


Hi,
Does DB2 support Dynamic SQL PL (Similar to Dynamic PL/SQL )
(This is different from Dynamic SQL)

Thanks,
Ashim.




---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


DB2 & UDB email list listserv db2-l LazyDBA home page