This seems to work
DECLARE
l_status VARCHAR2(128);
l_unwrapped VARCHAR2(4000) := 'create or replace procedure
QSN_APP.wrap_test
is
begin
--test comment goes here
if 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 = 'QSN_APP' 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 = 'QSN_APP' AND object_name = 'WRAP_TEST';
DBMS_OUTPUT.put_line( 'wrapped status:'
|| l_status);
END;
On Fri, Nov 7, 2014 at 7:18 AM, A Sundar <[email protected]> wrote:
> 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
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Oracle PL/SQL" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/Oracle-PLSQL?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Oracle PL/SQL" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
--
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
---
You received this message because you are subscribed to the Google Groups
"Oracle PL/SQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.