How to use OracleDataSet to do query

I have a DBGrid and OracleNavigator on my Form1. There are 1 million records in ADDRESS table. If I put 'Select * from ADDRESS' in the SQL of OracleDataSet, none of records can be retrieved. If I put Select * from ADDRESS where state = 'ABC', I can have a DBGrid with all the column names of ADDRESS table, but without data, because state 'ABC' does not exist. I want to have a blank DBGrid with column names of table on it, so I can use nbEnterQBE to enter letters such as A% to retrieve everything starting with A. Since I can not put 'Select * from ADDRESS' in the SQL of OracleDataSet, I basically can not use nbEnterQBE and nbExecuteQBE to get subset of ADDRESS table.
Could anyone please help me out here? Thank you very much.

Peggy
 
First of all you probably want to set TOracleDataSet.QueryAllRecords to False. You never know what query the user is going to enter, and this will prevent the situation you are running into.

Secondly you can set TOracleDataSet.QBEMode to True before the dataset becomes Active. This way no data will be retrieved, and the user must first enter the query.

I hope this helps.

------------------
Marco Kalter
Allround Automations
 
Back
Top