Error Occurred when run function. How to solve it?

From: "annachau" <annachau(at)hongkong(dot)com>
To: "" <pgsql-general(at)postgresql(dot)org>
Subject: Error Occurred when run function. How to solve it?
Date: 2002-11-24 17:17:49
Message-ID: 1038158269.17822.annachau@hongkong.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-11-24 17:33:40 Re: is backing up a live postgres enough?
Previous Message Colin Stearman 2002-11-24 17:15:11 Re: is backing up a live postgres enough?