If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Dynamic SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-04, 05:07
Jake K Jake K is offline
Registered User
 
Join Date: Feb 2004
Posts: 107
Dynamic SQL

hi friends,

I wonder anyone will use Dynamic CALL statements... I don't think it has a real value... I accept it is really worth to have dynamic sql statements support... but dynamic call statements, i'm not sure....

Can anyone give a realtime scenario where dynamic call statements can be used. or in other words, are anyone using/used dynamic call statements in their sprocs.

plz correct me if i am wrong.

Jake
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 06:44
Walter Janissen Walter Janissen is offline
Registered User
 
Join Date: Nov 2003
Location: Germany
Posts: 62
Hi

If you are talking about DB2 z/OS, you cannot dynamically execute the SQL-statement CALL. The only thing you can do is, CALL :HV,where HV contains the name of a stored procedure.
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 06:52
Jake K Jake K is offline
Registered User
 
Join Date: Feb 2004
Posts: 107
Quote:
Originally posted by Walter Janissen
Hi

If you are talking about DB2 z/OS, you cannot dynamically execute the SQL-statement CALL. The only thing you can do is, CALL :HV,where HV contains the name of a stored procedure.
good to see your quick reply. i'm talking about DB2 UDB and moreover i like to know the need for the dynamic call statement and its real time usage in the industry. Hope I'm clear.

Jake
Reply With Quote
  #4 (permalink)  
Old 03-01-04, 09:46
victor9k victor9k is offline
Registered User
 
Join Date: Aug 2003
Location: bucharest, romania
Posts: 11
Hello!

Well you can think about the situation you do not know exactly what stored procedure you want to call. You might have a group of stored procedure exposing some sort of "interface" (same params, same return type, but of course different functionality). At runtime you will call dinamically the apropriate stored procedure depending on your flow.

Victor

Quote:
Originally posted by Jake K
good to see your quick reply. i'm talking about DB2 UDB and moreover i like to know the need for the dynamic call statement and its real time usage in the industry. Hope I'm clear.

Jake
Reply With Quote
  #5 (permalink)  
Old 03-02-04, 00:04
Jake K Jake K is offline
Registered User
 
Join Date: Feb 2004
Posts: 107
hi friends,

When I went through the nesting of stored procedures, i found that you have to use the dynamic call statement for recursively calling the same procedure for successful compilation. If the static SQL is used instead, the procedure name will not be resolved at the compile time and this will generate a compile error.

Any other real time use???

Jake

Quote:
Originally posted by victor9k
Hello!

Well you can think about the situation you do not know exactly what stored procedure you want to call. You might have a group of stored procedure exposing some sort of "interface" (same params, same return type, but of course different functionality). At runtime you will call dinamically the apropriate stored procedure depending on your flow.

Victor
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On