Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2003
    Posts
    49

    Unanswered: DB2 function calling stored procedure

    How to call a stored procedure from a function??

    Both function and stored procedures are supposed to return a table.

    CREATE FUNCTION Fn_Tasks(ID vargraphic(40))
    RETURNS TABLE (Id vargraphic(40),
    TaskId vargraphic(40),
    TaskName vargraphic(255),
    TaskStatus vargraphic(75),
    Depth int
    )


    F1: BEGIN ATOMIC

    RETURN CALL Get_Tasks(ID);

    END

    @

    The error I get is
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0104N An unexpected token "(ID" was found following "CALL
    Get_Tasks". Expected tokens may include: "<space>". LINE NUMBER=12.
    SQLSTATE=42601


    Thanks in advance,
    Asha
    Last edited by asha192; 06-28-03 at 09:45.

Posting Permissions

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