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

Similar Messages

  • Fastest way to get data from Multiple lists across multiple site collections

    HI
    I need to get data from multiple lists which spread across 20 site collections and need to show it as list view.
    I have searched on internet about this and got some info like options would be to use search core APIs or BCS . I can't use search because I want real time data. Not sure of any other ways.
    if anybody can provide ideas it would be help.

    Might LINQ be an option for you?  Using
    LINQPad and the
    SharePoint Connector, you should be able to write a query that'll retrieve this data, from which you can tabulate it.  I'm not sure how you'd be able to automate this any further so that it's then imported in as list.
    For something more specific, I used a third party tool called the
    Lightning Tools Lightning Conductor, which is essence a powerful content roll-up tool.  In one of my solutions, I created a calculated column that gave an order / ranking on each item, so that when lists were combined, they'd still have some form of
    order.  The web part is also fairly customisable and has always proven a useful tool.
    Hope that helps.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • 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

  • 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

  • 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

  • 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

  • Need to Get Data From Siebel On Demand ( I am new to Siebel Please Help)

    Hi All,
    I have a project in which i need to get data from Siebel On Demand and Automate this process.
    I have downloaded the Custom WSDL file and the Schema file from Oracle Siebel On Demand. I am using IDE WSAD and when i import these files into WSAD i am getting an error stating the schema definitions are wrong. Can anyone help me.....
    I need to complete it asap....
    Edited by: user491578 on Nov 11, 2008 6:50 PM

    You should probably ask Advantech. This question really has nothing to do with LabVIEW SE or NI-ELVIS. You could try posting to the LabVIEW board but there have only ever been two posts regarding 'advantech 4716'.

  • Jdbc getting data from multiple tables

    hi guys
    how can i get data from multiple tables in MSAccess
    please help

    >
    here is code thata i want to do
    i have 3 tables in my MSAccess databace
    Stud_O which consist name,surname fields
    Stud_I consist address,tel
    Stud_E department,faculty fields
    Based on this I would guess that you are missing a key field. There is no way to connect the tables.
    I make the class to insert data to the tables. But
    cant do getting datas from this tables.
    can anybody help me in making query
    and method that displays reultset strings to the
    textBoxes
    A select ...
    select name,surname from Stud_O. Use the executeQuery() method.

  • Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?

    Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?  If so, how?

    You can automate Acrobat using IAC (InterApplication Communications), as documented in the Acrobat SDK. Your program could loop through a collection of PDFs, load them in Acrobat, extract the form data from each, and generate a CSV file that contains the data.
    Acrobat can also do this with its "Merge Data Files into Spreadsheet" function, but this is a manual process.

  • 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 multiple tables

    Hello Everyone,
    I need to read data from a few tables (VBAK, VBAP, VBUK, VBUP etc.) because I'd like to get all open Sales Orders. I've tried to use RFC_READ_TABLE but it looks like it can read only 1 table at a time. I've tried to read data from individual table and then join them but it didn't work out very well because I got about 1.5 millions records from just the VBUP table. So anyone knows if there is any function that I can use to join those tables and just get the records I need?
    Any help would be highly appreciated.

    Hi Nhan,
    Thank you for your reply.
    Do I have to be a SAP developer to create BAPI on SAP? What kind of access rights do I need?
    I've tired to use other BAPIs such as BAPI_SalesOrder_GetList and it doesn't work for me because I don't have all customer numbers and I need to get all un-shipped orders for all customers.
    I've read a post on the internet brieftly menitoned that we can create a table to store information about the tables we want to join and then call the RFC_READ_TABLE function. Do you know if that is possible?
    Is there any other way you can think of?

  • Best way to get data from multiple table

    hi
    i would like to know which is the best way of getting the data in the final table from multiple read statements which are inside loop.
    for exm
    loop at itab.
    read ....
    read....
    read....
    read ....
    data into final_itab
    endloop.
    thanx
    manoj

    Hi.....
    Say we are having two data base tables.. ZMODEL1 and ZMODEL2...
    Now decalre intrenal tables and work areas and before that structures for these two and also declare one final output table for display the data...
    >types: begin of ty_model1,
    >       za(10),
    >       zb type netwr,
    >       zc(10),
    >       zd(10),
    >       ze(10),
    >       zf(10),
    >       end of ty_model1,
    >       begin of ty_model2,
    >       za1(10),
    >       zb1(10),
    >       zc1(10),
    >       zd1(10),
    >       za(10),
    >       end of ty_model2,
    >       begin of ty_output,
    >       za(10),
    >       zb type netwr,
    >       zc(10),
    >       zd(10),
    >       ze(10),
    >       zf(10),
    >       za1(10),
    >       zb1(10),
    >       zc1(10),
    >       zd1(10),
    >       end of ty_output.
    >
    >data: t_model1 type standard table of ty_model1 initial size 0,
    >      t_model2 type standard table of ty_model2 initial size 0,
    >      t_output type standard table of ty_output initial size 0,
    >      w_model1 type ty_model1,
    >      w_model2 type ty_model2,
    >      w_output type ty_output.
    Now in the start of selection.. event...
    >select <field names in the same order as in database table> from zmodel1 into table t_model1 where za in s_comp. (s_comp is select-option for that field)>
    >if sy-subrc = 0.
    >select <field names in the same order as in database table> from zmodel2 into table t_model2 for all entries in t_model1 where za = >t_model1-za.
    >endif.
    After that now fill the final output table...
    >loop at t_model1 into w_model1.
    >  w_output-za = w_model1-za.
    >  w_output-zb = w_model1-zb.
    >  w_output-zc = w_model1-zc.
    >  w_output-zd = w_model1-zd.
    >  w_output-ze = w_model1-ze.
    >  w_output-zf = w_model1-zf.
    >
    >read table t_model2 into w_model2 with key za = w_model1-za.
    >if sy-subrc = 0.
    >  w_output-za1 = w_model2-za1.
    >  w_output-zb1 = w_model2-zb1.
    >  w_output-zc1 = w_model2-zc1.
    >  w_output-zd1 = w_model2-zd1.
    >endif.
    > append w_output to t_output.
    > clear w_output.
    > end loop.
    and now display the final out table...
    This is the best way..
    Thanks,
    Naveen.I

  • 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.

  • To fetch Data from multiple database tables!

    How to fetch Data from fields of multiple database tables!
    Give me one example!

    use <b>join....</b>
    c the SAPHELP docs...
    FROM tabref1 [INNER] JOIN tabref2 ON cond
    Effect
    The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary.
    In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON>cond.
    Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same:
    Table 1                      Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
        Inner Join
        |--||||||||--|
        | A  | B  | C  | D  | D  | E  | F  | G  | H  |
        |--||||||||--|
        | a1 | b1 | c1 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a2 | b2 | c2 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a4 | b4 | c4 | 3  | 3  | e2 | f2 | g2 | h2 |
        |--||||||||--|
    Example
    Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE   LIKE SFLIGHT-FLDATE,
          CARRID LIKE SFLIGHT-CARRID,
          CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
        INTO (CARRID, CONNID, DATE)
        FROM SFLIGHT AS F INNER JOIN SPFLI AS P
               ON FCARRID = PCARRID AND
                  FCONNID = PCONNID
        WHERE P~CITYFROM = 'FRANKFURT'
          AND P~CITYTO   = 'NEW YORK'
          AND F~FLDATE BETWEEN '20010910' AND '20010920'
          AND FSEATSOCC < FSEATSMAX.
      WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.

Maybe you are looking for