Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: dbi retieve single col value

by pjotrik (Friar)
on Aug 28, 2008 at 11:07 UTC ( [id://707443]=note: print w/replies, xml ) Need Help??


in reply to dbi retieve single col value

To select every value of tax_id only once, use
SELECT DISTINCT tax_id FROM gene2acc WHERE genomic_ac_ver = ?
or
SELECT tax_id FROM gene2acc WHERE genomic_ac_ver = ? GROUP BY tax_id

Replies are listed 'Best First'.
Re^2: dbi retieve single col value
by Anonymous Monk on Aug 28, 2008 at 13:03 UTC
    Hi thanks I tried this way,it still does not enter the while loop to print the statement:print "Entering taxID_format with $t\n";
    LOOP:foreach $ref(@ref) { print "in foreach loop with $ref\n"; $count=0; $command1 = qq{select distinct tax_id from gene2acc where genomic_ac +_ver= '$ref'; }; $sth1=$dbh->prepare($command1); $sth1->execute() or die $sth1->errstr; my($tax_id); $sth1->bind_columns(undef,\$tax_id ); while($sth1->fetch()) { $t=$tax_id; print "Entering taxID_format with $t\n"; #&taxID_format($t); }
    please help me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found