Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009

    Exclamation Unanswered: use more than one database in the same sql query

    Dear Sir

    Please is it possible in the same query to interogate rows in two différents databases? I said i have 2 databases and i want to be sure that with Informix Online 12 or less it is possible to write a sql query which would retrieve rows from both database in the same informix instance which have i suppose more than one database in the dbspace?


  2. #2
    Join Date
    May 2012
    just qualify the tables with the database like this:

    SELECT t1.col1 FROM nameofdb1:nameoftable t1, nameofdb2:nameoftable2 t2
    WHERE t1.col1 = t2.col1;

    or like this (not sure what you exactly want):

    SELECT * FROM nameofdb1:nameoftable t1
    SELECT * FROM nameofdb2:nameoftable t1

  3. #3
    Join Date
    Dec 2003
    North America
    I'm pretty sure the syntax is <DB name>@<servername>:<DB owner> (in single quotes).<tablename> so please give this a try assuming ipo is your DB owner. You need a period between the DB owner & the table name, this syntax works with Informix OnLine 11 but I've never worked with 12.

    select * from database1@onlinetcp_server1:'ipo'.tabela1, database2@onlinetcp_server2:'ipo'.tabela2
    Last edited by mjldba; 04-28-16 at 15:40.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts