Single query to get data from different databases

i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement.
i tried searching on the net
i found that dblinks can help
but iam not sure if ill be able to create dblinks in my situation which is:
i need to get data from oracle to be copied to mysql
this is not a replication acitivity, but i need certain fields from one database and certain from the other
so what iwas thinking is, if i use an sql query to get all the fields (i need around 40) from the different oracle databases and create a singlefile with one insert per select, i can then read that file into mysql
instead of creating multiple sql queries for each table and creating separate files and eventually separate tables in mysql.
can anyone help me here?
or maybe suggest another approach.
thanks

Hi,
I think dblink is the only option available to get data from different databases. It will work for your case too.
CREATE DATABASE LINK db_link CONNECT TO user_name IDENTIFIED BY  password USING 'instance_name'you must have the system privilege 'create database link' to create db links. This way you can get the required data and put it in a table in oracle. But i dont know how to put this data from oracle table to Mysql.
HTH
Muneer

Similar Messages

  • Data from different databases in the same report.

    Hi Everyone,
    I am trying to build a reconciliation report in which I need to show the data from the source and target, side by side.
    Source and target are both different databases, although being oracle only
    Whenever a new data model is created, it gets attached to a data source and in the report we need to choose a specific data model.
    Can we have data from different databases in the same report ?

    Yes, it is possible.
    One way Is to use dataTemplates. There you can make queries from any number of different databases (The max I have done is 5).
    It looks something like that:
    <dataTemplate name="NameOfTemplate">
    <dataQuery>
         <sqlStatement name="Q1" dataSourceRef="Connection1">
              <![CDATA[     select * from table1]]>
         </sqlStatement>
         <sqlStatement name="Q2" dataSourceRef="Connection2">
              <![CDATA[     select * from table2]]>
         </sqlStatement>
      </dataQuery>
      <dataStructure>
         <group name="RESULT1" source="Q1">
              <element name="P_FIRST_NAME" value="P_FIRST_NAME"/>
         </group>
         <group name="RESULT2" source="Q2">
              <element name="P_DATE" value="P_DATE"/>     
         </group>
      </dataStructure>
    </dataTemplate>dataStructure is very important when you get data from different places, if you don't define those elements, then only the result from Q1 is shown.
    The second possible way is to make as two different data models, each containing their own query and then set Main Data Set as concatenated SQL Data Source.
    Best of luck,
    Evelyn

  • Help needed to insert data from different database

    Hi ,
    I have a requirement where i need to fetch data from different database through database link .Depending on user request , the dblink needs to change and data from respective table from mentioned datbase has to be fetched and populated .Could i use execute immediate for this, would dblink work within execute immediate .If not , could pls let me know any other approach .

    What does "the dblink needs to change" mean?
    Are you trying to dynamically create database links at run-time? Or to point a query at one of a set of pre-established database links at run-time?
    Are you sure that you really need to get the data from the remote database in real time? Could you use materialized views/ Streams/ etc to move the data from the remote databases to the local database? That tends to be far more robust.
    Justin

  • Select data from different database

    hi,
    may I know how to select data from different database?
    for example,
    I've 2 databases, OracleDB and OracleAR
    Connect with OracleAR in SQL*Plus
    select * from OracleDB.TableName
    does Oracle support this kind of query?
    how can I retrieve data from other database while im connecting with
    other database?

    Hi,
    Yes, it's possible. No, your syntax won't work.
    First of all you have to define a DATABASE LINK inside the DB where you are already connected (in this case OracleAR). Read docs how to do that.
    Second thing is the query. It will look like
    SELECT * from TableName@<NameOfDatabaseLink>Greetings,
    Guido

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can i  get data from anather database system  ????????

    Hi every body..
    I 've a problem .....
    I've an old program work on "DOS" and it's content database which content all Data that i need for that program
    The data file extension with ".FD" , ".VW" , ".LSS" & "SLP"
    I want to kow:-
    1) what is that database system
    2)What program could open or can get data from that database tables.
    3)can i do that with oracle...
    please describe every thing in details...
    ... Please replay quickly... urgently
    ...waiting your answer....

    You're probably better off consulting the documentation for the DOS program you're trying to deal with than hoping someone here will be able to guess what program you're using, identify the structure of the files, and tell you how to extract the data into something Oracle can import.
    Justin

  • Get data from two databases?

    Hello all,
    Do anyone know if it's posible to get data from two databases while I'm running SBO in one of them? I need this because our client wants to be able to print reports with all the information stored in both companies. I searched this forum trying to find if this is possible but I did't find any information about this.
    Can someone help me?
    Thanks and regards,
    Mariana Mazzero

    Hi Mariana,
    What you can do is use two company objects to retrieve the data. As far as I know you're not restricted to one company connection.
    You can also just use a standard read only connection (like ADO/ODBC) to retrieve the data for the reports.
    Hope it helps,
    Adele

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

  • Getting data from several database

    I have more that one DB in different locations, but all of them have a same structure. now i want to get data from all of the DBs in a unique time and simultaneously. how i can do it?

    If all the databases are Oracle then open your DBA Administration manual to Part VII Distributed Database Management.
    These chapters will tell you how to create database links and how to design and manage remote and distributed transactions.
    Also see the CREATE DATABASE LINK command in the SQL manual.
    Once you have reviewed this material you can post back with specific questions or error messages you encounter while configuring the feature.
    Basically you just need a tnsnames.ora entry on the database server for the remote database and then define a database link that references the tnsnames.ora entry. The documentation will show you the steps.
    HTH -- Mark D Powell --

  • How to get data from  different SEGMENTs

    Hi;
    My requirement is to first of all retrieve the data from different segments in run time.
    I mean, i have to execute t/code WE19 and the idoc will be given after that an user exit would called where i have to retrieve the data from different segments and then it would store in an internal table for further calculation.
    Can you all please guide me how to retrieve the data via ABAP code in runtime so that it can store in an internal table.
    Regards
    Shashi

    write code lke this ..
    form post_idoc tables idoc_data structure edidd
                                    idoc_status structure bdidocstat .
    loop at idoc_data .
      case idoc_data-segnam .
        when 'zsegment1'.
           move idoc_data-sdata to wa_zsegment1 .
        when 'zsegment2'.
          move idoc_data-sdata to wa_zsegment2 .
       when 'zsegmentn'.
          move idoc_data-sdata to wa_zsegmentn.
      endcase .
    endloop.
    After this write code to move data to int table from work area .
    endform .
    Hope this helps u....

  • How to make this function module as RFC to get data from different system?

    Hi
    I am trying to use following function module . This function module is used to copy data from one cube to another cube within same system however I need a this should happen across two different system. How can I use this function module to make it remote call to different system and do the same function what it is doing ?
    Name of function module -
    RSDRT_INFOCUBE_DATA_COPY
    Any help would be really helpful
    AG

    HI,
      let us say you want to copy the data of a cube in system A to a cube in system B .
      1) create a RFC function module in system B (in this function module  call the function module RSDRI_CUBE_WRITE_PACKAGE to update the data), this RFC function module should have same parametersa as RSDRI_CUBE_WRITE_PACKAGE .
    2) write a program in system A .. read the data from the infocube using the function module RSDRI_INFOPROV_READ and call the RFC function module in system B that you have created..
    for the details of the parameters to pass to these two function modules use the RSDRT_INFOCUBE_DATA_COPY and get the required code
    Thanks
    mahesh

  • Getting Data From MySQL Database using Dreamweaver CS4 Built In Functions

    Hi,
    I am really in need of some help if you don't mind.
    I basically have a website with user regsitration system etc and so on.
    I basically connected to my Data Base in Dreamweaver CS4 and now want to use the tools in Dremweaver CS4 to display Data from database.
    Problem is i see the tools but not really sure how i use them. I see on Data bar all the tools to view, update delete records etc.
    I basically created a page where i want to display all the records in the DB. I done this using dynamic data selecting what fields to display etc and 15 records per page.
    When i view the page in localhost thou it is only showing 1 record althou i have like 5 users in my test db.
    So if anyone can really tell me how i go about displaying data from db that be great. When i learn how to do that i probably will understand and learn how to update records etc.
    Thanks

    To display all records, you need to apply a repeat region to the paragraph, div, or table row that contains the dynamic text objects for the database results. You might also find it helpful to follow the dynamic application tutorial in the Adobe Developer Connection.

  • How to load data from different database

    Hi,
    My problem is how to load Foxpro 2.6/clipper data into oracle 8 with all its structure and data with SQL loader or other utility if any.
    And also how can i integrate existing forpro system into Oracle. i.e client will work on Foxpro application and we will only take its output(data files) on daily basis and convert it into Oracle 8.
    Please find any solution.
    Regards
    null

    You can also try to make up an ODBC connection to Foxpro and convert the data from foxpro to oracle using the COPY command (see docs on PL/SQL & OCA). I remember that foxpro/clipper are running on MS-DOS, so I don't know if you can establish an ODBC connection to oracle which can be used from the foxpro/clipper application to use it as a frontend for an oracle database.
    Regards, Kai
    null

  • Retrieve data from different database

    Hi all,
    I have 2 database servers, servar a and server b, i created a form from server a table, in the same form i have a LOV, i want to see data in this LOV from server b table.
    how i can do it ?
    thanks
    Noman

    Thanks for your early reply,
    Can you please more elaborate how I retrieve data from server b in LOV after creating a link with server b.
    What I did exactly I made a data base string in server a from server b, still I am confuse how I retrieve my data from that server database..
    Noman

  • Need to get data from multiple database instances in a single query

    Hi,
    I need a small favour from you guys. The prob is as follows:
    I need to get name, row_id from table A from schema 1 and gbu_name, name from table B from schema 2 where a.name = b.name. I wrote the query in the following manner:
    SELECT a.name, a.row_id, b.gbu_name
    FROM Schema1.A as a, Schema2.B as b
    Where a.name = b.name
    But this query is not working and the error is like " The table does not exists".
    Please update me how to avoid the error and get the right sort of result.
    Thanks & Regards,
    Debabrata

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

