Hi,
Wrapped source with comment line gives compalation error ORA-24344 and staus became invalid. I would like to know whether we can't use comment like in the wrapped code or any other way to use comment line in wrapped code.
Testcase:
***********
DECLARE
l_status VARCHAR2(128);
l_unwrapped VARCHAR2(4000) := 'create or replace procedure SYSTEM.wrap_test
is
begin
if/* test */true then
null;
end if;
end wrap_test;';
l_wrapped VARCHAR2(4000);
BEGIN
l_wrapped := dbms_ddl.wrap(l_unwrapped);
EXECUTE immediate l_unwrapped;
SELECT status
INTO l_status
FROM dba_objects
WHERE owner = 'SYSTEM'
AND object_name = 'WRAP_TEST';
dbms_output.put_line('unwrapped status:'||l_status);
BEGIN
EXECUTE immediate l_wrapped;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('sql error message'||sqlerrm);
END;
SELECT status
INTO l_status
FROM dba_objects
WHERE owner = 'SYSTEM'
AND object_name = 'WRAP_TEST';
DBMS_OUTPUT.PUT_LINE('wrapped status:'||L_STATUS);
END;
Output:
*********
Created!
unwrapped status:VALID
Created!
sql error message ORA-24344: success with compilation error
wrapped status:INVALID
select text from USER_ERRORS where NAME = 'WRAP_TEST';
"PLS-00103: Encountered the symbol "THEN" when expecting one of the following:
:= . ( @ % ;
"
Regards,
Sundar