-->

15 August 2020

PL/SQL Subtitution Variable

  Asp.Net CS By Example       15 August 2020

  PL/SQL Subtitution Variable  

     SQL*Plus allows a PL/SQL block to receive input information with the help of substitution variables. Substitution variables cannot be used to output values, because no memory is allocated for them. SQL*Plus substitutes a variable before the PL/SQL block is sent to the database. Substitution variables usually are prefixed by the ampersand (&) or double ampersand (&&) characters.

 Declare
     l_num    number:= & num; 
     l_result number; 
 BEGIN
     l_result := POWER(l_num, 2);

     DBMS_OUTPUT.PUT_LINE ('The squre of : ' ||l_num||' is: '||l_result);   
 end;     

    Note: Here "&num" is the substitution variable .
     To use subtitution variable in Sql Nevigator
     Use follow below steps:
     1) Scan define/ subtitutions must be On
     2) Turn the sarver outpot on.
logoblog

Thanks for reading PL/SQL Subtitution Variable

Previous
« Prev Post

No comments:

Post a Comment

Please do not enter any spam link in the comment box.