Jump to content

How "Alter" work on changing the type of Null ?


terenceyuen

Recommended Posts

I would like to change the type of Null to NO,what is the command for this?

I've tried this one, but no luck to get it work.

ALTER TABLE claims_summary ALTER COLUMN advance_call_details SET NOT NULL;

 

+----------------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------------+--------------+------+-----+---------+-------+

| client_id | int(11) | | | 0 | |

| client_code | varchar(30) | | PRI | | |

| club_id | int(11) | | | 0 | |

| club_code | varchar(30) | | PRI | | |

| yearclaim | int(10) | | PRI | 0 | |

| advance_call | double(16,4) | YES | | 0.0000 | |

| additional_call | double(16,4) | YES | | 0.0000 | |

| supplementary_call | double(16,4) | YES | | 0.0000 | |

| release_call | double(16,4) | YES | | 0.0000 | |

| advance_call_details | varchar(240) | YES | | | |

+----------------------+--------------+------+-----+---------+-------+

Link to comment
Share on other sites

ALTER COLUMN is used only to modify the default value of a column.

 

The entire column definition is required to update the NULL/NOT NULL value of a column, as follows:

 

ALTER TABLE MODIFY advance_call_details varchar(240) NOT NULL DEFAULT 'undefined' COMMENT 'advances call details'

 

 

Sorry, can you explain the purpose from the beginning 'undefined' COMMENT 'advances call details' I don't really understand.

PS: I'm using Mysql 3.xx

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.