default field values
am 15.06.2006 13:39:35 von Ike
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
am 15.06.2006 14:16:34 von Ike
"Ike" wrote in message
news:XFbkg.13196$921.2652@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
am 16.06.2006 20:02:04 von Rich R
"Ike" wrote in message
news:XFbkg.13196$921.2652@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