Estoy usando un campo de tipo char (enc_debe y enc_haber) en SQL
Server de largo 32 y en algunos casos cuando los caracteres generados
por la encriptación incluye alguna apostrofe o doble comillas me
ocurre lo siguiente:
ActiveRecord::StatementInvalid in EgresosController#calcular
DBI::DatabaseError: 37000 (105) [Microsoft][ODBC SQL Server
Driver][SQL Server]Comilla no cerrada antes de la cadena de caracteres
‘’.: UPDATE egdetalles SET [femision] = ‘20080623 00:00:00’, [glosa] =
‘Inversion’, [doctipo_id] = 9, [folio] = NULL, [ln] = 1, [egreso_id] =
11, [enc_haber] = ‘�{[�’‘z��:?�g�"eCWvӊ��^�N’, [proyecto_id] =
6, [fpago] = ‘20080623 00:00:00’, [enc_debe] =
'�{[�’‘z��:?�g�"eCWvӊ��^�N’, [plancuenta_id] = 12,
[ctrocosto_id] = 30 WHERE [id] = 23
RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:128:in
log' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb:318:in
execute’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb:301:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1796:in
update_without_lock’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:60:in
update_without_callbacks' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:in
update_without_timestamps’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/timestamp.rb:48:in
update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1789:in
create_or_update_without_callbacks’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:242:in
create_or_update' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb:1545:in
save_without_validation’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/validations.rb:752:in
save_without_transactions' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:129:in
save’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:95:in
transaction’
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:121:in
transaction' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/transactions.rb:129:in
save’
#{RAILS_ROOT}/app/controllers/egresos_controller.rb:10:in calcular' #{RAILS_ROOT}/app/controllers/egresos_controller.rb:8:in
calcular’
Alguna idea?
Gracias
Angel Mauricio Pino G
[email protected]
Movil: 08-577.92.72