By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,504 Members | 1,903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,504 IT Pros & Developers. It's quick & easy.

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

P: n/a
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;
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
george lewycky wrote:
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;


Seems pretty sequential to me - what's parallel?
--
Merry Christmas and a Happy New Year,
Frank van Bortel

Jul 19 '05 #2

P: n/a
ge*****@nyct.com (george lewycky) wrote in message news:<68*************************@posting.google.c om>...
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.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.