How Do I Use CommandText w\ DOA

d4jaj1

Member²
Hello,

I'm trying to use the CommandText feature of a ClientDataset to temporarly override the SQL code on my application server. On the App server, I have a OracleDataset with 2 Variables attached to a DataSetProvider. The datasetprovider's commandtext option is set to true. On the clientdataset, I fetch params at design time and at runtime I use the following:

with cds do begin
close;
params.ParamByName('idtype').value := edit1.text;
params.ParamByName('ident').value := edit2.text;
open;
end;

Everyting works fine. Next I try to use the CommandText feature in the ClientDataset with the following:

with cds do begin
close;
Params.Clear;
commandtext := 'select * from tablename';
execute;
end;

When this code runs, no data is returned and no runtime errors are generated. I can see the application connecting to the server (via hub usage), but nothing is returned, the attached DB grid isn't even updated with the column names. If I remove the Params.Clear line, I get an error of "ORA - 01036 - illegal variable name/number".

What am I doing wrong? I'm using DOA 3.4.3, D5 Ent SP1, on Oracle 8.05. Thanks.
 
Back
Top