Can we use a parameter in a pl sql subprogram other than in where clause

Yes. Once you declare the variables in a PLSQL program, you can use it anywhere in the program. See below an example

DECLARE
   var   VARCHAR2 (100);                                  -- Variable declared
BEGIN
   var := 'My name is jack';                              -- Assigning a string to the varibale

   DBMS_OUTPUT.put_line (var);                            -- Displaying it.


   SELECT 'My name is Mack' INTO var FROM DUAL;

   DBMS_OUTPUT.put_line (var);
END;

I hope this helps.

Browse More Popular Posts

Leave a Comment