Search Postgresql Archives

Access a Field / Column of a resultset by Number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hy group,

i currently look for a solution to access a resultset in a db-stored function by number. in plpgsql thats not possible.
so i checked out plpython. so far so good, thats working:

CREATE OR REPLACE FUNCTION dokv_dorecnokeywords(sqlstatement VARCHAR) RETURNS VOID AS
$$
 rv = plpy.execute(sqlstatement, 1)
 |||||->"SELECT * FROM art WHERE ak_nr='TEST'"
 s  = 'ak_bez'  |||| fieldname is static here, should be by number
 plpy.notice(s+'='+rv[0][s])
 return
$$ LANGUAGE plpythonu;

now i need a solution to get the number of fields as well as the fieldnames of that resultset and run through all fields (by number or by name). (i need the fieldname too)

--

Daniel Schuchardt
/Softwareentwicklung/

/http://www.prodat-sql.de/

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux