Skip to Main Content

SQL & PL/SQL

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!

Writing prompt in sql developer

Uday_NMay 21 2020 — edited May 21 2020

Hi All,

           I am writing prompt so that i can pass a variable during run time . I am executing it in sql developer code and getting the following message .Is it happens only in Sql developer. My code atlast will be executed in sql plus . Will the same error i will get in sql plus . Please kind your advice;

Code :

set serveroutput on

accept vstring prompt "Please enter your name: ";

declare

   v_line varchar2(40);

begin

   v_line := 'Hello '||'&vstring';

   dbms_output.put_line(v_line);

end;

/

Output :

old:declare

   v_line varchar2(40);

begin

   v_line := 'Hello '||'&vstring';

   dbms_output.put_line(v_line);

end;

new:declare

   v_line varchar2(40);

begin

   v_line := 'Hello '||'Uday';

   dbms_output.put_line(v_line);

end;

PL/SQL procedure successfully completed.

Hello Uday

PL/SQL procedure successfully completed.

Hello Uday

Comments
Post Details
Added on May 21 2020
5 comments
599 views