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
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.