Page 1 of 1

Param does not work for OraScript

Posted: Thu 24 Jun 2010 07:48
by easyblue
Hello

Please correct me if I am wrong, it seems that Params in Scripts does not work.

suppose following scripts:
//-----------------------
create table table1 as
select * from old_table1;

create table table2 as
select
*
from
old_table2
where
period_start_time >= :start_date
and period_start_time SQL->Clear();
OraScript->SQL->Add(....); // add sql scripts

SetParams(); // now I set all params
OraScript->Execute();
//-------------------

Then I found that
1. Before calling Execute(); the OraScript->Params is empty (Params->Count is 0), and I can not access to the desired params.
2. If I catch BeforeExecute event, both OraScript->Params and OraScript->DataSet->Params are also empty. Still not be able to access to the desired params.

So this makes me impossible to have a script run with parameters.

Please kindly check it.

Suggested solution:
1. In the event of "BeforeExecute", the DataSet already have its Params constructed.
2. Or we can add an "BeforeExecute" event to TCustomDADataSet, where to catch the params.