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

CodePudding user response:

Two environmental data, is an error;

CodePudding user response:

refer to the second floor sxq129601 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

But in formal environment, I put the select into into the back off, and went in the test generation, select only one record

CodePudding user response:

reference wmxcn2000 reply: 3/f
two environmental data, is an error;

Environment is a little different, but in the formal environment I select into the code into the back off, and went in the test generation, select only one record

CodePudding user response:

reference 4 floor lpz1073127590 response:
Quote: refer to the second floor sxq129601 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 only a select into data error, and formal environment exist multiple records, select into a record, only if more than do the ora - 01427 error

But in formal environment, I put the select into into the back off, and went in the test generation, the select of only one record


You try SQL statements in the formal environment where rownum=1 limit a record at the see report is not an error, if not an error, is that you find out multiple records

CodePudding user response:

refer to 6th floor sxq129601 response:
Quote: refer to 4th floor lpz1073127590 response:

Quote: refer to the second floor sxq129601 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 only a select into data error, and formal environment exist multiple records, select into a record, only if more than do the ora - 01427 error

But in formal environment, I put the select into into the back off, and went in the test generation, the select of only one record


You try SQL statements in the formal environment where rownum=1 limit a record at the see report is not an error, if not an error, is that you find out multiple records in

Tried, the same mistake

CodePudding user response:

refer to 7th floor lpz1073127590 response:
Quote: refer to the sixth floor sxq129601 response:

Quote: refer to 4th floor lpz1073127590 response:

Quote: refer to the second floor sxq129601 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 only a select into data error, and formal environment exist multiple records, select into a record, only if more than do the ora - 01427 error

But in formal environment, I put the select into into the back off, and went in the test generation, the select of only one record


You try SQL statements in the formal environment where rownum=1 limit a record at the see report is not an error, if not an error, is that you find out multiple records in

Tried, the same wrong


It is strange, check whether two library version difference is bigger, may you a formal library version is too low, do not support pipelining function? It will have to rewrite the SQL don't use that
  • Related