[Gambas-user] db retrieve

Benoît Minisini gambas at ...1...
Thu Nov 26 23:11:10 CET 2009


> Hi,
> 
> How can I retrieve a "field" returned by a stored procedure?
> 
> SP:
> CREATE OR REPLACE FUNCTION common.testbytea_sel(Pid OID) RETURNS TEXT AS $$
> DECLARE
>         MyPic           BYTEA;
>         MyString        TEXT;
> BEGIN
>         SELECT pic INTO MyPic FROM common.testbytea WHERE id = Pid;
>         MyString = encode(MyPic, 'base64');
>         RETURN MyString;
> END;
> $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER;
> 
> GB:
> sqlQry = "SELECT * FROM common.testbytea_sel(" & RowNb & ");"
> resQry = $DBConn.Exec(sqlQry)
> 
> PB: what resQry!??? shall I ask for?
> 

You can access result fields by index too:

resQry[0], reqQry[1], ...

-- 
Benoît Minisini




More information about the User mailing list