Join between Oracle and non-Oracle Database

We are working at a project with the follow architecture:
- 5 Databases (3 Oracle, 1 Sybase and 1 DB2);
- Session Bean like Session Facade Pattern;
- Entity Bean (BMP);
- OC4J (Oracle Container for J2EE);
The case is that we cannot make join between tables of different bases, for example, join with one table of Oracle and one other of DB2, therefore the customer does not possess tool midleware for this.
The idea that appeared was: we make a query in table XXX of Oracle and return a HashTable with its respective VO�s and Keys (PKs from the first query that will serve of base for the second query), later we have access the DB2 that one second collection would return, to inside make join of the application.
The problem is that with this solution, we will have fall in the performance. And we do not know if it is the best form.
Do you have any idea???
Thanks,
Eric Sander

Hi,
If you have different databases then the join has to be done in the VM (either by the appserver or by you).
If you want to do it yourself, I would try the following:
-write one DAO per business object (at least one per database)
-this DAO contains the specifics of its database
-return a hashtable of keys and VOs from one DAO (as you say you do?)
-in the other DAO, add a method "joinWith ( Hashtable foreignKeys )" that will return the join's result
-implement the method along these lines:
1. retrieve the candidate rows from the second DAO's tables (1 query execution)
2. put the keys in a new Hashtable, say "candidateKeys" (meaning 1 iteration over all results)
3. iterate over all elements of foreignKeys (1 iteration)
4. for each element, check if a key exists in "candidateKeys" (1 hash lookup, very fast)
5. add any such row to the result
This is called a hash join (Oracle does it internally if you do a join).
It is the fastest algorithm to do joins.
Best,
Guy
http://www.atomikos.com - JTA transaction manager

