नीचे पीएल/एसक्यूएल ब्लॉक में एफआईआर और दूसरा "put_line" कथन सफल होगा लेकिन आखिरी व्यक्ति विफल हो जाएगा। क्यूं कर? क्या यह एक बग हो सकता है?अंतिम पीएल/एसक्यूएल कथन dbms_assert.enquote_literal का उपयोग करने में विफल क्यों होता है?
declare
x varchar2(100);
begin
x := 'Test''';
dbms_output.put_line('x is: ' || x || ', enquoted x is: ' || dbms_assert.enquote_literal(replace(x, '''', '''''')));
x := 'Te''st';
dbms_output.put_line('x is: ' || x || ', enquoted x is: ' || dbms_assert.enquote_literal(replace(x, '''', '''''')));
x := '''Test';
dbms_output.put_line('x is: ' || x || ', enquoted x is: ' || dbms_assert.enquote_literal(replace(x, '''', '''''')));
end;
/
त्रुटि है:
Error report:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_ASSERT", line 317
ORA-06512: at "SYS.DBMS_ASSERT", line 381
ORA-06512: at line 11
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause:
*Action:
किसी भी विचार?
ऐसा लगता है कि यह चर के पहले वर्ण के साथ कुछ करने के लिए है। यह पहला फेंक देता है अगर पहला अक्षर '' – SomeJavaGuy
dbms_assert के स्रोत पर नज़र डालें। –
छोटी गाड़ी व्यवहार की तरह लगता है। – sstan