Hi Igor,
 
update vpn set password = AES_ENCRYPT((select password from vpn) , 
"abcdffffdsfddafdasfddasd").

Basically, I want to encrypt the password in vpn table so the passwords in this 
table are different. Above mysql statement still didn't work. Any idea.
Thanks,
JP



________________________________
From: Igor Tandetnik <itandet...@mvps.org>
To: sqlite-users@sqlite.org
Sent: Wednesday, October 19, 2011 3:58 PM
Subject: Re: [sqlite] sql statement to update the data in the table

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
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to