vendredi 27 février 2015

How to put the results of a query into a variable?


I have written a Postgres anonymous block. In which I have written join query on multiple tables like:



select a.portal.*, a.p_fb_config.*, a.p_gplus_config
from a.portal
left outer join a.p_fb_config on a.portal.pid = a.p_fb_config.pid
left outer join a.p_gplus_config on a.portal.pid = a.p_gplus_config.pid;


Now I want to catch this value in variable. So how should I declare that variable?


I need something like:



portal_row a.portal%ROWTYPE;//for 3 tables




Aucun commentaire:

Enregistrer un commentaire