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 > About MySQL command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-08, 05:49
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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 06:11.
Reply With Quote
  #2 (permalink)  
Old 12-07-08, 07:20
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Last edited by r937; 12-07-08 at 07:27.
Reply With Quote
  #3 (permalink)  
Old 12-07-08, 07:59
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #4 (permalink)  
Old 12-07-08, 08:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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?)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 12-07-08, 08:24
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
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