I am getting a ORA-00907: missing right parenthesis from the following code below
dbQuery:= TQuery.Create(nil);
dbQuery.DatabaseName:= dbMain.DatabaseName;
with dbQuery do
begin
SQL.Add('select payee_address_zip, EXTRACT(WEEKDAY FROM check_date) as DOW, ');
SQL.Add('(cmcl_bank_cleared - check_date) as DateDiff from AP_Master ');
SQL.Add('where (cmcl_bank_cleared is not null) AND ((cmcl_bank_cleared - check_date) >=:DaysParam)');
SQL.Add('order by payee_address_zip, DOW, DateDiff');
try
ParamByName('DaysParam').AsInteger:= days_param_int;
Open;
//do something else here
except on E:EDatabaseError do
begin
raise ECustomException.create('Error opening query for step 1 of computing Float Factors!');
end;//except
end; //try
end; //with
dbQuery.Free;
Can someone tell me what is going on? I can't seem to see that i have left out a parenthesis, and this SQL works just fine against a Interbase test database. However, when moving it to a clients oracle database, it crashes, with the error above.