Queries from a TOraQuery result

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mjacquez
Posts: 1
Joined: Fri 06 Jan 2006 00:01

Queries from a TOraQuery result

Post by mjacquez » Tue 22 Apr 2008 17:35

Hi there,
I have a TOraQuery that gets about 5000 records and 10fields as a result from a elaborate query (takes a few minutes). Lets call it qrStudentsData , and I need to somehow be able to do a lot of fast&small queries/joins for statistical propurses using qrStudents' results with other physical tables (lets say StudentGrades)... so, i need something like this:

SELECT students_fields, other_fields FROM qrStudents, StudentGrades
WHERE [ conditions ]

it is posible to do that if qrStudents is a OraQuery and StudentGrades is a physical table?

I've tried doing a subselect but the first query takes to long to be excecuted several times ... Id like to have qrStudents records available somehow once for fast access but how can i reference that as a Table (or memory table)?

I hope i've explained myself =)
Manuel

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 23 Apr 2008 14:00

It is impossible to use data from TOraQuery as an Oracle table.

Try to use lookup fields instead of join:

Open qrStudents in one TOraQuery component. Then you can assign a query like the following to another TOraQuery component:

SELECT StudentGrades_fields FROM StudentGrades
WHERE [ conditions ]

Right click on this TOraQuery component, open Fields Editor, and create lookup fields linked to TOraQuery with data from qrStudents.

Post Reply