Re: PHP PDO getting data from pgSQL stored function - Mailing list pgsql-php

From Jonah H. Harris
Subject Re: PHP PDO getting data from pgSQL stored function
Date
Msg-id CADUqk8VG3sKPWAqczKeE1xk_zcho8_+BajrYu16tDrAMXzV=kQ@mail.gmail.com
Whole thread Raw
In response to PHP PDO getting data from pgSQL stored function  (Michael Schmidt <css.liquid@gmail.com>)
Responses Re: PHP PDO getting data from pgSQL stored function
List pgsql-php
On Sat, Nov 2, 2013 at 11:54 AM, Michael Schmidt <css.liquid@gmail.com> wrote:
i need to do a ugly select which i dont want to place in my php code.
I use PDO all the time.

All database access from our application is functionalized using either PL/pgSQL or SQL functions.
 
I want to return a structure which is the same as a table i have created.

CREATE FUNCTION blah (IN param 1, ..., IN param n, OUT param 1, ... OUT param n) RETURNS SETOF RECORD

Now my question, how can i return that and access it with PHP PDO?
Should I use a cursor or shoul I use the return of the function (if it is possible)?

Just do a SELECT * FROM blah(...); as a normal PDO query.

--
Jonah H. Harris
Blog: http://www.oracle-internals.com/

pgsql-php by date:

Previous
From: Michael Schmidt
Date:
Subject: PHP PDO getting data from pgSQL stored function
Next
From: reiner peterke
Date:
Subject: Re: PHP PDO getting data from pgSQL stored function