Zero length string as default value?

Problems, tips, hints - all about usage.

Zero length string as default value?

Postby marshallarts » Wed Jun 21, 2017 1:13 am

Apologies if this has been answered already - I did search but could not find anything.

Is there a way to set a zero-length string as the default value for a VARCHAR column? I know I can check for both NULL and empty strings in my application code, but it would be nice to be able to force consistency so I don't need the double check. I can't see a way to do this through the column editing dialog.
marshallarts
 
Posts: 1
Joined: Wed Jun 21, 2017 1:09 am

Re: Zero length string as default value?

Postby Googie » Tue Jun 27, 2017 8:29 am

Edit column, enable "Default value" from constraint list and click configure for it -> there put: '' (two single quote characters = empty string).
Googie
Site Admin
 
Posts: 780
Joined: Wed Jul 27, 2011 8:04 pm


Return to Usage

Who is online

Users browsing this forum: No registered users and 1 guest

cron