In my version of MySQL (4.1.9), your sample code generates an error:

mysql> select decode(encode("foo"));
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '))' at line 1

Apparently encode()/decode() take two args, at least on my version of
MySQL:

mysql> select decode(encode("foo","bar"),"bar");
+-----------------------------------+
| decode(encode("foo","bar"),"bar") |
+-----------------------------------+
| foo                               |
+-----------------------------------+
1 row in set (0.00 sec) 

> -----Original Message-----
> From: Jeff Smelser [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 04, 2005 2:14 PM
> To: mysql@lists.mysql.com
> Subject: Re: ENCODE & DECODE
> 
> On Friday 04 February 2005 11:00 am, shaun thornburgh wrote:
> > Apparently not!
> >
> > mysql> SELECT DECODE ( CSV_DATA_ENC_FORENAME, "test_password" ) FROM
> > DATA_TABLE_PID_1_DESC_137;
> 
> Is it so hard to read directions?
> 
> select decode(csv_data_enc_forename) from DATA_TABLE_PID_1_DESC_137;
> 
> This assumes whatever is in that column, was encoded.
> 
> Jeff
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to