mason-users

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [Mason] DBI wierdness Hans Dieter Pearcey Tue Jun 16 13:01:38 2009

On Tue, Jun 16, 2009 at 03:39:57PM -0400, MK wrote:
> I don't believe that will help at all -- there's too much irrelevent 
> detail, and then there are multiple components within the component.  
> Do you want to read thru my entire app?  

Why not?  I'd rather have more context available than less -- none of us are
Sherlock Holmes, and if we can guess at the solution based on tiny bits of
information, that's as likely to be luck as anything else.
 
> > You also didn't say exactly what SQL you *did* end up running, just
> > "nothing"
> > and "didn't work".  Precision would help here.
> 
> This statement makes *absolutely* no sense to me.  Are you asking what 
> flavour of SQL?

No, I was asking about the literal SQL string that ends up being passed to DBI
(after all variables have been interpolated).  Sherrard Burton's post elsewhere
in this thread is an example.
 
> Here's another bizarre thing:
> 
> error:  Can't call method "execute" on an undefined value at /
> var/www/html/mason/site.pm line 12.
> context:      
> ...   
> 8:    
> 9:    sub subj_list {
> 10:   my $db = shift;
> 11:   my $sql = $db->prepare("select * from subjects");
> 12:   return;
> 13:   $sql->execute;
> 
> This is because the database is empty

Only if by "empty" you mean that it has no table "subjects" (as opposed to "it
has no rows").  In any case, as Sherrard pointed out, you're ignoring errors
from your database, so all kinds of surprising behaviors may arise.

> sub subj_list {
>         my $db = shift;
>         my $sql = $db->prepare("select * from subjects") || die;
>         return; 
>         $sql->execute;
> 
> And it continues to produce the same error.  While I'm not an expert 
> with perl, I'm kind of use to my functions "returning" at a "return" 
> statement...

Are you possibly running with static_source turned on?  It sounds like your
webserver is using a cached version of the code or something.

hdp.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mason-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mason-users