Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

v25.4.1 Source code is truncated by compiler when a single slash is embedded in the code

DataProcessing6 days ago

Sampe procedure demonstrates code truncation by compiler when (in this case) a pasted snippet ends with slash.
Compile tis code, THEN open the procedure from the source tree.

create or replace procedure p_deleted_source_code 
authid definer 
is 
/* Demonstrates source code is deleted during compilation 
when the code contains an embedded '/' caused by pasting a snippet. 

Inject a code snippet which ends with a slash '/' on a line by itself. 
Compile. 
Opene the procedure from the Tree source to SEE the truncation, 
*/ 
procedure procedure_name 
is 
begin 
null; 
end; 
/ 
begin 
sys.dbms_output.enable; 
sys.dbms_output.put_line('Every line after the slash / are silently deleted'); 
sys.dbms_output.put_line('Imagine a large package w/ thousand+ lines.'); 
sys.dbms_output.put_line('When the slash appears in the code below the on screen visible lines') 
sys.dbms_output.put_line('in the worksheet, you wont notice the truncation until'); 
sys.dbms_output.put_line('the procedure is opened from the source tree.'); 
exception 
when OTHERS then 
sys.dbms_output.put_line(SQLERRM); 
raise; 
end; 

COMPILER OUTPUT

Procedure P_DELETED_SOURCE_CODE compiled

Errors for PROCEDURE P_DELETED_SOURCE_CODE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
16/0 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin function pragma procedure

Elapsed: 00:00:00.055
sys.dbms_output.put_line('in the worksheet, you wont notice the truncation until');
*
ERROR at line 6:
ORA-06550: line 6, column 5:
PLS-00103: Encountered the symbol "SYS" when expecting one of the following:
:= . ( % ;
The symbol ":=" was substituted for "SYS" to continue.
https://docs.oracle.com/error-help/db/ora-06550/

More Details :
https://docs.oracle.com/error-help/db/ora-06550/
https://docs.oracle.com/error-help/db/pls-00103/
Elapsed: 00:00:00.161

TRUNCATED SOURCE CODE RETRIEVED FROM PROCEDURE TREE

create or replace procedure p_deleted_source_code 
authid definer 
is 
/* Demonstrates source code is deleted during compilation 
when the code contains an embedded '/' caused by pasting a snippet. 

Inject a code snippet which ends with a slash '/' on a line by itself. 
Compile. 
Opene the procedure from the Tree source to SEE the truncation, 
*/ 
procedure procedure_name 
is 
begin 
null; 
end; 
Comments
Post Details
Added 6 days ago
2 comments
63 views