Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Unanswered: Execute script (new tables)

    I've created a scrip that will create tables in my database, what I need to do, is to execute this script once or twice a week, compare only one table , IF EXIST in the the database (don't recreate the tables, but only create the different objects found at the end of the script that differs from the database.

    IF THE TABLE DOES NOT EXIST, then create everything (all objects) found in my script (tables ....... indexes).

    How can I compare the first table, and then execute the rest of the script if needed.

    Thank you so much.

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    You could just ...

    select count(*) into v_count
    from all_tables where table_name = 'your_1st_table';

    if v_count > 0
    then
    return;
    end;

    execute the remainder of the script .....

    HTH
    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •