Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: DBD: bind_column behviour with multiple "unnamed" columns

by gmax (Abbot)
on Aug 06, 2004 at 13:36 UTC ( #380530=note: print w/ replies, xml ) Need Help??


in reply to DBD: bind_column behviour with multiple "unnamed" columns

I was not able to replicate the behavior you describe. I don't have MS-SQL server, but I tried your code on a MySQL ad a SQLite table, and it works as advertised, i.e. the data comes as I expect and the field names in $sth->{NAME} contain exactly what I put in my select statement, with or without alias.

I can confirm you that fetch is actually fetching an arrayref, as you can see by yourself if you set a line with DBI->trace(4); before your loop. In my test, I get something like this:

fetch for DBD::SQLite::st fetch= [ 'xx' 'yy' 'zz' ] row1 at test_bind.pl line 24

The DBI docs give:

 "fetchrow_arrayref"
       $ary_ref = $sth->fetchrow_arrayref;
       $ary_ref = $sth->fetch;    # alias

My guess is that your DBD driver is not playing according to DBI rules.

 _  _ _  _  
(_|| | |(_|><
 _|   


Comment on Re: DBD: bind_column behviour with multiple "unnamed" columns
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://380530]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-07-02 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (30 votes), past polls