After working through a number of typos, I am getting closer. I agree, however, that the command works perfectly in MySQL. The issue is translating it to a DBI command. For my test, the MySQL command returns:

mysql> show columns in cmsParms; +--------+-----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+-----------+------+-----+---------+-------+ | pKey | char(100) | NO | PRI | NULL | | | pValue | text | NO | | NULL | | +--------+-----------+------+-----+---------+-------+ 2 rows in set (0.00 sec)

From inside my code:

my $rval = 'rval (' . $table . ')'; my $sth2 = $dbh->prepare("SHOW COLUMNS IN $table where Field=?") or die 'prepare failed'; $sth2->execute( $field ) or die 'execute failed'; if ( $sth2->err ) { $rval .= 'error: [' . $sth2->errmsg . ']'; } else { $rval .= '(' . $sth2->rows . ')'; my ($arr, @arr, %arr, $field); while ( $arr = $sth2->fetchrow_hashref ) { foreach $field ( keys %{ $arr } ) { $rval .= "[".$field.":".$arr->{ $field }."]"; } } } return($rval);

What now is returned ($rval) is:

[rval (cmsParms)(1)[Extra:][Type:char(100)][Field:pKey][Default:][Null +:NO][Key:PRI]]

This is exactly what I expected! Changes I made:

Thanks for your help!

Lee Crites
lee@critesclan.com

In reply to Re^5: Replacement for/working version of CGI::App::Plugin::BREAD ??? by lee_crites
in thread Replacement for/working version of CGI::App::Plugin::BREAD ??? by lee_crites

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.