Maybe you are looking for

  • SOAP to RFC : Message visible in Message Monitoring , but not in SXMB_MONI

    Hi Experts, I'm doing a SOAP to BAPI scenario. The interface is a SYNCHRONOUS one . I'm using XML SPY as the soap client to test the interface. Even though i don't have the test for the BAPI after sending an empty request message i'm able to receive

  • QR code occupying more space around the barcode

    Hi, I am creating a new form with 7 barcodes of type Paper forms Barcode(QR code). I have two problem in this... 1) I am giving the same width and height for all the barcodes. But in the final output the size differes for all. two are of one size, ot

  • JVM SIGSEGV error running Java 1.5.0_01 on linux

    Three times last week we had the JVM come down hard with a SISSEGV error running our web application. Each crash was on a different machine. The offending thread was always in libnet.so shared library handling either a getHostByAddr() or getLocalHost

  • Centering div makes design view too wide

    <div style="width: 100%;"> <div style="width: 100px; margin-left: auto; margin-right: auto;"> BODY CONTENT </div> </div> Ok, I've been wrapping my body content in the div tags shown above rather than using a centred table as I did before. The problem

  • SSO with KM document shortcut in MS Outlook

    Hi Guys, SSO was setup in our Portal and was successful implemented for months. This means that whenever a user login from Windows, he is able to get into the Portal without having to sign-in. My question to all is, when we have an announcement via M