Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    83

    Lightbulb Unanswered: function returning a table

    I have the below function

    CREATE FUNCTION thatreturnstable()
    RETURNS TABLE(SHORT varchar(5))
    language SQL
    DETERMINISTIC
    READS SQL DATA
    CALLED ON NULL INPUT
    EXTERNAL ACTION
    return
    select shot from temporary

    I have compiled this successfully,
    I called this function in a select query

    select * from TABLE(thatreturnstable())

    i got the following error.

    SQL0104N An unexpected token "END-OF-STATEMENT" was found
    following "(thatreturnstable())". Expected tokens may include:
    "<correlation_name> ( <derived_co".



    please advice me how to call that function in an SQL query

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    The answer is right there:

    Quote Originally Posted by krReddy

    SQL0104N An unexpected token "END-OF-STATEMENT" was found
    following "(thatreturnstable())". Expected tokens may include:
    "<correlation_name>
    ( <derived_co".

    select * from TABLE(thatreturnstable()) t
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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