Home > database >  Could I insert into a same table but on different worksheets in a sql developer?
Could I insert into a same table but on different worksheets in a sql developer?

Time:12-04

I wrote a PL/SQL program to handle hundred of thousand data to insert into a new table. Could I split the data half and insert into a same table but on different worksheets in a sql developer?

CodePudding user response:

The way I understood it, it looks as if you want to do it in parallel. If that's so, then I'm afraid you can't do it that way - when you run the procedure in the 1st worksheet, you have to wait until it is over to switch to another one.

But, you could

  • run another SQL Developer instance (you know; double-click its icon so that two SQL Developers run at the same time) and start the procedure in both of them
  • schedule the procedure using DBMS_SCHEDULER; the first job would handle the 1st half of your data, the second job would handle the 2nd half
    • I guess I'd pick that option

CodePudding user response:

If you're asking, can I have two worksheets open at the same time, each running stored procedure blocks or programs that are inserting into a table?

Yes.

Step 1: Open Worksheet Connection Open your file or script.

Step 2: Open an Unshared Worksheet From worksheet opened in step 1, click this button: enter image description here

This 'unshared' worksheet is a SQL editor with a DEDICATED connection to your database. That is, it's not 'sharing' the connection with the rest of the program (SQLDev). That's very important because you're about to tie up the connection doing your data loading.

Step 3 (Optional): Create new desktop tab group. Right-click on your 2nd 'unshared' worksheet tab, and select 'New Document Tab Group.' Now you should have two worksheets open, side by side.

Step 4: Open script/program in your unshared worksheet.

Step 5: Click the Execute as Script button in both windows, and wait for the magic to complete.

enter image description here

If this isn't what you're looking for, please update your question with more details.

  • Related