Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    63

    Unanswered: 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

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2006
    Posts
    63
    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

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2006
    Posts
    63
    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

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •