carl at carl-olsen.com
Sun May 15 13:51:16 EDT 2005
It looks to me like there is some increased functionality in version 8 of
PostgreSQL. I'm still using 7.4.7, so I can only return one column for each
function call using psql. I can still get a complete table. It's just a lot
of extra typing to write a lengthy select statement. I'll just ignore the
inconvenience until I get around to upgrading to version 8 of PostgreSQL.
I'll try your select statements on my version, but I have a feeling they are
not going to run on my version of PostgreSQL.
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Francisco
Sent: Sunday, May 15, 2005 12:18 PM
To: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Npgsql.dll
-----BEGIN PGP SIGNED MESSAGE-----
Carl Olsen wrote:
> I have the page working better now, but the stored procedures aren't doing
> what I want. I'm using an sql stored procedure that returns a set of
> records. My function is called senators() - ("select * from
> senate_members") and it returns the entire table. The Npgsql command text
> is "select field1(senators()), field2(senators())" and it returns the
> information correctly. I was just hoping I could write ("select field1,
> field2 from senators") as the function instead of returning the entire
> table. It seems like the stored procedures in MSSQL 2000 are a lot better
> than the stored procedures in PostgreSQL, but maybe I still don't know
> I'm doing. I could just as easily execute this query directly on my
> database and return only the two fields I need. The stored procedure
> giving me any increase in efficiency, and it actually appears to be less
Did you try "select field1, field2 from senators()" ?
I'm using pg 8.0 here with a function like this, for Npgsql tests:
create function funcB() returns setof tablea as '
select * from tablea;
' language 'sql';
And I can do:
npgsql_tests=> select * from funcb();
field_serial | field_text | field_int4 | field_int8 |
1 | Random text | | |
2 | | 4 | |
3 | | | 8 |
4 | | | | t
5 | Text with ' single quote | | |
npgsql_tests=> select field_serial from funcb();
I hope it helps.
Francisco Figueiredo Jr.
Npgsql Lead Developer
MonoBrasil Project Founder Member
"Science without religion is lame;
religion without science is blind."
~ Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list