[Mono-list] Npgsql.dll (correction)
chris at ion-dreams.com
Wed Jun 15 12:17:36 EDT 2005
> 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
> 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....
> -----Original Message-----
> From: mono-list-bounces at lists.ximian.com
> [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Carl Olsen
> Sent: Tuesday, June 14, 2005 11:26 PM
> To: chris at ion-dreams.com; mono-list at lists.ximian.com
> 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
> r StateCodes%ROWTYPE;
> 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.
More information about the Mono-list