Reputation: 27
For the parameter wellid
, I have to pass 'well1','well2','well3'....
create or replace procedure aoi(
wellid text,
INOUT cumoil numeric,INOUT cumgas numeric)
AS $BODY$
begin
SELECT SUM(cast(a.oil as decimal)) as cumoil,
SUM(cast(a.gas as decimal)) as cumgas
into cumoil,cumgas
from XYZ a where "Well ID" in (wellid)
GROUP BY a."Well ID";
commit;
end;$BODY$;
Upvotes: 0
Views: 158
Reputation: 246083
Use an array:
for the parameter, use data type text[]
pass the array as '{value1,value2,value3}'
compare with "Well ID" = ANY (wellid)
Upvotes: 2