metaperl has asked for the wisdom of the Perl Monks concerning the following question:
I have some
source code which makes a DBI call:
The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.
The trace of the call "works" - it returns an array of hashrefs of the data from the query. However, part of the DBI trace has me concerned. It claims something about an error that is cleared by call to fetch method:#!/usr/bin/env perl use strict; use warnings; # core modules use Data::Dumper; use File::Basename 'dirname'; use File::Spec; use List::Util qw(sum); # cpan modules use Mojolicious::Lite; use autodie qw/:all/; use DBI; #DBI->trace(1); use SQL::Interp qw/:all/; use Sys::Hostname; # local modules use lib join '/', File::Spec->splitdir( dirname(__FILE__) ), '..', 'li +b'; use Local::DB; use Local::Bitcoin; my $bitcoin = Local::Bitcoin->new; my $da = Local::DB->new->da; DBI->trace(1); my @m = $da->sqlarrayhash('SELECT * FROM v_missing_pledges');
The sqlarrayhash method I am calling is fairly straightforward - it just prepares a SQL call with bind parameters. I would appreciate some insight into why the trace hasschemelab@li2-168:~/domains/com/elcaminoclaro/www/cleartrader/bin$ ./r +eceived_pledges.pl DBI 1.616-ithread default trace level set to 0x0/1 (pid 31485 pi 9 +52e008) at received_pledges.pl line 28 <- prepare('SELECT * FROM v_missing_pledges')= ( DBI::st=HASH(0xa8 +17544) ) [1 items] at Array.pm line 270 <- execute= ( 1 ) [1 items] at Array.pm line 288 <- FETCH('NAME')= ( [ 'pledger_id' 'sponsor_id' 'address' ] ) [1 i +tems] at Array.pm line 500 !! ERROR: 2000 CLEARED by call to fetch method <- fetchrow_hashref= ( HASH(0xa817904)3keys ) [1 items] row1 at Ar +ray.pm line 503 !! ERROR: 2000 CLEARED by call to fetch method <- fetchrow_hashref= ( undef ) [1 items] row1 at Array.pm line 504 <- finish= ( 1 ) [1 items] at Array.pm line 507
in it and what that means, because everything seems to be working just fine.!! ERROR: 2000 CLEARED by call to fetch method
The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBI - !! ERROR: 2000 CLEARED by call to fetch method
by mje (Curate) on Nov 15, 2011 at 08:58 UTC | |
Re: DBI - !! ERROR: 2000 CLEARED by call to fetch method
by Anonymous Monk on Nov 15, 2011 at 08:40 UTC | |
Re: DBI - !! ERROR: 2000 CLEARED by call to fetch method
by metaperl (Curate) on Nov 15, 2011 at 21:12 UTC | |
by Anonymous Monk on Nov 15, 2011 at 22:51 UTC |
Back to
Seekers of Perl Wisdom