|
Posted by Tony Peardon on 10/13/51 11:39
Its simple, really. I've got a table called name which holds, you guessed
it, names. The fields are prefix, first, middle, last, and suffix. Only a
persons first name need be included, as all other fields can be null, but I
don't want them to be null by default. I want them set to an empty string by
default instead. Null will be used to signify that a person does not have
part of the name, while the empty string will signify only that the database
doesn't yet know the information. I know this is easy, but I'm doing
something wrong. Could someone please clear this up for me.
Here's a line of relevant code...
alter table name add column suffix varchar(5) null default('');
so what is the matter with that?
also, assuming that suffix already exists within table name, what would the
sql be to just add a default to it?
Navigation:
[Reply to this message]
|