[Mono-list] Npgsql.dll (correction)
carl at carl-olsen.com
Wed Jun 15 22:22:21 EDT 2005
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!
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Chris Aitken
Sent: Wednesday, June 15, 2005 11:18 AM
To: carl at carl-olsen.com; mono-list at lists.ximian.com
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
> 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.
Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list