Powered By Blogger

Wednesday, January 26, 2011

Using Variable in SQLPLUSW

Let’s see the behavior when using a bind variable. Here is the demonstrated behavior in Oracle Database 10g.

SQL> var state_code varchar2(2)
SQL> exec :state_code := ‘CT’
PL/SQL procedure successfully completed.
SQL> select max(times_purchased) from customers where state_code = :state_code
2 /

No comments:

Post a Comment