On Saturday, November 8, 2014 5:26:16 AM UTC-7, sundar wrote:
>
> Hi,
>
> Thanks for your input on this.
>
> This seems like issue with below statement.
>
> if/* test */true then   --- no space between if and /
>
> If i replace this with  if /* test */true then it is working fine with 
> wrapped code. But unwrapped code working in both the case.
>
> What is your view about this case.
>
> Regards,
> Sundar
>
>
>
>
> On Sat, Nov 8, 2014 at 12:25 AM, Michael Moore <michae...@gmail.com 
> <javascript:>> wrote:
>
>> 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 <asun...@gmail.com <javascript:>
>> > 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 oracle...@googlegroups.com 
>>> <javascript:>
>>> To unsubscribe from this group, send email to
>>> oracle-plsql...@googlegroups.com <javascript:>
>>> 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 oracle-plsql...@googlegroups.com <javascript:>.
>>> 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 oracle...@googlegroups.com 
>> <javascript:>
>> To unsubscribe from this group, send email to
>> oracle-plsql...@googlegroups.com <javascript:>
>> 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 oracle-plsql...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
It appears that the wrap utility uses a slightly different parsing 
mechanism than SQL*Plus so the spaces are required if wrap is to work 
correctly.  It isn't a bug and it isn't a problem.


David Fitzjarrell 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
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 oracle-plsql+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to