Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL parsing efficiency

SQL parsing efficiency

From: Todd Barry <toddbarry_at_earthlink.net>
Date: Fri, 05 Jan 2001 01:19:38 GMT
Message-ID: <9s7a5t831gl5pgcj5fr2o6vqopsdcn7ppm@4ax.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US