各位大神求救, 查詢陳述句:select * from table(f_fyd_select('test'))報錯ora-01427
但是將變數test代入到select陳述句則只有一條記錄;而且在存盤程序同樣的select into陳述句則不會報錯!求解!
函式如下:
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);
begin
select cp.reffieldname,cp.keycid into v_reffieldname,v_keycid--顯示這里報錯
from cpcdefpropset cp
where cp.propname = '出廠開門方向'
and cp.keycid in --這里in有多個值
(select c.keycid
from cpckeyc c
where (select cy.idpath
from cpckeyc cy
where cy.keycid = (select m.keycid
from cpcitem m
where m.spec = spec
and m.invorgid = 1
and m.stat=8
)) like c.idpath || '%')
;
s := 'select '||v_reffieldname||' from cpcitempropkeyc cp where cp.keycid='||v_keycid||' and cp.itemid in(select itemid from cpcitem m where m.spec= '''||spec||''' and m.invorgid=1 and m.stat=8)';
execute immediate s into v_s;
v:=row_type_fydselect(v_s);
pipe row(v);
return;
end f_fyd_select;
uj5u.com熱心網友回復:
而且奇怪的是 我在我測驗環境是可以正常運行的,然后我升到正式環境,就報這個錯
uj5u.com熱心網友回復:
如果代碼相同,檢查下測驗環境的資料庫版本與正式環境版本是否一致,可能是由于版本不支持導致,但可能性較小,主要原因可能是由于你測驗環境select into 的資料只有一條沒報錯,而正式環境存在多條記錄,select into 只能一條記錄,如果多條確實會報ora-01427錯誤
uj5u.com熱心網友回復:
兩個環境的資料不一樣,就報錯了;
uj5u.com熱心網友回復:
但是 在正式環境,我把select into 的into后面注銷掉,將test 代進去,select出來的只有一條記錄
uj5u.com熱心網友回復:
環境是有點不一樣,但是在正式環境我把select into 那段代碼的into后面注銷掉,將test 代進去,select出來的只有一條記錄
**桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......
我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......
關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......