#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    5
    Rep Power
    0

    Unhappy Error when no record found...


    How can I prevent an error occured when the function return no record?

    Code:
    CREATE FUNCTION public.getcountry(text) RETURNS public.country AS'
    Select * From Country where countryCode = $1
    'LANGUAGE 'sql' VOLATILE;

    Call:
    select * from getcountry('USA')
    -> Return 1 record

    select * from getcountry('123')
    -> Description: ERROR: ExecMakeTableFunctionResult: Invalid result from function returning tuple
    Last edited by ptmhki; August 17th, 2003 at 11:20 PM.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    5
    Rep Power
    0

    Unhappy


    Can anyone help me?

IMN logo majestic logo threadwatch logo seochat tools logo