Thursday, May 14, 2009

Variables in Sql Developer

Ever find yourself having to remember how to to use variables in Oracle's handy tool Sql Developer? Me, I can never remember. That's why this post is here.

There are two types of variables in the Oracle world: substitution variables and bind variables. It's important to remember that you can't use substitution variables in Sql Developer, but you can use bind variables. The syntax for bind variables is the following:

variable custno number
exec : custno := 99
Select * from customer where customerId = : custno;

Now I'll remember.


No comments: