【发布时间】:2011-10-13 12:46:18
【问题描述】:
我在 Delphi 7 和 Oracle 中使用 ADOQuery。将参数传递给 ADOQuery 时出现错误。我使用了以下行。请帮我找出错误。
ADOQuery.Sql.text:= 'select * from temp_table '+
'where column1 in (select column from table2 where id=:id) and id=:id';
ADOQuery.Parameters.ParamByValue('id').value= 'abc';
ADOQuery.open;
当我打开查询时,我会收到以下错误:
参数对象定义不正确。提供的信息不一致或不完整。
【问题讨论】:
-
如果我删除查询的最后一个条件,那么它工作正常。 ''select * from temp_table where column1 in (select column from table2 where id=:id)'
-
使用 id1 和 id2 而不是 2 "id"s