oracle - ORA-00934: group function is not allowed here -
i have written stored procedure expecting add 2 count values collection, below code:
procedure generate(code_in in varchar2 , value_1 out number , value_2 out number) begin select count(case when type = 'a' 1 else null end) value_1 , count(case when type in ('b','d') 1 else null end) value_2 table code = code_in; end generate;
but when running code following error:
ora-00934: group function not allowed here
if remove second count
stored procedure compiles fine, when add second line error.
can explain why happening? please note experience oracle minimal.
into
single clause may receive multiple variables, not clause append each select item:
procedure generate(code_in in varchar2 , value_1 out number , value_2 out number) begin select count(case when type = 'a' 1 else null end), count(case when type in ('b','d') 1 else null end) value_1, value_2 -- clause both variables table code = code_in; end generate;
Comments
Post a Comment