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!

Reproducible. The first DBMS_OUTPUT.PUT_LINE has leading spaces trimmed.

DataProcessingSep 13 2025
declare 
/* ISSUE: SCRIPT_OUTPUT panel shows Trimmed leading spaces on the FIRST dbms_output line only! 

 DEMO: Run script w/ commented lines. Observe the printed result is trimmed leading spaces. 
  The printed value should have leading spaces because it is smaller than the mask length. 
ILLUSTRATE: Remove either --commented statement and observe the difference. Output IS NOT trimmed.
  The printed value HAS leading spaces (as it should). 
*/ 
  mask$ varchar2(128) := '999,999,999'; 
  pad# constant integer := 25; 
  scale$ constant varchar2(25) := '1234567890123456789012345'; 
  amount integer; 
begin <<main>> 
  amount := 0;  -- or 6517238;
  sys.dbms_output.enable; 
  --sys.dbms_output.put_line(chr(10)); 
  --sys.dbms_output.put_line(scale$); 
  sys.dbms_output.put_line(LPAD(TO_CHAR(amount,mask$), pad#,' ')); 
  sys.dbms_output.put_line(LPAD(TO_CHAR(amount,mask$), pad#,'*')); 
end; 
This post has been answered by DataProcessing on Sep 13 2025
Jump to Answer
Comments
Post Details
Added on Sep 13 2025
2 comments
38 views