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 -> Re: 01555 and select statement

Re: 01555 and select statement

From: <xhoster_at_gmail.com>
Date: 11 May 2006 01:27:53 GMT
Message-ID: <20060510214518.397$9D@newsreader.com>


niy38_at_hotmail.com wrote:
> how can that happen?

How can *what* happen? As you don't quote any context, I have no idea what you are talking about.

>
> for rec in (select * from a_big_table where a=1)
> loop
> update a_big_table set a=0;
> commit;
> end loop

What on earth do you think this is going to do?

Since there is no where clause on your update, you are going to update every single row in the table. And you are doing to do it once for every row in the table which originally had a=1.

Why not just do:

update a_big_table set a=0;

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB
Received on Wed May 10 2006 - 20:27:53 CDT

Original text of this message

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