Similar Messages

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • Difference Between Oracle Database 10g And Oracle 10g Express Edition

    Can any body Tell me What is The Difference Between Oracle Database 10g And Oracle 10g Express Edition.

    http://www.oracle.com/database/product_editions.html
    This link might help you.

  • Difference between Oracle database  10.2.01 and 10.2.0.1

    What is the difference between Oracle database 10.2.01 and 10.2.0.1versions ?
    Where can I download jdbc jars for both the versions?
    Edited by: user13347335 on Jun 30, 2010 9:06 AM

    user13347335 wrote:
    What is the difference between Oracle database 10.2.01 and 10.2.0.1versions ?Probably a typo. It is officially 10.2.0.1
    Where can I download jdbc jars for both the versions?http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
    Nicolas.

  • Column cannot convert between unicode and non-unicode string data types

    I am converting SSIS jobs from SQL Server 2005 running on a Windows 2003 server to 2008R2 running on a Windows 2008 server.  I have a dataflow with an OLE DB Source which is selecting from an Oracle view.  This of course worked fine in
    2005.   This OLE DB Source will not even read the data from Oracle without the error "Column "UWI" cannot convert between unicode and non-unicode.  The select is:
    SELECT SOME_VIEW.UWI AS UWI,
                 CAST(SOME_VIEW.OIL_NET AS NUMERIC(9,8)) AS OIL_NET
    FROM SOME_SCHEMA.SOME_VIEW
    WHERE OIL_NET IS NOT NULL AND UWI IS NOT NULL
    ORDER BY UWI
    When I do "Show Advanced Editor" on this component, in the Input and Output Properties, I show the OLE DB External Column as DT_STR length 40 for the UWI column and for the Output Columns I see the UWI as the same DT_STR.
    How can I get past this?  I have tried doing a cast...cast(SOME_VIEW.UWI AS VARCHAR(40)) AS UWI and this gives the same error.  The column in Oracle is a varchar2(40).
    Any help is greatly appreciated.  Thanks.

    Please check the data type for UWI using advanced editor for Oledb Source under
    external columns and output columns. Are the data types same?
    If not, try changing the data type (underoutput columns) same as data type shown under
    external columns
    Nitesh Rai- Please mark the post as answered if it answers your question

  • Join Between W_PERSON_F and W_POSITION_D

    Hi,
    I want to join W_PERSON_F fact table and W_POSITION_D dimension table. Database: Siebel DB.
    Is there any direct join or we want to join through some other table?
    Thanks,
    Satheesh

    As per my knowledge there is no direct join between w_person_f and w_position_d
    but you can create an alisa of w_person_d as contact(w_person_d) and join with w_person_f
    as below
    contact(w_person_d).row_wid = w_person_f.contact_wid
    please mark the ans if it is correct.
    Thanks

  • Column "A" cannot convert between unicode and non-unicode string data types

    I am following the SSIS overview video-
    https://secure.cbtnuggets.com/it-training-videos/series/microsoft-sql-server-2008-business-development/6143?autostart=true
    I have a flat file that i want to import the contents onto a SQL database.
    I created a Dataflow task, source file and oledb destination.
    I am getting the folliwung error -
    "column "A" cannot convert between unicode and non-unicode string data types"
    in the origin file the data type is coming as string[DT_STR] and in the destination object it is coming as "Unicode string [DT_WSTR]"
    I used a data conversion object in between, dosent works very well
    Please help what to do

    I see this often.
    Right Click on FlatFileSource --> Show Advanced Editor --> 'Input and Output Properties' tab --> Expand 'Flat File Source Output' --> Expand 'Output Columns' --> Select your field and set the datatype to DT_WSTR.
    Let me know if you still have issues.
    Thank You,
    Jay

  • Cannot convert between unicode and non-unicode string data types.

    I'm trying to copy the data from 21 tables in a SQL 2005 database to a MS Access database using SSIS. Before converting the SQL database from 2000 to 2005 we had this process set up as a DTS package that ran every month for years with no problem.  The only way I can get it to work now is to delete all of the tables from the Access DB and have SSIS create new tables each time. But when I try to create an SSIS package using the SSIS Import and Export Wizard to copy the SQL 2005 data to the same tables that SSIS itself created in Access I get the "cannot convert between unicode and non-unicode string data types" error message. The first few columns I hit this problem on were created by SSIS as the Memo datatype in Access and when I changed them to Text in Access they started to work. The column I'm stuck on now is defined as Text in the SQL 2005 DB and in Access, but it still gives me the "cannot convert" error.

    I was getting same error while tranfering data from SQL 2005 to Excel , but using following method i was able to tranfer data. Hopefully it may also help you.
    1) Using Data Conversion transformation
       data types you need to select is DT_WSTR (unicode in terms of SQL: 2005)
    2) derived coloumn transformation
       expression you need to use is :
        (DT_WSTR, 20) (note : 20 can be replace by your character size)
    Note:
    Above teo method create replica of your esting coloumn (default name will be copy of <coloumn name>).
    while mapping data do not map actual coloumn to the destination but select the coloumn that were created by any of above data transformer (replicated coloumn).

  • What is the link between PO and Requisition in database side

    hello friends,
    please can any one tell me that what is the link between PO and Requisition in database side. means after creating the requisition we will go for create the PO based on that requisition.
    want to know that what is the link between both in database side.
    Thanks in advance
    krish.

    Hi,
    The link is at distribution level, between:
    PO_DISTRIBUTIONS_ALL.REQ_DISTRIBUTION_ID
    and
    PO_REQ_DISTRIBUTIONS_ALL.DISTRIBUTION_ID
    Hope it helps.

  • Cannot convert between unicode and non-unicode string datatypes

      My source is having 3 fields :
    ItemCode nvarchar(50)
    DivisionCode nvarchar(50)
    Salesplan (float)
    My destination is : 
    ItemCode nvarchar(50)
    DivisionCode nvarchar(50)
    Salesplan (float)
    But still I am getting this error : 
    Column ItemCode cannot convert between unicode and non-unicode string datatypes.
    As I am new to SSIS , please show me step by step.
    Thanks In Advance.

      My source is having 3 fields :
    ItemCode nvarchar(50)
    DivisionCode nvarchar(50)
    Salesplan (float)
    My destination is : 
    ItemCode nvarchar(50)
    DivisionCode nvarchar(50)
    Salesplan (float)
    But still I am getting this error : 
    Column ItemCode cannot convert between unicode and non-unicode string datatypes.
    As I am new to SSIS , please show me step by step.
    Thanks In Advance.
    HI Subu ,
    there is some information gap , what is your source ? are there any transformation in between ?
    If its SQL server source and destination and the datatype is as you have mentioned I dont think you should be getting such errors ... to be sure check advance properties of your source and check metada of your source columns
    just check simple oledb source as
    SELECT TOP 1 ItemCode = cast('111' as nvarchar(50)),DivisionCode = cast('222' AS nvarchar(50)), Salesplan = cast(3.3 As float) FROM sys.sysobjects
    and destination as you mentioned ... it should work ...
    somewher in your package the source columns metadata is not right .. and you need to convert it or fix the source.
    Hope that helps
    -- Kunal
    Hope that helps ... Kunal

  • About integration between SAP and non-SAP applications via javaidoc classes

    Hi,All
    Now we are implementing a SAP-Retail project,we encounter a problem of integration between SAP and non-SAP applications(POS),we want to set Inbound/Outbound between SAP and POS applications realtimely,POS can connect to the SAP system via VPN,weather it can be implemented?
    I conceive to implement it with SAP Java Connector IDoc Class,I don't know weather it is the best solution?If not,please give some other proposal.
    I have download the classes from SAP website and try it with the samples provided by SAP(JCoIDocSample1.java/JCoIDocSample3.java),In my testing,Inbound is succeed,but,in SAP-Retail IS,standard Outbound message type is defined via file port,some one told me that SAP Java Connector IDoc Class can only receive idocs from tRFC port?is it true?If not,please tell me how to deploy in SAP so java program can receive idocs from file port?

    We too are interested in finding information on integration between SAP and Intergraph.  Were you able to obtain information and I was wondering if could share this with us.
    Thanks,
    Sue
    City of Edmonton

  • How do you toggle a microphone directly between enhanced and non-enhanced?

    Apparently mixing calls between Microphone.getMicrophone() and Microphone.getEnhancedMicrophone() on the same device doesn't work very well.  Take the following code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="onCreationComplete()" click="Microphone.getMicrophone().setLoopBack(true);">
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                private function onCreationComplete():void
                    Microphone.getEnhancedMicrophone().setLoopBack(true);
            ]]>
        </fx:Script>
    </s:Application>
    You will be able to hear yourself speak at first, but as soon as you click the app, you will no longer be able to hear your voice.  I have also seen this sort of thing in other scenarios.
    To make a long story short, if you call getEnhancedMicrophone() for one device, then try to call getMicrophone() for that same device, the device will stop providing any audio input.  The same is true vice versa.  However if you call getEnhancedMicrophone() for one device, then getMicrophone() for a different device, then come back to the first and call getMicrophone() for it, the device will work just fine.
    Why?  Is there any way to just toggle between enhanced and non-enhanced settings for the same device, without reaching out to an unrelated device?  Thanks!

    On your Microphone reference you have these constants you can set your options to:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/MicrophoneE nhancedMode.html
    As you can see there, MicrophoneEnhancedMode.OFF disables enhanced mode. You would set your Microphone references .mode property to equal that to disable enhanced, or use one of the other relevant options to enable it. Thus, you should always use enhanced so you can toggle it.

  • Difference between physical and logical standby database

    What is the difference between physical and logical standby database?

    Hi,
    Physical Standy where its a read only DB.
    Logs are applied.
    Logical Standy where it can be Read / Write DB and the logs are applied in terms of SQL Statements.
    Thanks & Regards,
    Pavan Kumar N

  • Dynamic switching between stacked and non-stacked detail groups?

    Hi guys,
    Is it possible to dynamically switch off/on stacking of detail groups?
    I would like to give the user the option to switch between stacked and non stacked
    Regards
    Bar
    JDev: 10.1.3.2
    JHS: 10.1.2.26

    Yes and No. No because it is not supported out-of-the-box by JHeadstart, yes because you can do this post-generation and then move the custom code to JHeadstart templates.
    However, it is not a trivial thing to build, you can try the JDeveloepr forum for any help, we can help you with moving the post-generation code to custom templates, since that is the JHeadstart-related part of your question.
    Steven Davelaar,
    JHeadstart Team.

  • Differnce between unicode and non unicode

    Hi every body i want to differnce  between unicode and non unicode and for what purposes this ulities are used explain me little brief what is t code for that , how to checj version, how to convert uni to non uni ?
    Advance Thanks
    Vishnuprasad.G

    Hello Vishnu,
    before Release 6.10, SAP software only used codes where every character is displayed by one byte, therefore character sets like these are also called single-byte codepages. However, every one of these character sets is only suitable for a limited number of languages.
    Problems arise if you try to work with texts written in different incompatible character sets in one central system. If, for example, a system only has a West European character set, other characters cannot be correctly processed.
    As of 6.10, to resolve these issues, SAP has introduced Unicode. Each character is generally mapped using 2 bytes and this offers a maximum of 65 536 bit combinations.
    Thus, a Unicode-compatible ABAP program is one where all Unicode checks are in effect. Such programs return the same results in UC systems as in non-UC systems. To perform the relevant syntax checks, you must activate the "UC checks" flag in the screens of the program and class attributes.
    With TC: /nUCCHECH you can check a program set for a syntax errors in UC environment.
    Bye,
    Peter

  • Join between gl_import_references and ap_invoice_distributions_all in R12

    Please advice me how to join gl_import_references and ap_invoices_distribution_all in R12. I have understanding of join between gl_import_references and ap_invoices_all, but I am not clear how to join ap_invoice_distriutions_all to gl_import_references.
    Thanks

    Hi,
    we don't have direct link for GL_JE_LINES and AP_INVOICE_DISTRIBUTIONS_ALL.
    First join AP_INVOICE_DISTRIBUTIONS_ALL and GL_CODE_COMBINATIONS then link to GL_JE_LINES.
    Please see below eg:
    SELECT *
    FROM gl_code_combinations gcc,
    ap_invoice_distributions_all apd,
    gl_je_lines gjl
    WHERE gcc.code_combination_id = apd.dist_code_combination_id
    AND gcc.code_combination_id = gjl.code_combination_id;
    your case use apd.dist_code_combination_id instead of apd.po_distribution_id (>
    and apd.po_distribution_id = GJL.CODE_COMBINATION_ID Add -----------Problem here-----------)
    I hope this will help to you.
    Thanks,
    Prasad Raju

Maybe you are looking for