in reply to Replacement for/working version of CGI::App::Plugin::BREAD ???
I realize this might be considered a "new topic," and as such, should be its own entry, but since I am working through the task described in the initial message, I thought it would be good to at least start this message here.
So... while plugging away at my own solution, I have found an issue with trying to execute either a "DESCRIBE $table" or "SHOW COLUMNS FROM $table" command. Here is an extracted snippet of code:
my $rval = ''; my $sth2 = $dbh->prepare("SHOW COLUMNS FROM $table"); $sth2->execute() or die 'execute failed'; if ( $sth2->err ) { $rval = 'error: [' . $sth2->errstr . ']'; } else { # the "while" line is #151 from the error message... while ( my @arr = $sth2->fetchrow_arrayref() ) { $rval .= '[' . join('|', @arr ) . ']'; } }
At this point, I am simply trying to gather ANYTHING from the command, so, yes, $rval will not have anything truly meaningful in this example.
What I am getting is an unending stream of:
[Tue Jun 18 10:48:43 2013] [error] [client 10.22.50.24] DBD::mysql::st fetchrow_arrayref failed: fetch() without execute() at /var/www/cgi-bin/CaMS2/TableEdit.pm line 151., referer: http://10.22.50.14/CaMS2/index.cgiI don't need to know how to get a list of column names -- I already have that working. I want "the rest of the story" -- the Type, Null, and Default columns for sure.
mysql> show columns from cmsParms; +--------+-----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+-----------+------+-----+---------+-------+ | pKey | char(100) | NO | PRI | NULL | | | pValue | text | NO | | NULL | | +--------+-----------+------+-----+---------+-------+ 2 rows in set (0.01 sec)
So that's my current issue. I'm currently hacking at it. When I get a solution, I'll post it here. If, however, anyone has already crossed this bridge, and can toss me some hints/tips/tricks/etc, I would greatly appreciate it!!!
Lee Crites
lee@critesclan.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacement for/working version of CGI::App::Plugin::BREAD ???
by poj (Abbot) on Jun 18, 2013 at 16:44 UTC | |
by lee_crites (Scribe) on Jun 18, 2013 at 17:21 UTC | |
by Corion (Patriarch) on Jun 18, 2013 at 18:11 UTC | |
by poj (Abbot) on Jun 18, 2013 at 17:39 UTC | |
by lee_crites (Scribe) on Jun 18, 2013 at 18:33 UTC |