[Mono-list] Npgsql.dll

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Sun May 15 13:17:56 EDT 2005


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



More information about the Mono-list mailing list