default field values
I am trying to devise a procedure to delete rows wherein all the fields have
been set to their default values (either null, or in the case of a not null
default value for a row, that default value). Is there a means in MySQL
which allows me to obtain what the defaults are for all fields in a table?
Thanks, Ike
Re: default field values
"Ike" <rxv [at] hotmail.com> wrote in message
news:XFbkg.13196$921.2652 [at] newsread4.news.pas.earthlink.net.. .
>I am trying to devise a procedure to delete rows wherein all the fields
>have been set to their default values (either null, or in the case of a not
>null default value for a row, that default value). Is there a means in
>MySQL which allows me to obtain what the defaults are for all fields in a
>table? Thanks, Ike
>
"Describe " + tablename
....will give a resultset with this information //Ike
Re: default field values
"Ike" <rxv [at] hotmail.com> wrote in message
news:XFbkg.13196$921.2652 [at] newsread4.news.pas.earthlink.net.. .
> I am trying to devise a procedure to delete rows wherein all the fields
have
> been set to their default values (either null, or in the case of a not
null
> default value for a row, that default value). Is there a means in MySQL
> which allows me to obtain what the defaults are for all fields in a table?
> Thanks, Ike
>
>
The function: DEFAULT(col_name) returns the default value.However, what if
the value was set by the app or by the user and it just happens to be the
same as the default value? Do you really want to delete it?
Rich