Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Handling mutiple rows

by Anonymous Monk
on Sep 09, 2012 at 15:56 UTC ( #992596=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am a beginner in perl.Please help in the following requirement.I am asked to query the database which will return multiple rows..For eg consider the below mentioned table in DB:

company name account month

X E200 Jan

Y E200 Feb

1 E300 Jan

I need to first get the details from the above table where company name not betwee "0" and "9".So this will retreieve first 2 rows.Then i need to process each rows taking company name and querying database again.For eg : X returns 2,4,5 from database.So i need to create a temporary table lik gievn below

company name account month

2 E200 Jan

4 E200 Jan

5 E200 Jan

Y E200 Feb

1 E300 Jan

like that i shud do for company name=Y also..Pleas helpp

Replies are listed 'Best First'.
Re: Handling mutiple rows
by Anonymous Monk on Sep 09, 2012 at 17:06 UTC
Re: Handling mutiple rows
by NetWallah (Abbot) on Sep 09, 2012 at 20:10 UTC
    Welcome to the monastery, Ammu.

    Please see my response to your question looping in a hashtable.
    Thinking about that will help you resolve this issue as well.

                 I hope life isn't a big joke, because I don't get it.
                       -SNL

Re: Handling mutiple rows
by Kenosis (Priest) on Sep 09, 2012 at 19:43 UTC

    I am asked to query the database...

    Do you have a Perl question?

      Do you have a Perl question?

      Sure he does "Please helpp"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://992596]
Approved by chacham
help
Chatterbox?
[Your Mother]: Don't think so.
[Your Mother]: Windows doesn't even recognize them as far as that goes.
[Lady_Aleena]: Your Mother, thanks. I had a feeling it would be no.
[Your Mother]: :P
[Lady_Aleena]: Your Mother, it is a good thing I am no on Windows.
[Lady_Aleena]: s/no/not/;

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2017-04-28 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (519 votes). Check out past polls.