Re: combining several SQL statements to run sequentially??????

From: Ryan Gaffuri <rgaffuri_at_cox.net>
Date: 26 Dec 2003 06:36:01 -0800
Message-ID: <1efdad5b.0312260636.129a2004_at_posting.google.com>


gelewyc_at_nyct.com (george lewycky) wrote in message news:<68aecc05.0312231207.4e11e1c_at_posting.google.com>...
> Hi everyone
>
> How can I have 2 or more SQL statements run sequentially.
>
> This is needed to synchronize a reference table which is later
> used in a PL/SQL program that I wrote also.
>
> I'm trying to automate the processes.
>
> Below are the SQL statements that I would like to run together
> using SQL*Plus, TOAD, etc ??
>
> Any ideas ??
>
> Thanks & Happy Holidays
>
> George
> -----------------------
>
>
> select count(*) from george_xref;
> /
> INSERT INTO GEORGE_XREF GEO
> select
> TRX_NUMBER,
> TRX_DATE,
> CUSTOMER_TRX_ID,
> BILL_TO_CUSTOMER_NUMBER,
> substr(bill_to_customer_name,1,25) CUSTOMER_NAME,
> PRINTING_ORIGINAL_DATE,
> PRINTING_LAST_PRINTED,
> PRINTING_OPTION,
> PRINTING_PENDING,
> PRINTING_COUNT
> FROM AR_INVOICE_HEADER_V
> WHERE TRX_NUMBER IN
> (SELECT TRX_NUMBER FROM AR_INVOICE_HEADER_V MINUS
> SELECT TRX_NUMBER FROM GEORGE_XREF);
> /
> delete from george_xref
> where bill_to_customer_number = 1404
> /
> commit;

you mis-understand Oracle's architecture. As long as you do not commit until after both the insert and delete complete, you are fine. Data is only visible to other users after a commit is complete. This is seen as one transaction.

go to otn.oracle.com and read the first 10 chapters of the concepts document. Its explained their.

now if you REALLY want them to run in parallel, submit them as jobs with the dbms_job package. However, one will start running before the other. Received on Fri Dec 26 2003 - 15:36:01 CET

Original text of this message