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.
No comments:
Post a Comment
Please do not enter any spam link in the comment box.