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: Select and insert in same transaction

Re: Select and insert in same transaction

From: Steve M <steve.mcdaniels_at_vuinteractive.com>
Date: Tue, 19 Mar 2002 10:55:12 -0800
Message-ID: <a781gp$31v$1@spiney.sierra.com>


update my_table
set colDate = sysdate
where colDate is null;

(it appears from your example the colA, colB, colC are irrellevant)

also, consider:

create table my_new_table
select colA, colB, colC, sysdate colDate from my_old_table
where colDate is null;

"Larry Marshall" <LarryM_at_marshap.com> wrote in message news:dslc9u0lv2vlls05fortaglmd4a1i321o8_at_4ax.com...
> I am new to SQL. I want to do a query:
> select colA, colB, colC from table
> where colDate is null
>
> After this, I want to set colDate of each record selected in the above
> query to the current date.
>
> How can I assure that I update all the selected records from the first
> query and no more. I am worried that between the two DML statements
> further records might have been added having colDate = NULL.
>
> TIA - Larry
Received on Tue Mar 19 2002 - 12:55:12 CST

Original text of this message

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