PDA

View Full Version : SQL Expressions vs Queries



igendreau
06-15-2009, 01:39 PM
I have a database, which has a linked table to an Oracle database.

Then I have a query that does some basic summarizing, so that I can create a few reports off of that query.

The problem is it takes FOREVER... Someone recommended that I "use a SQL expression to create my record source because it lets the database do the work before returning the records, as opposed to a query which brings the data down and then filters through it one by one"...

True? And if so, can someone give me the basics on how to do that? I'm familiar with writing a SELECT statement to bring down records, but I'm always doing it in a form as part of a function. Whenever I write reports I always have a query or a table as my source. No idea how to have an SQL expression as the source.

Thanks for the help!

OBP
06-16-2009, 05:00 AM
I am not sure why the Access Query is taking "forever" to run, it usually only takes a few seconds for a query to run through 1 million records. It could be it's structure is not correct, or it perhaps it would run faster if split into more than one query.
Doesn't the Oracle database support SQL Queries?
I am not sure that VBA created SQL will run any quicker than a Query, which is also SQL.

Marcster
06-16-2009, 11:32 AM
INFO: http://office.microsoft.com/en-us/access/HP051884041033.aspx?pid=CH063653551033&WT.mc_id=42

Have you tried creating a 'Pass Through Query' in Access?.
The actual query is run on the server not on the local computer.
Running it on the server is alot faster than on a computer as the actual
proccessing is done on the server.

Not sure how to (or if it's possible for oracle) set it up though.
Have done it SQL Server.