TOracleDataSet

twilson

Member²
I have a dataset in a datamodule,
my original sql code was :-

select *
from report_parameter_controls
where status = 'I'
order by report_completed desc

This returns all rows from the rdbms, so I
modified the above to return all records completed within the last 3 days :-

select *
from report_parameter_controls
where status = 'I'
and trunc(report_completed) >= (sysdate-3)
order by report_completed desc

when run in SQL or TOAD I receive the correct
result but in my application the dbgrid is still returning all rows, I have rebuilt and compiled but still get the same result.

Is is cached somewhere, also in sqlmonitor my other dataset queries return the sql in the sql tab but the one does not.

Any Ideas !

Im running Delphi5 + patch 1 and I believe the latest version of DOA

------------------
Tony
Tony Wilson
Technical Analyst NCHT
 
I can only imagine that this SQL statement is not executed. Your remark about the SQL in the Oracle Monitor is a bit confusing though. It does not display the SQL?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
>>I can only imagine that this SQL statement >>is not executed.

Marko, if the sql is not executed where are
the dbgrid results coming from, the dataset is active, results are returned but not the
results that were expected.

>>Your remark about the SQL in the Oracle >>Monitor is a bit confusing though. It does >>not display the SQL?

In SQL Monitor all executed SQL is displayed in the SQL tab on the right and the dataset that ran that SQL show in left.

The dataset i'm having problems with doesnt
display its SQL in the SQL tab. But execution
of returned records show in the right top
time stamp box.
 
Sorted the SQL Monitor, I am retrieving 321
records only the first (25 records in buffer)execution displays the executed SQL all other fetches ( 25 records) are executing but not showing the executed sql.

Is it possible then, that SQL Monitor could be modified to display is executed SQL statement for addintional fetches which are
larger than the dataset read buffer.

My other problem still exists, my new SQL in the dataset sql property is running its previous SQL statement, not its new entered
SQL statement, This has been proved by the result found in sql monitor.

sql monitor result:-00:04.327 00:00.190 Query.Execute (25 records processed) select * from report_parameter_controls where status = 'I' order by report_completed desc
00:04.567 00:00.150 Query.Next for up to 25 records (25 records processed)
00:04.757 00:00.001

Dataset sql property:-
select *
from report_parameter_controls
where status = 'I'
and trunc(report_completed) = (sysdate - 20)
order by report_completed desc

Tony
 
How exactly do you modify the SQL property and reopen or refresh the dataset in your application code?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
>>How exactly do you modify the SQL property >>and reopen or refresh the dataset in your >>application code?

SQL is modified at design time using either the SQL property in the object inspector or
using the right click function and selecting the sql editor.

I have now managed to return the correct results in my applicattion but to to this I had to go back three version, modify the sql, redo all my edits and recompile, Ive not changed the sql again to see if the problem still exists but will try this later.

But you can see this is still a worry to me as Ive had to go back versions and redo work.

Regards Tony
 
This is a design-time problem? You modify the SQL property, and even though the property is set correctly, the "old" SQL is executed? I'm sure we are missing something here, because there is simply no way that the old SQL is buffered.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
This is a design-time problem? You modify the SQL property, and even though the property is set correctly, the "old" SQL is executed? I'm sure we are missing something here, because there is simply no way that the old SQL is buffered.

I think you may be right, I retested by changing the SQL a couple of times and now it works fine. I wander if its something to do with the ide and not DOA.

Regards Tony
 
Back
Top