Re: How to hand over array as variable in plpgsql function?
От | Jan Peters |
---|---|
Тема | Re: How to hand over array as variable in plpgsql function? |
Дата | |
Msg-id | 20081028082340.65210@gmx.net обсуждение исходный текст |
Ответ на | Re: How to hand over array as variable in plpgsql function? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: How to hand over array as variable in plpgsql function?
|
Список | pgsql-sql |
Hi Tom (and hello all again), thanks for your reply. > Seems like using EXECUTE is the hardest possible way to do this. Why > don't you just SELECT? > > SELECT id FROM precip_arrays WHERE b = precip_control INTO id_result; How should the code look like to do this? I am using EXECUTE because I don't know how to write the SQL equivalent. How wouldthe SQL code look like if I have these two statements (one returning an array, the other taking this array and comparesit to some other arrays in the db): SELECT precip_control FROM precip_arrays WHERE id = 400; --returns an array SELECT id FROM precip_arrays WHERE [THE RETURNED ARRAY] = precip_scenario;--compares the above array to the arrays in colum"precip_scenario". This obviously does NOT work: SELECT id FROM precip_arrays WHERE (SELECT precip_control FROM precip_arrays WHERE id = 400;) = precip_control; Is something like the above statement possible? Sorry for my ignorance and thanks in advance again Jan -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
В списке pgsql-sql по дате отправления: