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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL Question

RE: SQL Question

From: Kevin Lange <kgel_at_ppoone.com>
Date: Fri, 13 Jul 2001 08:32:07 -0700
Message-ID: <F001.00349D3A.20010713072119@fatcity.com>

First
of all .....  your query where statement is joining the emp table to itself on deptno.   But, since you are specifying the dept table you have a cartesian join in progress.   Now, instead of the correct return of records you are about to get 100 x 10 or 1000 records. <FONT face=Arial color=#0000ff
size=2> 
That
in mind, the function should be ran once for each record in the result set.

  <FONT face=Tahoma
  size=2>-----Original Message-----From: Steve Haas   [mailto:steven.haas_at_snet.net]Sent: Friday, July 13, 2001 7:21   AMTo: Multiple recipients of list ORACLE-LSubject: SQL   Question
  Good morning,
 

  Env't:  Oracle 8.1.5, HP-UX 11.0 (64
  bit)
 

  Given the following tables:
  emp with 100 rows
  dept with 10 rows
 

  and this SQL:
  select emp.ename,
  initcap(dept.deptname)
  from emp.dept
  where emp.deptno = emp.deptno;
 

  The questions -
  How many times is the initcap(dept.deptname)   function actually "executed"?
  Is it once for each emp row (100 times) or once   for each dept row (10 times) or some other value?
 

  Another scenario -
  Would it be faster to retrieve rows with a   bunch of similar functions (initcap, concatenations of columns and/or   literals, etc) or to have and maintain the data in columns with the data   formatted as such?
 

  TIA gurus...
 

  Steve HaasOpus Consultants,
LLC Received on Fri Jul 13 2001 - 10:32:07 CDT

Original text of this message

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