Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何使用activerecord informix适配器编写准备好的语句_Ruby On Rails_Database_Prepared Statement_Informix - Fatal编程技术网

Ruby on rails 如何使用activerecord informix适配器编写准备好的语句

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') 您跳过活动记录堆栈

将1.1.1与它一起使用,我试图创建一个准备好的语句,但得到一个错误

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兼容,但这涉及到更极端的重写。