From: | joe speigle <joeofclew(at)yahoo(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | fetch cursor into id, set_values .... -> problem |
Date: | 2007-02-01 18:04:02 |
Message-ID: | 232689.48193.qm@web60714.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hello,
I get this error
#error 1
ERROR: syntax error at or near "," at character 525
LINE 15: FETCH curs INTO id, set_values;
^
from this function
drop function sx(varchar) ;
CREATE OR REPLACE FUNCTION sx( varchar ) RETURNS varchar AS $$
DECLARE
str_in ALIAS FOR $1;
id RECORD ;
set_values RECORD ;
curs CURSOR FOR SELECT id, set_values FROM constraint_table;
BEGIN
OPEN curs;
FETCH curs INTO id, set_values;
IF (str_in = set_values ) THEN RETURN 1::bit(2);
ELSE RETURN 0::bit(2);
END IF;
END;
$$ LANGUAGE plpgsql;
isn't it correct to declare as type RECORD ?
thanks,
joseph.
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-02-01 18:28:56 | Re: query efficiency - Can I speed it up? |
Previous Message | Tom Lane | 2007-02-01 17:57:46 | Re: Newbie Developer Question |