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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • george lewycky

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

    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_CUSTOME R_NUMBER,
    substr(bill_to_ customer_name,1 ,25) CUSTOMER_NAME,
    PRINTING_ORIGIN AL_DATE,
    PRINTING_LAST_P RINTED,
    PRINTING_OPTION ,
    PRINTING_PENDIN G,
    PRINTING_COUNT
    FROM AR_INVOICE_HEAD ER_V
    WHERE TRX_NUMBER IN
    (SELECT TRX_NUMBER FROM AR_INVOICE_HEAD ER_V MINUS
    SELECT TRX_NUMBER FROM GEORGE_XREF);
    /
    delete from george_xref
    where bill_to_custome r_number = 1404
    /
    commit;
  • Frank van Bortel

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

    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_CUSTOME R_NUMBER,
    substr(bill_to_ customer_name,1 ,25) CUSTOMER_NAME,
    PRINTING_ORIGIN AL_DATE,
    PRINTING_LAST_P RINTED,
    PRINTING_OPTION ,
    PRINTING_PENDIN G,
    PRINTING_COUNT
    FROM AR_INVOICE_HEAD ER_V
    WHERE TRX_NUMBER IN
    (SELECT TRX_NUMBER FROM AR_INVOICE_HEAD ER_V MINUS
    SELECT TRX_NUMBER FROM GEORGE_XREF);
    /
    delete from george_xref
    where bill_to_custome r_number = 1404
    /
    commit;
    Seems pretty sequential to me - what's parallel?
    --
    Merry Christmas and a Happy New Year,
    Frank van Bortel

    Comment

    • Ryan Gaffuri

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

      gelewyc@nyct.co m (george lewycky) wrote in message news:<68aecc05. 0312231207.4e11 e1c@posting.goo gle.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_CUSTOME R_NUMBER,
      substr(bill_to_ customer_name,1 ,25) CUSTOMER_NAME,
      PRINTING_ORIGIN AL_DATE,
      PRINTING_LAST_P RINTED,
      PRINTING_OPTION ,
      PRINTING_PENDIN G,
      PRINTING_COUNT
      FROM AR_INVOICE_HEAD ER_V
      WHERE TRX_NUMBER IN
      (SELECT TRX_NUMBER FROM AR_INVOICE_HEAD ER_V MINUS
      SELECT TRX_NUMBER FROM GEORGE_XREF);
      /
      delete from george_xref
      where bill_to_custome r_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.

      Comment

      Working...