Hi,
--On Montag, 25. November 2002 01:17 +0800 annachau <annachau@hongkong.com>
wrote:
> Error Occurred when run function. Please give me some advices. Thanks.
>
> The function:
> -- Function: usf_annatest(varchar, varchar)
> CREATE FUNCTION usf_annatest(varchar, varchar) RETURNS varchar AS '
> DECLARE
> curs_userdetail refcursor;
> table_name ALIAS for $1;
> identity ALIAS for $2;
> query_where VARCHAR;
>
> BEGIN
> IF table_name = "ot_customer" THEN
^^^^^^^^^^^^
(as the error tells you) You have to write ''ot_customer'' note the
double single ' instead of one double ".
Regards
Tino
> RETURN table_name;
> ELSE
> RETURN identity;
> END IF;
> END;' LANGUAGE 'plpgsql';
>
> I run it :
> SELECT usf_annatest('ot_test', 'anna');
>
> Error :
> NOTICE: Error occurred while executing PL/pgSQL function usf_annatest
> NOTICE: line 8 at if
> ERROR : Attribute 'ot_customer' not found.
>
> So, when I need to user "ot_customer" and 'ot_customer'.
>
> Thanks a lot.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)