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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Does this work or do I have to use dynamic sql?

Re: Does this work or do I have to use dynamic sql?

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Wed, 30 Jul 2003 16:38:35 -0700
Message-ID: <3F2856FB.CD4A53F5@exxesolutions.com>


Zman wrote:

> <snipped>
>
> Never done it that way. I think this will work but it is obviously untested.
> No cursor loop needed.
> In your example, perhaps it was not working because the commit was outside the loop.
>
> UPDATE ud set
> (name, vorname, bereich, stammnr, tel_int, kostenstl, unique_id) =
> (select SUBSTR(metaupdate_rec.sLastName,1,25) ,
> SUBSTR(metaupdate_rec.sFirstName,1,25) ,
> metaupdate_rec.sDepartment,
> metaupdate_rec.sPersonalNumber,
> SUBSTR(metaupdate_rec.sOfficePhoneNumber,1,15) ,
> SUBSTR(metaupdate_rec.sKST,1,10),
> metaupdate_rec.sobjUniqueKey
> from metaupdate_rec WHERE ud.Username = metaupdate_rec.sNetzwerklogin)

Good gosh man ... "not working because the commit is outside the loop"?

This is Oracle not SQL Server. The commit should NEVER be INSIDE the loop.

If you've been putting them inside a loop you have been slaughtering performance and scalability and opening yourself up for the dread ORA-01555. Stop it! Stop it now! ;-)

And it is definitely not the cause of the problem.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Jul 30 2003 - 18:38:35 CDT

Original text of this message

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