4th Example - Substitution Variable (VARCHAR) on PL/SQL



The following will be given another examples of PL / SQL block that has substitution variable. Unlike the examples given in Example 3, this substitution variables that are used to process the input value of a character type (varchar).

DECLARE
        Result VARCHAR2(32);
        Input1 VARCHAR2(16);
        Input2 VARCHAR2(16);
BEGIN
        Input1 := '&in1';
        Input2 := '&in2';
        Result := Input1 || ' dan '|| Input2;
        DBMS_OUTPUT.PUT_LINE(Result);
END;
/

The difference between a number and a varchar of substitution variable is the presence of quotation marks that enclose the varchar substitution variable.

No comments

Powered by Blogger.