Yes, I couldn't figure out why it wasn't working, so I changed the type from char to varchar. I'll fix it before I go on. Thanks for pointing that out!
Carl http://www.carl-olsen.com/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Aitken Sent: Wednesday, June 15, 2005 11:18 AM To: [EMAIL PROTECTED]; [email protected] Subject: RE: [Mono-list] Npgsql.dll (correction) > Please ignore. I have it working now. > > The problem was in the way I called the function. I was > using SELECT sp_GetStateList(); instead of SELECT * FROM > sp_GetStateList(); > > It looks like I'm ready to start writing some stored procedures. > > Thanks for all the help! It was nothing.... ;) The only thing I could pick up was that StateCode is char(2), but is defined as varchar within Accounts_StateCodes. No major drama, as it obviously works. I'd have them with the same data types myself.... Chris > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Carl Olsen > Sent: Tuesday, June 14, 2005 11:26 PM > To: [EMAIL PROTECTED]; [email protected] > Subject: RE: [Mono-list] Npgsql.dll (correction) > > ERROR: set-valued function called in context that cannot accept a set > CONTEXT: PL/pgSQL function "sp_getstatelist" line 6 at return next > > My table is "Accounts_StateCodes" > The fields are "Description","StateCode","Region" > The types are varchar(60),char(2),varchar(60) > > CREATE TYPE StateCodes AS ( > Description varchar, > StateCode varchar); > > CREATE OR REPLACE FUNCTION sp_GetStateList() > RETURNS SETOF StateCodes AS > ' > DECLARE > r StateCodes%ROWTYPE; > BEGIN > FOR r IN SELECT "Description","StateCode" FROM > "Accounts_StateCodes" LOOP RETURN NEXT r; END LOOP; RETURN; > END; ' LANGUAGE 'plpgsql' VOLATILE; -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
