Professional Web Applications Themes

CALL (SQL)Stored Procedure from (SQL)UDF ? - IBM DB2

Hi, Is it possible to call a (SQL)SP from a (SQL)UDF ? - v8.1 fp2 I have been searching around and it looks not possible, but I just wanted to double check. - basically, I need to go to the SP to do some dynamic SQL which isn't supported in a UDF i.e to parameterise the table name in a query. SET s1='SELECT.... FROM'||v_tabname; PREPARE stmt1 from s1; OPEN c1; FETCH c1 INTO v_maxoid; Many thanks. Paul....

  1. #1

    Default CALL (SQL)Stored Procedure from (SQL)UDF ?

    Hi,

    Is it possible to call a (SQL)SP from a (SQL)UDF ?
    - v8.1 fp2

    I have been searching around and it looks not possible,
    but I just wanted to double check.

    - basically, I need to go to the SP to do some dynamic
    SQL which isn't supported in a UDF
    i.e to parameterise the table name in a query.

    SET s1='SELECT.... FROM'||v_tabname;
    PREPARE stmt1 from s1;

    OPEN c1;
    FETCH c1 INTO v_maxoid;

    Many thanks.

    Paul.
    Paul Guest

  2. #2

    Default Re: CALL (SQL)Stored Procedure from (SQL)UDF ?

    Paul Reddin wrote:
     

    I don't believe Call is supported in a SQL UDF. Why not try an external
    C/java udf, it can do dynamic statement as long as you are not using MPP.

    No Guest

  3. #3

    Default Re: CALL (SQL)Stored Procedure from (SQL)UDF ?

    We hope to get CALL in UDF and triggers supported concurrently with the
    removal of the C-Compiler requirement.
    Until then you can write a wrapper external UDF that CALLs the SP.

    Cheers
    Serge


    Serge Guest

  4. #4

    Default Re: CALL (SQL)Stored Procedure from (SQL)UDF ?

    OK,

    Thanks.

    I'll put off doing it this way for now.

    Paul.

    "Serge Rielau" <eyebeem.com> wrote in message news:<bl3rer$gdp$torolab.ibm.com>... 
    Paul Guest

Similar Threads

  1. Stored Procedure call using MSSQL::DBLIB
    By newbie24 in forum PERL Modules
    Replies: 0
    Last Post: April 6th, 09:06 PM
  2. Can Flash call an MSSQL stored procedure?
    By atrav in forum Macromedia Flash Data Integration
    Replies: 2
    Last Post: September 23rd, 04:44 PM
  3. asp to call Oracle stored procedure
    By eddie wang in forum ASP Database
    Replies: 0
    Last Post: March 2nd, 10:08 PM
  4. the SQL1131N error when I call a stored procedure
    By zhouhaiming in forum IBM DB2
    Replies: 3
    Last Post: July 24th, 09:57 AM
  5. Call a stored procedure with decimal parameter
    By Mona in forum ASP.NET General
    Replies: 2
    Last Post: June 27th, 01:31 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139