Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

what is the difference between variable and Define

user6287828Feb 24 2009 — edited Apr 8 2009
WHAT IS THE DIFFERENCE BETWEEN

these different declarations when it is done using the keyword "variable" and "define"
and both of these are done OUTSIDE "DECLARE"


VARIABLE g_monthly_sal NUMBER
DEFINE p_annual_sal =5000

-- I understand that p_annual_sal will be taken as a CHAR.
-- ALSO IF DEFINE variable acts as macro variable, SO is it necessary to give it some value whenever we define it.
if not what value would be substituted for it?

OR does that mean whenever we want to specify data type for a bind varible we should use VARIABLE and
when we do not want to specify type we use DEFINE?

THANK YOU

Edited by: user6287828 on Feb 24, 2009 11:03 AM

Edited by: user6287828 on Feb 24, 2009 11:04 AM
This post has been answered by Sven W. on Feb 24 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2009
Added on Feb 24 2009
4 comments
1,570 views