Hello gurus,
I'm trying to do a search through an encrypted database (to which I
have the key). I want to use the LIKE operator in MySQL rather than
dumping out all entries and sorting in Perl, since MySQL will be much
faster at digging up the right information.
I'm not having any luck with the following (I'm using DBI in Perl, so
$ is Perl variable stuff):
SELECT(DECODE("Last_Name",$KEY) from $TABLE where
DECODE(Last_Name,$KEY) like "A%").
More exactly, my Perl DBI code looks like:
my $ps="SELECT DECODE(\"Last_Name\",\"$ACCOUNT_KEY\"),
DECODE(\"First_Name\",\"$ACCOUNT_KEY\"),
DECODE(\"SSN\",\"$ACCOUNT_KEY\") from $tablename WHERE
DECODE(Last_Name,\"$ACCOUNT_KEY\") LIKE \"$letter\")";
I've also tried quotes around the latter Last_Name, but that doesn't
work either. The idea is that I want SQL to decrypt the column entry
before performing the LIKE comparison.
Thanks,
Matt
oe******@mit.edu