default field values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ike

    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


  • Ike

    #2
    Re: default field values


    "Ike" <rxv@hotmail.co m> wrote in message
    news:XFbkg.1319 6$921.2652@news read4.news.pas. earthlink.net.. .[color=blue]
    >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
    >[/color]

    "Describe " + tablename
    ....will give a resultset with this information //Ike


    Comment

    • Rich Ryan

      #3
      Re: default field values


      "Ike" <rxv@hotmail.co m> wrote in message
      news:XFbkg.1319 6$921.2652@news read4.news.pas. earthlink.net.. .[color=blue]
      > I am trying to devise a procedure to delete rows wherein all the fields[/color]
      have[color=blue]
      > been set to their default values (either null, or in the case of a not[/color]
      null[color=blue]
      > 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
      >
      >[/color]

      The function: DEFAULT(col_nam e) 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


      Comment

      Working...