On Thu, Mar 13, 2003 at 01:09:25AM -0500, Jeff Urlwin wrote:
> > 
> > 
> > Yes. You're right that NAME_uc/NAME_lc and their *_hash 
> > variants need to be cleared from the cache. May actually be 
> > good to work the other way round... delete all cached 
> > attributes except a specific set.
> 
> [Michael, I thought this might be interesting to you, if you haven't done
> this already]
> 
> Here's what I've done, but it looks pretty ugly to me.  I would have thought
> it would be simpler.  Cced dbi-dev as I thought others doing multiple result
> sets might be interested in this.  Basically, I wanted to use dbih_inner(),
> but it's unavailable as it's a DBI static function.  

There are other ways to get the inner handle, but they are very
rarely needed as the DBI arranges for all driver methods to be
invoked *on* the inner handle. So how come you're not just using
that handle you were called on?

Tim.


> > > I'm looking into it.  I clear out all the NAME attributes, 
> > but must be 
> > > missing the cache from the NAME_uc or NAME_lc.
> > > 
> > > Jeff
> > > 
> > > > 
> > > > Jeff,
> > > > 
> > > > On your script, if you change the fetchrow_hashref to 
> > > > fetchrow_hasref{'NAME_lc'} or fetchrow_hasref{'NAME_uc'} it fails 
> > > > just like mine.
> > > > 
> > > > if you run with no argument or just NAME, it works fine.
> > > > 
> > > > Cheers.
> > > > Iso
> > > > 
> > > > -----Original Message-----
> > > > From: Jeff Urlwin [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, March 10, 2003 8:53 AM
> > > > To: Ismail Mutlu; [EMAIL PROTECTED]
> > > > Subject: RE: Multiple Select statements in an SP and 
> > > > fetchrow_hashref
> > > > 
> > > > 
> > > > Try the attached file and let me know how it runs.  Set 
> > > > DBI_DSN,DBI_USER and DBI_PASS environment variables first.
> > > > 
> > > > If this doesn't produce good output, then:
> > > >         a) upgrade your SQLServer driver (MDAC 2.7).  My SQL 
> > Server driver 
> > > > is 200.81.9030.04
> > > >         b) compare this script to what you are doing and see if
> > > > you can make mine break.
> > > > 
> > > > Jeff
> > > > 
> > > > > -----Original Message-----
> > > > > From: Ismail Mutlu [mailto:[EMAIL PROTECTED]
> > > > > Sent: Monday, March 10, 2003 11:23 AM
> > > > > To: Jeff Urlwin; [EMAIL PROTECTED]
> > > > > Subject: RE: Multiple Select statements in an SP and
> > > > fetchrow_hashref
> > > > > 
> > > > > 
> > > > > Jeff,
> > > > > I have DBI 1.34 and DBD::ODBC 1.04 installed.
> > > > > 
> > > > > Thanks.
> > > > > Iso
> > > > > 
> > > > > -----Original Message-----
> > > > > From: Jeff Urlwin [mailto:[EMAIL PROTECTED]
> > > > > Sent: Saturday, March 08, 2003 3:28 AM
> > > > > To: Ismail Mutlu; [EMAIL PROTECTED]
> > > > > Subject: RE: Multiple Select statements in an SP and
> > > > fetchrow_hashref
> > > > > 
> > > > > 
> > > > > > 
> > > > > > Hello list,
> > > > > > 
> > > > > > I am using DBD::ODBC against SQL 2000 server. In my 
> > script I am 
> > > > > > executing a Stored Procedure which has two select statements 
> > > > > > selecting from two different tables. I am looping through to 
> > > > > > grep the output of the SP using fetchrow_hashref, each time I
> > > > get a row I
> > > > > > print the keys and the values of the hash. The  first hash 
> > > > > > prints fine(with the column names from the first table) , but 
> > > > > > the second one inherits the hash keys from the first one(the 
> > > > > > values
> > > > are correct
> > > > > > tough). I tried 'undef'ing the hashref and the hash but
> > > > still wont
> > > > > > work. Here is my code:
> > > > > > 
> > > > > > 
> > > > > 
> > > > > What version of DBD::ODBC are you using?  If you are *not* using
> > > > > 1.04 and DBI 1.32, stop and get them.  I believe these 
> > issues have 
> > > > > been found and fixed.
> > > > > 
> > > > > Regards,
> > > > > 
> > > > > Jeff
> > > > > 
> > > > > > 
> > > > > > -------------------------------------CODE---------------------
> > > > > > ------------------------------------------
> > > > > > $sth1->execute();
> > > > > > while ( $sth1->{Active}) {
> > > > > >    do {
> > > > > >       my $rowRef;
> > > > > >       for (my $rowRef ;$rowRef=
> > > > $sth1->fetchrow_hashref('NAME_lc');
> > > > > > )  {
> > > > > >           my %outputData = %$rowRef;      undef $rowRef;
> > > > > >           print 'outputData ', Dumper(\%outputData), "\n";
> > > > > >           undef %outputData;
> > > > > >       }
> > > > > >    } while ($sth1->{odbc_more_results});
> > > > > > }
> > > > > > --------------------------------------------------------------
> > > > > > ------------------------------------------
> > > > > > It gives me:
> > > > > > 
> > > > > > --------------------------------OUTPUT------------------------
> > > > > > -----------------------------------
> > > > > > outputData $VAR1 = {
> > > > > >           'address' => 'My Address',
> > > > > >           'acctnumber' => '321'
> > > > > >         };
> > > > > > 
> > > > > > outputData $VAR1 = {
> > > > > >           '' => 'iso       ',
> > > > > >           'address' => '123',
> > > > > >           'acctnumber' => '123'
> > > > > >         };
> > > > > > --------------------------------------------------------------
> > > > > > ------------------------------------------
> > > > > > Output for the first select is correct, but the second
> > > > one shold be:
> > > > > > outputData $VAR1 = {
> > > > > >           'name' => 'iso       ',
> > > > > >           'Number' => '123',
> > > > > >           'acctnumber' => '123'
> > > > > >         };
> > > > > > 
> > > > > > If I run the following, the out put is correct:
> > > > > > -------------------------------------CODE---------------------
> > > > > > ------------------------------------------
> > > > > > $sth1->execute();
> > > > > > while ( $sth1->{Active}) {
> > > > > >    do {
> > > > > >       my $rowRef;
> > > > > >       while (my $p = $sth1->fetchrow_hashref()) {
> > > > > >          print "new select \n";
> > > > > >          while (my ($key, $value) = each %$p) {
> > > > > >          print "\t $key : $value\n";
> > > > > >     }
> > > > > >     print "\n\n";
> > > > > >    } while ($sth1->{odbc_more_results});
> > > > > > }
> > > > > > ------------------------------------------------------------
> > > > > > 
> > > > > > 
> > > > > > Any Ideas,
> > > > > > 
> > > > > > Cheers!.
> > > > > > Iso
> > > > > > _______________________________________________
> > > > > > Perl-Win32-Database mailing list 
> > > > > > [EMAIL PROTECTED]
> > > > > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 
> > 
> 
> 
> 

Reply via email to