Reputation: 703
DEFINE p_annual_sal = 60000
DECLARE
v_sal NUMBER(9,2) := &p_annual_sal;
BEGIN
v_sal := v_sal/12;
END;
/
What is the the use of the "Define" word?
Upvotes: 6
Views: 8043
Reputation: 3499
DECLARE
starts section of pl/sql block (DECLARE... BEGIN... END;
) where you declare variables to be used inside BEGIN... END;
part. (executed on Oracle server)
DEFINE
is a way to substitute values (in SQL*Plus, SQL dev,...) - substitution done by the client side tool (sqlplus) before sending to server.
Upvotes: 7