How to insert empty value (not null value) in a MySQL field?

How to insert empty value (not null value) in a MySQL field?

Page 1 of 1

2 Replies - 18234 Views - Last Post: 10 April 2007 - 12:45 AM

#1 spspavan   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-April 07

How to insert empty value (not null value) in a MySQL field?

Posted 05 April 2007 - 12:29 AM

I have a field in MySQL table. I want to insert empty value '' in a field. But by default, MySQL inserts NULL value. Can you suggest how to insert empty value but not NULL value?

Thanks in advance.

Regards,
Pavan.
Is This A Good Question/Topic? 0
  • +

Replies To: How to insert empty value (not null value) in a MySQL field?

#2 spullen   User is offline

  • D.I.C Regular
  • member icon

Reputation: 10
  • View blog
  • Posts: 356
  • Joined: 22-March 07

Re: How to insert empty value (not null value) in a MySQL field?

Posted 05 April 2007 - 07:49 AM

well NULL would work just as well as an empty space, so why would you need to change it? And later on in your program you could find the NULL spaces and put the appropriate value into it.
Was This Post Helpful? 0
  • +
  • -

#3 DilutedImage   User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 646
  • Joined: 20-November 06

Re: How to insert empty value (not null value) in a MySQL field?

Posted 10 April 2007 - 12:45 AM

Add the "NOT NULL" description to it's column type.

2

This post has been edited by DilutedImage: 10 April 2007 - 12:45 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1