我在Delphi 7和Oracle中使用ADOQuery。在將參數傳遞給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;
當我打開查詢我將獲得以下錯誤:
Parameter object is improperly defined. Inconsistent or incomplete information is provided.
如果我刪除查詢的最後一個條件,那麼它工作正常。 ''select * from temp_table where column1 in(從table2中選擇列,其中id =:id)' – Nalu
使用id1和id2而不是2「id」s – SimaWB