[Mono-list] Npgsql.dll

Carl Olsen 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.

Thank you!

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Francisco
Figueiredo Jr.
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-----
Hash: SHA1

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
what
> 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
isn't
> giving me any increase in efficiency, and it actually appears to be less
> efficient.
> 

Hi Carl!

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 |
field_bool
-
--------------+--------------------------+------------+------------+--------
----
            1 | Random text              |            |            |
            2 |                          |          4 |            |
            3 |                          |            |          8 |
            4 |                          |            |            | t
            5 | Text with ' single quote |            |            |
(5 rows)



npgsql_tests=> select field_serial from funcb();
 field_serial
- --------------
            1
            2
            3
            4
            5


I hope it helps.






- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://gborg.postgresql.org/project/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -------------
"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

iQEVAwUBQoeERP7iFmsNzeXfAQI2BAgAoStXLGhYqEEreBKigtQvo+mKZ89UR8cX
NViI4Evjx3yAN/w9hT/Qms/MedAdugomoYKRyzj9RUCBiv29Awhh8LNIS28W239v
+HgvI+4jKt8iGi/ok7RidXvay/dyQCF0owV4NJil54S8xvZjblMp6vjBhnTZ0cbc
mbFlTTigH1ROC9TQdnD0RZ2945WU396TH5IcSDNGhhAgTPKura6Sg8ANTX3tr2Ml
U2nWgbtkh//zXx1ytQ61ZZykSG8WafHw+80buHU2Xo2TfKdcmyvcInwxJVB20wJe
d/D5U/AjRFZa7EFdBIDIRNCXAYINb7cvnV9ebypr5SyL/9xdOvae8w==
=sjoE
-----END PGP SIGNATURE-----

_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list





More information about the Mono-list mailing list