QBE

lynn_sai

Member²
Hi Marco,

When I use the TOraDataSet with the method SetVariable and DeclareVariable, I have the followinfg message: ORA-1036: illegal variable/name number

My SQL state. in TOracledataset:
select * from table1
and at run time:
table1.Deletevariables;
table1.declarevariable('dates1', otDate)
table2.declarevariable('dates2', otDate)
table1.setvariable('dates1', startdate)
table2.setvariable('dates2', enddate)

table1.executeQBE

Please tell me what I did wrong here ??????

Thanks.
 
Originally posted by lynn_sai:
My SQL state. in TOracledataset:
select * from table1
The SQL should have variables. It should be like:
SELECT * FROM TABLE1
WHERE :DATES1>TABLEDATE
AND :DATES2
 
it was mistyped, it should be all table1 in my earlier question.....

Going back to my question, I don't want to have variables in my TOracleDataset's SQL state., I want these variables to be declared and executed at run time only.......
 
The number and type of bind variables must be the same as the variables actually used in the SQL. In the SQL example that you show, there are noe variables at all, so then you shouldn't need to declare any. If you use QBE, then the component itself handles the necessary "fix" to your where-clause, and you don't add any variables.

Helene
 
Back
Top