什么情况下,会捕捉不到绑定变量的值
1个回答
推荐于2016-05-17 · 知道合伙人互联网行家
关注
展开全部
SQL> variable a number;
SQL> exec :a:=5;
PL/SQL procedure successfully completed.
SQL> alter session set events '1 trace name errorstack level 2, forever';
Session altered.
SQL> insert into dept values(:a,'绑定变量');
insert into dept values(:a,'绑定变量')
*
ERROR at line 1:
ORA-00001: unique constraint (GQSJ.AAA) violated
----- Bind Info (kkscoacd) -----
Bind#0
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=00 csi=00 siz=24 off=0
kxsbbbfp=2b6bb94f3288 bln=22 avl=02 flg=05
value=5
Frames pfr 0x2b6bb94f39f8 siz=3240 efr 0x2b6bb94f3928 siz=3176
Cursor frame dump
enxt: 3.0x00000480 enxt: 2.0x00000020 enxt: 1.0x000007c8
pnxt: 1.0x00000040
kxscphp=0x2b6bb94db7b0 siz=984 inu=392 nps=344
kxscbhp=0x2b6bb94e0068 siz=984 inu=168 nps=48
Starting SQL statement dump
SQL Information
user_id=34 user_name=GQSJ module=SQL*Plus action=
sql_id=1nhpnj080g3xw plan_hash_value=0 problem_type=0
----- Current SQL Statement for this session (sql_id=1nhpnj080g3xw) -----
insert into dept values(:a,'绑定变量')
Flying higher.
SQL> exec :a:=5;
PL/SQL procedure successfully completed.
SQL> alter session set events '1 trace name errorstack level 2, forever';
Session altered.
SQL> insert into dept values(:a,'绑定变量');
insert into dept values(:a,'绑定变量')
*
ERROR at line 1:
ORA-00001: unique constraint (GQSJ.AAA) violated
----- Bind Info (kkscoacd) -----
Bind#0
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=00 csi=00 siz=24 off=0
kxsbbbfp=2b6bb94f3288 bln=22 avl=02 flg=05
value=5
Frames pfr 0x2b6bb94f39f8 siz=3240 efr 0x2b6bb94f3928 siz=3176
Cursor frame dump
enxt: 3.0x00000480 enxt: 2.0x00000020 enxt: 1.0x000007c8
pnxt: 1.0x00000040
kxscphp=0x2b6bb94db7b0 siz=984 inu=392 nps=344
kxscbhp=0x2b6bb94e0068 siz=984 inu=168 nps=48
Starting SQL statement dump
SQL Information
user_id=34 user_name=GQSJ module=SQL*Plus action=
sql_id=1nhpnj080g3xw plan_hash_value=0 problem_type=0
----- Current SQL Statement for this session (sql_id=1nhpnj080g3xw) -----
insert into dept values(:a,'绑定变量')
Flying higher.
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询