fetch cursor into id, set_values .... -> problem - Mailing list pgsql-novice

From joe speigle
Subject fetch cursor into id, set_values .... -> problem
Date
Msg-id 232689.48193.qm@web60714.mail.yahoo.com
Whole thread Raw
List 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.

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Newbie Developer Question
Next
From: Tom Lane
Date:
Subject: Re: query efficiency - Can I speed it up?