Results 1 to 5 of 5

Thread: Cross database query engine with Oracle

  1. #1
    Join Date
    Mar 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Cross database query engine with Oracle

    Hi,
    I am developing an application where I want to query data from tables in 2 different databases at once. I am using Oracle as the database but my employer wants me to achieve this without making a database link between the 2 databases. So I thought of developing a cross database query engine using Qt sql module objects. But it should not be as complex as an sql parser. I just want query data from tables in two databases and display them in 1 view using a common interface. If there is anyone who has done this kind of programming before or someone who has an idea about this, your suggestions are much appreciated. Thank you very much.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Cross database query engine with Oracle

    Is this for a particular small set of queries, or a general query tool? In the first case you just run two queries against the two databases and perform the join manually (hard-coded) at the client. In the second you have no option but to replicate a good chunk of SQL query logic either in a parser or some GUI query construction tool in order to know how to do the join at the client.

    Another possibility would be to pull both sets of data back into a local Sqlite database (in-memory or on-disk) and performing the query against that. This is obviously not practical for millions of rows or very sensitive information.


    Pulling the processing back to the client is nowhere near as efficient as doing it in Oracle, especially if the data sets are large. Is there a good reason to fork out big dollars for Oracle and then avoid using it?

  3. The following user says thank you to ChrisW67 for this useful post:

    kasper360 (29th March 2011)

  4. #3
    Join Date
    Mar 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross database query engine with Oracle

    This is probably going to be a general tool since I may have to use it unknown number of times in different ways. (because this cross database query engine is only a small part of the application) So hard coding the queries is not an option.

    And for your last question, think of it this way. The users of this application will log in using TNS aliases. And each alias has different privileges. These privileges will prohibit some users from accessing some tables. That's why I was asked not to use database links.

    I'm using these aliases to connect to 2 database schemas called ATS and SER. And I want to query tables in both these schemas. What I have done so far is I have created 2 QSqlDatabase objects and connect to each schema using the TNS alias. But in order to make cross database queries, i have to do it manually each time, which is a very hectic task. so I want to develop an common interface (possibly an API) and call some methods to make these queries
    Last edited by kasper360; 29th March 2011 at 11:55.

  5. #4
    Join Date
    Feb 2010
    Posts
    18
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Cross database query engine with Oracle

    Quote Originally Posted by kasper360 View Post
    And for your last question, think of it this way. The users of this application will log in using TNS aliases. And each alias has different privileges. These privileges will prohibit some users from accessing some tables. That's why I was asked not to use database links.
    I don't understand the problem with database links. You have two schemes and different users. You can make a database link and give synonyms for tables in the linked database. And finally you can grant or revoke access to tables in the database and the linked database for every user.

    Quote Originally Posted by kasper360 View Post
    But in order to make cross database queries, i have to do it manually each time, which is a very hectic task. so I want to develop an common interface (possibly an API) and call some methods to make these queries
    You have to create your own QAbstractTableModel like QCrossSqlQueryModel, which gets two queries on two connections.

  6. The following user says thank you to majorwoody for this useful post:

    kasper360 (30th March 2011)

  7. #5
    Join Date
    Mar 2011
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cross database query engine with Oracle

    I don't understand the problem with database links. You have two schemes and different users. You can make a database link and give synonyms for tables in the linked database. And finally you can grant or revoke access to tables in the database and the linked database for every user.
    Thanx for this info. I'm not much familiar with database links because this is the 1st time I've even considered to use them in an application. I'll discuss this with my employer and see if there are any other causes why he wants me not to use it.

Similar Threads

  1. Error connecting to Oracle database
    By NAYZAKAY44 in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2013, 18:20
  2. Qt Oracle Database Failure...
    By combsjy in forum Qt Programming
    Replies: 0
    Last Post: 9th August 2010, 15:57
  3. Oracle Database Connection
    By ToddAtWSU in forum Qt Programming
    Replies: 6
    Last Post: 20th December 2007, 15:18
  4. Oracle database <=> Qt4/Opensource
    By windkracht8 in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2007, 23:12
  5. Oracle Database Problem
    By magikalpnoi in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2006, 21:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.