pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PL/PGSQL
3+ messages / 2 participants
[nested] [flat]

* PL/PGSQL
@ 2003-02-27 18:29 Markus Post <mpost@purematic.com>
  2003-02-28 06:00 ` Re: PL/PGSQL Mauri Sahlberg <Mauri.Sahlberg@pretax.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Markus Post @ 2003-02-27 18:29 UTC (permalink / raw)
  To: pgsql-php


    Hello together!

I have a little question, because I found the answer nowhere in the Net.
How I can call a stored pl/pgsql-function from my SQL-Client.
In an SQL-statement I call it like "select MYFUNCTION(blah, blah) from
...".
I need it without the SQL-Statement.

In Oracle I would be:
BEGIN
   MYFUNCTION(...);
END;

How can I do this with PG? 

Greets,
   Markus





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PL/PGSQL
  2003-02-27 18:29 PL/PGSQL Markus Post <mpost@purematic.com>
@ 2003-02-28 06:00 ` Mauri Sahlberg <Mauri.Sahlberg@pretax.net>
  2003-02-28 16:24   ` Re: PL/PGSQL Markus Post <mpost@purematic.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mauri Sahlberg @ 2003-02-28 06:00 UTC (permalink / raw)
  To: Markus Post <mpost@purematic.com>; +Cc: pgsql-php

Hello,

On to, 2003-02-27 at 20:29, Markus Post wrote:
>     Hello together!
> 
> I have a little question, because I found the answer nowhere in the Net.
> How I can call a stored pl/pgsql-function from my SQL-Client.
> In an SQL-statement I call it like "select MYFUNCTION(blah, blah) from
> ...".
> I need it without the SQL-Statement.
> 
> In Oracle I would be:
> BEGIN
>    MYFUNCTION(...);
> END;
> 

You're probably looking from the wrong place. At least the answer can be
found from
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=plpgsql-statements.html

On that page, heading 19.5.3 states that you can do:

	PERFORM MYFUNCTION(...); 

if you wish to discard the return value. 
Or if your function returns something then you do:

	myresult:=MYFUNCTION(...);

Regards,
-- 
Development Manager, B.SC    | This message is probably digitally 
Pretax Systems Oy            | signed as well. Contact me to obtain my
Pääskylänrinne 8,            | public key.
FIN-00500-Helsinki, Finland  | This signature has performed an illegal
+358 9 6155 3252             | operation and will be terminated...

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PL/PGSQL
  2003-02-27 18:29 PL/PGSQL Markus Post <mpost@purematic.com>
  2003-02-28 06:00 ` Re: PL/PGSQL Mauri Sahlberg <Mauri.Sahlberg@pretax.net>
@ 2003-02-28 16:24   ` Markus Post <mpost@purematic.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Markus Post @ 2003-02-28 16:24 UTC (permalink / raw)
  To: pgsql-php

Hello Mauri!

Thank you for your comment, but it doesn´t work in this way. Meantime I
found the solution.
You can avoid this problem through calling the function direct with:

SELECT myfunction(blah, blah)





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-28 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 18:29 PL/PGSQL Markus Post <mpost@purematic.com>
2003-02-28 06:00 ` Mauri Sahlberg <Mauri.Sahlberg@pretax.net>
2003-02-28 16:24   ` Markus Post <mpost@purematic.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox