Error: SetVariable + Create table as select

sinys

Member²
Var
DS : TOracleQuery
...
// set sql text in design-time
DS.SQL.Text := 'create table user1.table1 as select * from user1.table2 where date_s >= :date_s';
// Create 1 variable 'date_s' as string in design-time

// in run-time
DS.SetVariable('date_s', DateToStr(Date));
//or
DS.SetVariable(0, DateToStr(Date));
DS.Execute;
 
DDL commands like "create table" do not accept bind variables. You have to pass a literal command, or you can use substitution variables (type otSubst) instead.
 
Back
Top