Home > database > Oracle pipeline function - select into single subquery return multiple rows
Oracle pipeline function - select into single subquery return multiple rows
Time:10-02
Everyone a great god for help, the query: select * from table (f_fyd_select (' test ')) error ora - 01427 But the variable test generation into a select statement is a record; And in the storage process also select into statement is not an error! To solve! Function is as follows: The create or replace function f_fyd_select (spec in varchar2)
Return table_type_fydselect Pipelined is V row_type_fydselect; V_reffieldname varchar2 (50); V_keycid varchar2 (50); S varchar2 (500); V_s varchar2 (50); The begin Select the cp reffieldname, cp. Keycid into v_reffieldname, v_keycid -- -- show an error here The from cpcdefpropset cp Where cp. Propname='factory to open the door direction' And cp. Keycid there in more than one value in the (select c.k eycid The from cpckeyc c The where (select cy. Idpath The from cpckeyc cy Where the cy. Keycid=(select m.k eycid The from cpcitem m Where Margaret spellings pec=spec And m.i nvorgid=1 And Margaret spellings tat=8 )) like c.i dpath | | '%') ; S:='select' | | v_reffieldname | | 'from cpcitempropkeyc cp where cp. Keycid=' | | v_keycid | | 'and cp. The itemid in (select itemid from cpcitem m where Margaret spellings pec=' ' '| | spec | |' ' 'and m.i nvorgid=1 and Margaret spellings tat=8)'; The execute immediate s into v_s; V:=row_type_fydselect (v_s); Pipe row (v); return; End f_fyd_select;
CodePudding user response:
And it's strange that I am in my test environment can be normal operation, then I ascend to formal environment, so the fault
CodePudding user response:
If the code is the same, check test environment database version version are consistent with a formal environment, may be due to version does not support, but less likely, the main reason may be due to your test environment select into data only one error, and formal environment exist multiple records, select into a record, only if more than do the ora - 01427 error