Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL parsing efficiency
Is there any benefit (parsing, optimization, etc.) in writing PL/SQL conforming to modes 2 and 3 shown below?
Basically, is there a performance benefit to using variables or constants instead of hard-coded values?
1.
cursor csrTest is
select company_id
from companies
where type_code = 10; -- hard-coded value
2.
nTypeCode companies.type_code%type := 10;
cursor csrTest is
select company_id
from companies
where type_code = nTypeCode; -- variable value
3.
cnTypeCode constant companies.type_code%type := 10;
cursor csrTest is
select company_id
from companies
where type_code = cnTypeCode; -- constant value
Thanks,
Todd
Received on Thu Jan 04 2001 - 19:19:38 CST