If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Question on changing an item

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-15-09, 12:39
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Question on changing an item

Hi folks,


Ran following entry creating a database;
Code:
mysql> INSERT INTO users (id,name,maildir,clear) VALUES
    -> ('xyz@aaa.com','xyz','xyz/', encrypt('password') ),
    -> etc.
    -> etc.
    -> etc.;
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0
Now I need changing "clear" to "crypt"

Please advise how to make such a change. TIA

B.R.
satimis
Reply With Quote
  #2 (permalink)  
Old 05-15-09, 18:06
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-15-09, 20:01
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Quote:
Originally Posted by r937
Hi,

Thanks for your URL.

In my case I suppose using CHANGE on following command;
Code:
mysql> CHANGE 'clear' 'crypt' VALUE;
VALUE is column_definition.

Please correct me if I'm wrong. TIA


B.R.
satimis
Reply With Quote
  #4 (permalink)  
Old 05-15-09, 20:13
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by satimis
Please correct me if I'm wrong.
sorry, i cannot, because now i really don't understand what you're doing
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 05-15-09, 20:25
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Quote:
Originally Posted by r937
sorry, i cannot, because now i really don't understand what you're doing
Hi r937,

What I expect to do is changing the name "clear" to "encryt" on that column running;

mysql> USE maildb;

mysql> CHANGE 'clear' 'crypt' VALUE;


Thanks

B.R.
satimis
Reply With Quote
  #6 (permalink)  
Old 05-16-09, 00:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by satimis
What I expect to do is changing the name "clear" to "encryt" on that column running;
in that case, you want to take another look at the ALTER TABLE syntax

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On