On 10/19/2011 6:34 PM, Joanne Pham wrote:
Curently I had the table with the plain text and I want to  encrypt these 
passwords by using the following sql statement but I got the error mesages.. 
Any suggestion?
update vpn set password = AES_ENCRYPT(select password from mytable, 
"abcdffffdsfddafdasfddasd").

Do you want vpn.password set to the same value in all rows? I would have expected a WHERE clause on the select statement that somehow correlates mytable with vpn.

Anyway, the immediate cause of the syntax errors is the fact that a subselect needs to be enclosed in parentheses:

update vpn set password = AES_ENCRYPT((select password from mytable), "abcdffffdsfddafdasfddasd");

--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to