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

    Unanswered: About MySQL command

    Hi folks,


    mysql version
    Ver 14.12 Distrib 5.0.32


    I ran following command creating a table:-


    Code:
    mysql> CREATE TABLE `tblPerdition` (
         -> `user` varchar(128),
         -> `servername` varchar(255) default '',
         -> `port` varchar(8) NULL default 'NULL', 
        -> PRIMARY KEY (`user`) 
        -> ); 
    Query OK, 0 rows affected (0.00 sec)

    Code:
    mysql> DESCRIBE tblPerdition;
    +------------+--------------+------+-----+---------+-------+
    | Field      | Type         | Null | Key | Default | Extra |
    +------------+--------------+------+-----+---------+-------+
    | user       | varchar(128) | NO   | PRI |         |       |
    | servername | varchar(255) | YES  |     |         |       |
    | port       | varchar(8)   | YES  |     | NULL    |       |
    +------------+--------------+------+-----+---------+-------+
    3 rows in set (0.00 sec)

    I can't figure out how to made Null columns of 'user' blank (without NO)
    and 'servername' blank (without YES)


    Please help. TIA


    B.R.
    satimis
    Last edited by satimis; 12-07-08 at 07:11.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you cannot make them "blank"

    a column is either NULL or NOT NULL, and in a DESCRIBE, this always shows as YES or NO for NULL
    Last edited by r937; 12-07-08 at 08:27.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2006
    Posts
    63
    Quote Originally Posted by r937
    you cannot make them "blank"

    a column is either NULL or NOT NULL, and in a DESCRIBE, this always shows as YES or NO for NULL
    Hi r937,


    Thanks for your advice.


    Whether NULL field can't be blank?


    I'm following "MySQL" on following thread;
    http://www.vergenet.net/linux/perdit...tiondb.5.shtml

    to create this table.


    B.R.
    satimis

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ah, i see

    well, you're fine if it says NO under NULL instead of blank

    i have no idea why that example shows blanks there (maybe from a very early edition of mysql?)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2006
    Posts
    63
    Quote Originally Posted by r937
    ah, i see

    well, you're fine if it says NO under NULL instead of blank

    i have no idea why that example shows blanks there (maybe from a very early edition of mysql?)
    Hi r937,


    Thanks


    satimis

Posting Permissions

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