Plsql 游标检索值时出现问题
我试图对以下代码块使用游标,但它没有编译并给出以下错误:Plsql 游标检索值时出现问题,plsql,cursor,Plsql,Cursor,我试图对以下代码块使用游标,但它没有编译并给出以下错误: PL/SQL: SQL Statement ignored PL/SQL: ORA-00947: not enough values 正在提取所有trxn表值,以前是否有人遇到过类似错误?有没有办法解决这个问题,或者我遗漏了什么 I am trying to use a cursor for the following block of code, but it is not compiling and giving error say
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00947: not enough values
正在提取所有trxn表值,以前是否有人遇到过类似错误?有没有办法解决这个问题,或者我遗漏了什么
I am trying to use a cursor for the following block of code, but it is not compiling and giving error saying the following:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00947: not enough values
cursor bulk_select is
with trxn as (
select --+ materialize
-- Wire info
wt.id
,wt.fl
,wt.abc
,wt.xyz
from
wt_temp_t wt
where
<condition>
)
select a
,b
,c
from
(
select
w.aa
,w.bb
,w.cc
trxn w
where
<condition>
)included_trxn
-- Left joins in case the acct is null or external
left outer join table
acct a_cp,
cust c_cp
where
<condition>
type tab_bulk_select is table of bulk_select%rowtype;
cur_bulk_select tab_bulk_select;
BEGIN
EXECUTE IMMEDIATE 'truncate table AML_CAMBRS6_HUB_SPOKE_TMP';
commit;
open bulk_select;
LOOP
fetch bulk_select bulk collect into cur_bulk_select limit 50000;
FORALL i IN 1..cur_bulk_select.COUNT
insert /*+ append */ into AML_CAMBRS6_HUB_SPOKE_TMP (a,b,c)
values cur_bulk_select(i);
commit;
EXIT When bulk_select%NOTFOUND;
END LOOP;
CLOSE bulk_select;
正在提取所有trxn表值,以前是否有人遇到过类似错误?有没有办法解决这个问题,或者我遗漏了什么
I am trying to use a cursor for the following block of code, but it is not compiling and giving error saying the following:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00947: not enough values
cursor bulk_select is
with trxn as (
select --+ materialize
-- Wire info
wt.id
,wt.fl
,wt.abc
,wt.xyz
from
wt_temp_t wt
where
<condition>
)
select a
,b
,c
from
(
select
w.aa
,w.bb
,w.cc
trxn w
where
<condition>
)included_trxn
-- Left joins in case the acct is null or external
left outer join table
acct a_cp,
cust c_cp
where
<condition>
type tab_bulk_select is table of bulk_select%rowtype;
cur_bulk_select tab_bulk_select;
BEGIN
EXECUTE IMMEDIATE 'truncate table AML_CAMBRS6_HUB_SPOKE_TMP';
commit;
open bulk_select;
LOOP
fetch bulk_select bulk collect into cur_bulk_select limit 50000;
FORALL i IN 1..cur_bulk_select.COUNT
insert /*+ append */ into AML_CAMBRS6_HUB_SPOKE_TMP (a,b,c)
values cur_bulk_select(i);
commit;
EXIT When bulk_select%NOTFOUND;
END LOOP;
CLOSE bulk_select;
这是因为在trxn中,您只获取两个值wt.fo_trxn_seq_id,wt.pass_thru_fl
但在select子句中,选择w.aa、w.bb、w.cc trxn w,其中使用aa、bb、cc,并且in语句中也缺少。在实际代码中,从光标中选择的列与插入到中指定的列之间可能不匹配。我仔细检查了列数,我认为是相同的,如果您发布编译的代码,这将非常有帮助。这是缺少一些部分,有两个结束语句。。。对于我们来说,很难判断出问题出在哪里,你的问题是否是由于缺少零件造成的。因此,请-重写它,使它尽可能简单斯科特的EMP和部门表将是罚款,编辑您的消息,并帮助我们帮助您。有几个人试图帮忙,你说你已经检查过了。我们看到的代码不完整时并不明显。我根据您的要求发布了编辑后的代码。代码是完整的,只是缺少了原始代码中的几列。trxn表中的值是正确的,这只是示例。我检查了select和insert是否有相同数量的记录