I keep some sensitive information encoded using MySQL''s ENCODE and
DECODE commands in the database table.
-- example SQL:
SELECT *, DECODE(ccnumblob, ''salthere'') AS ccnum FROM
customers WHERE id=2;
UPDATE customers SET ccnumblob = ENCODE(''4321432143214321'',
''salthere'') WHERE id=2;
INSERT INTO customers (name, ccnumblob) VALUES (''Bob
Dobalina'',
ENCODE(''4321432143214321'', ''salthere''));
How, in that case, would I pass that DECODE and ENCODE commands into
the SQL? I don''t think a find_by_sql will do it.
Since transforming the encoded data out of that database table will be
essential to ALL CRU(^D) on that table, I was hoping to have it be a
more integrated part of the model itself, instead of used only in
special find_by_sql situations.
Any tips?