List:General Discussion« Previous MessageNext Message »
From:James Manning Date:September 17 1999 1:39am
Subject:Re: How to delete a member from a SET column
View as plain text  
[ Thursday, September 16, 1999 ] Martin Ramsch wrote:
> On Thu, 1999-09-16 16:08:13 -0400, James Manning wrote:
> > [ Thursday, September 16, 1999 ] Martin Ramsch wrote:
> > > # Get (reference to) the result row.
> > > my $row = $sth->fetchrow_arrayref;
> > > 
> > > # Extract the 'Type' field (it's the 2nd one!).
> > > my $type = $row->[1];
> > 
> > I'm curious... doesn't this potentially break if the describe format
> > ever changed?
> 
> You're definitely right.
> 
> > why wouldn't you fetchrow_hashref (or whatever it's called) and
> > ->{'Type'} ?
> 
> In 1st place, just because I didn't think of it, stupid me.  In 2nd
> place (now I did have a look at it), because this only seems to give
> my a type identifier, but no textual representation of the actual SET
> definition ...  So I don't see a real, more portable alternative to my
> first approach using DESCRIBE, do you?

Hunh?  If this is true, I think you might have found a bug
somewhere... running your exact script, all I had to do was change
fetchrow_arrayref to fetchrow_hashref and $row->[1] to $row->{'Type'}
and I got the exact same output... adding in a foreach to loop on all
the keys, I get:

Key ->
Type -> set('a','b','c')
Null -> YES
Extra ->
Field -> setfield
Default ->

mysql> desc settable;
+----------+------------------+------+-----+---------+-------+
| Field    | Type             | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| setfield | set('a','b','c') | YES  |     | NULL    |       |
+----------+------------------+------+-----+---------+-------+

That output from the 'Type' entry looks to be the same as
the textual set description from the array's [1] *shrug*

James
-- 
Miscellaneous Engineer --- IBM Netfinity Performance Development
Thread
How to delete a member from a SET columnBenjamin Pflugmann7 Jul
  • Re: How to delete a member from a SET columnMartin Ramsch15 Sep
    • Re: How to delete a member from a SET columnJames Manning15 Sep
      • Re: How to delete a member from a SET columnMartin Ramsch16 Sep
        • Re: How to delete a member from a SET columnMartin Ramsch16 Sep
          • Re: How to delete a member from a SET columnJames Manning17 Sep
            • Re: How to delete a member from a SET columnMartin Ramsch17 Sep
              • Re: How to delete a member from a SET columnJames Manning17 Sep
                • Re: How to delete a member from a SET columnMartin Ramsch17 Sep
                  • placeholdersjice17 Sep
                    • Re: placeholdersBob Kline17 Sep
                  • Re: How to delete a member from a SET columnJames Manning17 Sep
        • Re: How to delete a member from a SET columnJames Manning17 Sep
          • Re: How to delete a member from a SET columnMartin Ramsch17 Sep