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 6172319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:22:20+00:00 2026-05-23T23:22:20+00:00

In .NET, Is it possible to run a nested query from two separate Oracle

  • 0

In .NET, Is it possible to run a nested query from two separate Oracle databases?

E.g.

“SELECT my_value,
FROM table_in_database_1
WHERE my_value IN ( SELECT my_value
FROM table_in_database_2 )”

If so, how would I go about doing this?

Ultimately, this is an effort to overcome an “ORA-01795” error from using an “in” statement with over 1000 items in the conditional list, without having to break the query out into multiple “OR value IN” lists.

  • 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-05-23T23:22:21+00:00Added an answer on May 23, 2026 at 11:22 pm

    You might be able to get away with simply building a database link and joining over that link, but that can have performance issues. Something like this:

    Build a link to database 2 on database 1.

    CREATE DATABASE LINK db2 CONNECT TO user IDENTIFIED BY pw USING tns-alias;
    

    Join your table on database 1 to the table on database 2:

    SELECT my_value 
      FROM table_in_database_1 t1 JOIN table_in_database_2@db2 t2
           ON t1.my_value = t2.my_value
    

    Depending on the performance of the link, you may opt to use a hybrid approach for this, involving both a database link and a temporary table.

    Build a database link as above. Build a temporary table on database 1 that holds the values to be used in the subquery from database 2.

    CREATE GLOBAL TEMPORARY TABLE db2_values (value VARCHAR2(20));
    

    Copy the values from db2 to db1:

    INSERT INTO db2_values
    SELECT my_value 
      FROM table_in_database_2@db2;
    

    Finally, join your database 1 table to the temporary table.

    SELECT my_value
      FROM table_in_database_1 t1 JOIN db2_values t2 ON t1.my_value = t2.value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is possible to run bcp utility for sybase database from .net code? I
Is it possible to run a SQL Server 2005 job from an asp.net intranet
I would just like to know if it is possible to run MONO ASP.NET
Is it possible to run STSADM from an ASP.NET application that is residing in
Is it possible to run the new ASP.NET MVC 2 Preview 2 on mono?
I know it's possible to run a .NET application using a portable Mono executable
Possible Duplicate: ASP.Net:Best way to run scheduled tasks I have to make a scheduled
Duplicate: Run .NET exe in linux Hello, Is it possible to make my existing
In .NET is it possible to get the HttpContext of the current page from
Is it possible to run an application built on .NET 3.5 with a plug-in

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.