Page 1 of 1

default value enclosure

PostPosted: Mon May 06, 2013 10:34 am
by joselitux
Hi

When creating a new VARCHAR column with a default value, the persist script doesn't enclose the default value in quotes, raising an error.

Example

ALTER TABLE MyTable ADD myField VARCHAR(255) NOT NULL DEFAULT some words;

Would be very useful to check if default value is quoted, and if it's not, then quote it.

thanks

Re: default value enclosure

PostPosted: Mon May 06, 2013 11:30 am
by Serge
Hello,

It is not a bug, it works as designed ( viewtopic.php?f=2&t=905&p=1905 )
It is not possible to add quotes automatically because default value may be quite sophisticated and database dependent.
E.g. it can be come constant, function, other column name, expression, etc.
So if you need string literal as default value you should add quotes manually.

Thanks