#1
  1. No Profile Picture
    Demonic Swordsman DGQB
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2003
    Posts
    1,043
    Rep Power
    83

    Executing multiple INSERT statements in TOAD


    I want to execute 10 INSERT statements in the TOAD editor. I have tried several batch-execution approaches--none worked--including:

    -Pressing F5, aka "execute as script". This simply hangs and does nothing, and I have to cancel the operation after a few minutes of seeing no results.

    -Pressing F9, aka "execute statement", on one line with one statement. This only executes that one statement.

    -Pressing F9 on one line with multiple statements separated by semicolon ";" this produces an error saying there's an invalid character after the first ";"

    -Highlighting all 10 lines and pressing F9 or Shift+F9... produces same error as above.

    So, I ask yee, is there a way to execute 10 lines of INSERT statements with the click of ONE botton?

    Thank you.
  2. #2
  3. No Profile Picture
    Demonic Swordsman DGQB
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2003
    Posts
    1,043
    Rep Power
    83
    Alas, I figured out one way to accomplish the task at hand: wrap the statements in a PL/SQL block. Still would like to know if the editor itself has a way to execute multiple CRUD statements though.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Posts
    10
    Rep Power
    0
    can any one please give me a sample code for executing multiple insert statements using toad.

    I learnt that we could do by keeping all the insertments into a file and run it.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Nov 2001
    Location
    North West UK
    Posts
    1,147
    Rep Power
    396
    Depends on the database of course. TOAD for Oracle?:
    Try
    oracle8 Code:
     
    INSERT ALL
       INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'IBM')
       INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'Microsoft')
       INTO suppliers (supplier_id, supplier_name) VALUES (3000, 'Google')
    SELECT * FROM dual;
    9 out of 10 PHP problems can be resolved by setting
    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors'1); 
    php -l <filename> will identify 9 out of the remaining 10 problems
    Remember, the command line is your friend

    Development Projects:
    PHPExcel
    PHPPowerPoint

IMN logo majestic logo threadwatch logo seochat tools logo