Results 1 to 5 of 5

Thread: Dynamic SQL

  1. #1
    Join Date
    Feb 2004
    Posts
    107

    Unanswered: 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

  2. #2
    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.

  3. #3
    Join Date
    Feb 2004
    Posts
    107
    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

  4. #4
    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

    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

  5. #5
    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

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •