Define variable and set value : variable « SQL Plus « Oracle PL / SQL






Define variable and set value

    
SQL>
SQL> SET ECHO ON
SQL>
SQL> VARIABLE ename VARCHAR2(30)
SQL> EXECUTE :ename := 'Mike';

PL/SQL procedure successfully completed.

SQL> SELECT :ename FROM dual;
Mike

1 row selected.

SQL>
SQL>

   
    
    
    
  








Related examples in the same category

1.refcursor varible
2.Save returning value from a function to a variable
3.Define variable and print its value out
4.Define variable and use it in sql statement
5.Bind variables can be declared in your SQL*Plus script,Preface a bind variable with a colon to reference it in a PL/SQL block
6.Bind variables can even be referenced by SQL queries
7.Undefine variable
8.User defined-variable in update set statement