Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:41:41+00:00 2026-06-05T08:41:41+00:00

I have Oracle procedure which does the same work as following: create or replace

  • 0

I have Oracle procedure which does the same work as following:

create or replace
PROCEDURE My_TEST_PROCEDURE
(
   cur out sys_refcursor
)
AS
BEGIN
  open cur for
   SELECT * FROM MYTABLE1
   WHERE MYTABLE1.SOMEROWNAME NOT IN 
        (SELECT SOMEROWNAME FROM MYTABLE2);
END My_TEST_PROCEDURE;

But there are a lot of data in this two tables, approximately 300000 rows in each. So it takes a plenty of time to finish. What can I do to decrease that amount of time. I have tried declaring a sys_refcursor and reading data into this cursor as following:

create or replace
PROCEDURE My_TEST_PROCEDURE
(
   cur out sys_refcursor
)
IS
DECLARE EXISTING_ITEMS SYS_REFCURSOR;
BEGIN
  OPEN EXISTING_ITEMS FOR
    SELECT SOMEROWNAME FROM MYTABLE2;
  open cur for
   SELECT * FROM MYTABLE1
   WHERE MYTABLE1.SOMEROWNAME NOT IN 
        EXISTING_ITEMS;
END My_TEST_PROCEDURE;

But this time ORA-00932 error occurs. What can I do?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:41:43+00:00Added an answer on June 5, 2026 at 8:41 am

    Use a query with join like below:

    SELECT MYTABLE1.* 
    FROM   MYTABLE1 
           left join MYTABLE2 
                  ON MYTABLE1.SOMEROWNAME = MYTABLE2.SOMEROWNAME 
    WHERE  MYTABLE2.SOMEROWNAME IS NULL 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Oracle procedure: CREATE OR REPLACE PROCEDURE xmas IS CURSOR curUser IS
I have this stored procedure for Oracle: create or replace procedure bns_saa_message_get() <--- PROBLEM
I am using Oracle 10g and I have the following stored procedure: CREATE OR
I have the following code in an oracle procedure, which returns a cursor (
I have an oracle procedure which creates a text file using the UTL_FILE.FOPEN function.
I have a Oracle procedure to which I have to pass a datetime value
I have the following iBatis mapping for an Oracle Stored Procedure that returns a
I am inside oracle procedure I have a complex query with join which gives
I have a oracle procedure which should return a concatenated string of all the
I have to write an Oracle procedure which should invoke an Oracle function returning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.