Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORACLE PL/SQL DEFINE a variable 1

Status
Not open for further replies.

kipp4Him

Programmer
Nov 11, 2004
9
0
0
US
I need to define a variable that will be a multipier factor. ie. 0.25 (ie. 25%). How is the best way to define this variable (v_mult)?
Thanks
 
Try:
Code:
var v_mult number;
exec :v_mult:=0.25;
or
Code:
declare v_mult number := 0.25;



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Kipp,

Just to help you become more comfortable with Oracle terminology, the solution that LKBrwnDBA provided was a SQL*Plus solution, not a PL/SQL solution.

PL/SQL stands for "Procedural Language (environment for) SQL". Defining and using a variable in PL/SQL might look like this:
Code:
DECLARE
    v_mult     number := .25;
BEGIN
    (additional procedural manipulation code)
END:
/
...whereas the example that LKBrwnDBA provided is in SQL*Plus, Oracle's vendor-specific environment for filling in the gaps left by standard SQL. The only similarity between SQL*Plus and PL/SQL is that they both have a "P" and an "L" in their names.

Cheers,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
e-mail: dave@dasages.com
@ 16:05 (16Nov04) UTC (aka "GMT" and "Zulu"),
@ 09:05 (16Nov04) Mountain Time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top