0

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?

1
  • Hello, can you provide us with what you're currently working with as well as your desired and current output.
    – Tilen
    Commented Dec 3, 2021 at 6:16

2 Answers 2

0

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
0

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.

2
  • Thank you so much This is what I was asking But I try another way to deal with my problem which was to use the functionality in excel and make thousand hundred of insert sql statement Commented Dec 31, 2021 at 7:57
  • pl/sql doing the inserts will be scale factors faster than doing row-by-row inserts via Excel. If you come across this project again, remember that and this 'trick.' Commented Dec 31, 2021 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.