我正在尝试使用以下代码运行一个简单的like子句...
Message.where('to LIKE ?', '%hi')
我的模型类如下...
类消息 < ActiveRecord::Base
attr_accessor :from, :error_messages, :use_background_job, :to
attr_accessible :status, :to, :from, :cc, :bcc, :subject, :body, :error_messages, :use_background_job
我正在使用 activerecord 和 activerecord-oracle_enhanced-adapter gem。但是我收到以下错误...
←[1m←[36mMessage Load (161.1ms)←[0m ←[1mSELECT "MESSAGES".* FROM "MESSAGES" WHERE (to LIKE 'hi')←[0m
ActiveRecord::StatementInvalid: OCIError: ORA-00936: missing expression: SELECT "MESSAGES".* FROM "MESSAGES" WHERE (to LIKE 'hi')
from stmt.c:230:in oci8lib_191.so
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5-x86-mingw32/lib/oci8/cursor.rb:126:in `exec'
这是 Oracle 问题还是我的 like 子句语法不正确?