How to call a PL/pgSQL function in a PHP script?

How to call a PL/pgSQL function in a PHP script?

am 02.10.2003 10:00:10 von Sebastien Baudry

Hi,
I created functions (using PL/pgSQL) in my PostGreSQL database and now I =
try
to call them in my PHP script but it doesn't succeed.
I can open a connection to the database, run a simple query and get the
result, but I don't know how to do with the functions.
Anybody could help me?

--
S=E9bastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
@.: sebastien.baudry@baudry-engineering.com
mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
http://www.baudry-engineering.com


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Re: How to call a PL/pgSQL function in a PHP script?

am 02.10.2003 10:04:42 von Viorel Dragomir

$query =3D "SELECT myfunc(param1, param2, param3)";


vio-
----- Original Message -----=20
From: "Sebastien Baudry"
To:
Sent: Thursday, October 02, 2003 11:00 AM
Subject: [PHP] How to call a PL/pgSQL function in a PHP script?


> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now =
I
try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
>
> --
> S=E9bastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
>
>
> ---------------------------(end of broadcast)--------------------------=
-
> TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Re: How to call a PL/pgSQL function in a PHP script

am 02.10.2003 10:46:12 von Ahmad Sentri

in php syntax for call a function=20
u can use in sql select a function that already made=20

the way u can write in php syntax with :
$sql_select=3D"SELECT name_of_fanction(var1,var2,...) from name_of_table
===3D
so if u make a function with the name: name_function
so :
$sql_select=3D"SELECT name_function(var1) from table=20
=20


On Thu, 2 Oct 2003, Sebastien Baudry wrote:

> Date: Thu, 2 Oct 2003 10:00:10 +0200
> From: Sebastien Baudry
> Reply-To: sebastien.baudry@baudry-engineering.com
> To: pgsql-php@postgresql.org
> Subject: [PHP] How to call a PL/pgSQL function in a PHP script?
>=20
> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now I =
try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
>=20
> --
> S=E9bastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
>=20
>=20
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>=20


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: How to call a PL/pgSQL function in a PHP script

am 02.10.2003 10:54:56 von Sebastien Baudry

Sorry, I should have precised that my PL/pgSQL function returns a REFCURS=
OR
and it's that cursor that I don't know how to manipulate in my PHP script.

-----Message d'origine-----
De : pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]De la part de Ahmad Sentri
Envoy=E9 : Thursday, October 02, 2003 10:46 AM
=C0 : sebastien.baudry@baudry-engineering.com
Cc : pgsql-php@postgresql.org
Objet : Re: [PHP] How to call a PL/pgSQL function in a PHP script


in php syntax for call a function
u can use in sql select a function that already made

the way u can write in php syntax with :
$sql_select=3D"SELECT name_of_fanction(var1,var2,...) from name_of_table
===3D
so if u make a function with the name: name_function
so :
$sql_select=3D"SELECT name_function(var1) from table



On Thu, 2 Oct 2003, Sebastien Baudry wrote:

> Date: Thu, 2 Oct 2003 10:00:10 +0200
> From: Sebastien Baudry
> Reply-To: sebastien.baudry@baudry-engineering.com
> To: pgsql-php@postgresql.org
> Subject: [PHP] How to call a PL/pgSQL function in a PHP script?
>
> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now =
I
try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
>
> --
> S=E9bastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
>
>
> ---------------------------(end of broadcast)--------------------------=
-
> TIP 8: explain analyze is your friend
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

How to manipulate a cursor returned by a PL/pgSQL function in a PHP script?

am 05.10.2003 09:29:13 von Sebastien Baudry

Hi.
My function returns a cursor and I don't know how to
fetch the cursor in my PHP script.
Anybody could help me?

=====3D
--
S=E9bastien BAUDRY - Database expert & Project manager
BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
@.: sebastien.baudry@baudry-engineering.com
mobile.: +36 30 392 0279 - tel: +36 1 326 0241 - fax: +36 1 326 0241
http://www.baudry-engineering.com

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings