Ruby on rails 如何使用activerecord informix适配器编写准备好的语句
将1.1.1与它一起使用,我试图创建一个准备好的语句,但得到一个错误Ruby on rails 如何使用activerecord informix适配器编写准备好的语句,ruby-on-rails,database,prepared-statement,informix,Ruby On Rails,Database,Prepared Statement,Informix,将1.1.1与它一起使用,我试图创建一个准备好的语句,但得到一个错误 ActiveRecord::StatementInvalid Informix::DatabaseError: Prepared statement is not a cursor specification: 我的查询如下所示: @resource=Client.connection.execute("select * from sample where username=?;",'John') 您跳过活动记录堆栈
ActiveRecord::StatementInvalid
Informix::DatabaseError: Prepared statement is not a cursor specification:
我的查询如下所示:
@resource=Client.connection.execute("select * from sample where username=?;",'John')
您跳过活动记录堆栈直接与Informix适配器进行此查询有什么原因吗?是的,我无法使用Informix DB适配器直接使用AR。我甚至不知道它是否受支持,因为适配器已经多年没有更新了。然而,我有一个解决方法,模型类中的一个方法:connection.select_allselect*from sample,其中username={firstname}他在github的工作中有几个分支与3.0x版本的rails一起工作。在某个时候,我计划对驱动程序进行更新,使其能够与3.2兼容,但这涉及到更极端的重写。