레일즈 애플리케이션의 루비 데이터베이스를 MySQL에서 DB2로 변경하려고합니다. 내가 다음 문제가 : 나는 MySQL 데이터베이스에 다시 응용 프로그램을 가리키면Ruby를 사용하여 MySQL에서 DB2로 마이그레이션
ActiveRecord::StatementInvalid in WelcomeController#index
RuntimeError: Failed to execute statement due to: [IBM][CLI Driver][DB2/LINUXX8664] SQL0401N The data types of the operands for the operation "=" are not compatible or comparable. SQLSTATE=42818 SQLCODE=-401: SELECT customer_accounts.* FROM customer_accounts WHERE (status=true) AND (etl_exec=true) AND (customerAccountServer in (select tsmserver from users_accounts where user_id=90)) ORDER BY customerAccountName asc
는 응용 프로그램이 잘 실행됩니다. 내가 열 상태 및 etl_exec의 MySQL의에서 쿼리를 만들 경우
난 단지 내가 진정한 1 = 0 = 거짓을 생각하는 1과 0
있습니다.
하지만 DB2에서
하지 작동 할나는 내가 다음 문제가 문자 1로 진정한 대체 할 경우, 그 말을 잊지 : 여기 사양
NoMethodError in WelcomeController#index undefined method `customerAccountName' for #<CustomerAccount:0x007f5724544570> Did you mean? customeraccountname customeraccountname? customeraccountname= customeraccountname_was customeraccountname_change customeraccountuser customeraccountname_changed? customeraccountuser? customeraccountuser= customeraccountserver
을 :
을 SO (Red Hat 4.8.2-16) db2 v10.5 루비 버전 2.3.1 레일 버전 4.1.6
및 열
MySQL의
에서열 이름 ---- 데이터 유형 이름
상태 -------- SMALLINT
ETL_EXEC ------ SMALLINT
: DB2에서 상태 ---------- TINYINT (1)
etl_exec -------- TINYINT (1)
추가 등 당신이 RoR에 어떤 버전으로 세부 사항 및 버전을 제공하십시오 쿼리에서 각 컬럼에 대한 DB2 열 datypes을 지정하는 질문을 편집/platform을 실행하십시오. –