Character field default

aotte

Member³
Just wondering whether forgetful, and above all lazy, developers could get some extra help in the table editor...

I tend to forget the single quotes around a default in the table editor, which leads to a "Column not allowed" error.

E.g.

Code:
ALTER TABLE tbl ADD new_clmn CHAR(1) DFEAULT N
Can we add a feature that checks if the default value for character fields is enclosed in quotes, if not, add the quotes. If not, and there are quotes in the default value, double those quotes up for proper inclusion.

E.g.
  • N would become 'N'
  • 'N would become '''N'
 
It's not as straightforward as it seems, because the default expression can be any sql expression (e.g. upper('n')). I have added this to the list of enhancement requests though.
 
Ah, Arnoud didn't think about that... :o

Maybe something along the lines of, as long as it doesn't contain any of the defined keywords, then do the trick, otherwise leave it alone.

No biggie, as I said, it is more to aid the ease of laziness.... :D
 
Back
Top