The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> IBM/Rational Robot

Pages: 1
garla
Member


Reged: 12/18/07
Posts: 34
regarding the row count,
      #450674 - 01/21/08 08:36 AM

hi all,
can anyone help me out how to get the row count in a datapool.i want to use the for loop so i want to use the row count as the end of the loop.

any code help please

thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
507073
Junior Member


Reged: 08/27/04
Posts: 161
Loc: Rochester, NY
Re: regarding the row count, [Re: garla]
      #450983 - 01/22/08 06:50 AM

garla,
try something like this.
Note that it compiles but I didn't test it.

Code:
 Function rowcount(Datapoolname as String) as Integer
Dim Count as Integer
Dim Status as Integer
Dim DatapoolID as Integer

Status = SQADatapoolOpen(Datapoolname, nsequence:= SQA_DP_SEQUENTIAL, bExclusive:= True)

If Status < 0 then 'If DataPoolOpen fails return the negative number thats associated with the error
rowcount = Status
exit function
End If


DatapoolID = Status
Status = SQADatapoolFetch (DatapoolID)
While Status <> sqaDpEOF
Count = Count +1
Status = SQADatapoolFetch (DatapoolID)
Wend

SQADatapoolClose DatapoolID
rowcount = Count

End Function

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
garla
Member


Reged: 12/18/07
Posts: 34
Re: regarding the row count, [Re: 507073]
      #451311 - 01/23/08 03:25 AM

it complies but when u run it it shows an error that some datsore not found.
one more question mate,if i run the row count for a datapool with the code u have written ie the code below,
While Status <> sqaDpEOF
Count = Count +1
Status = SQADatapoolFetch (DatapoolID)
Wend
the loop goes to infinity like 1500 some thing but i want the Rowcount for only the datapool rows which are filled with data.as iam new facing all lots of problems.please help me out.
thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
RKY
stranger


Reged: 08/22/06
Posts: 596
Loc: Hyderabad, India
Re: regarding the row count, [Re: garla]
      #451316 - 01/23/08 03:37 AM


Cant we use Excel for this?

--------------------

Hope this helps you,


- RKY


Post Extras: Print Post   Remind Me!   Notify Moderator  
garla
Member


Reged: 12/18/07
Posts: 34
Re: regarding the row count, [Re: RKY]
      #451353 - 01/23/08 05:04 AM

ram,
i think u r genius but dont make others look stupid please.what is the question over there and what have u suggested. thats not the answer ok.
thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
507073
Junior Member


Reged: 08/27/04
Posts: 161
Loc: Rochester, NY
Re: regarding the row count, [Re: garla]
      #451355 - 01/23/08 05:15 AM

garla,
if it can't find the datapool then I'd guess either you gave it the wrong name or its locked. The function expects that the datapool is not already open.

The loop should run the correct number of times if the datapool is opened with the defaults of wrap = false and with sequence = SQA_DP_SEQUENTIAL.
If you have opened the datapool with wrap set to True or with sequence = SQA_DP_RANDOM then it would run forever because it will never return sqaDpEOF.In that case it just goes back to the start.

If your datapool has rows with no data in them you would have to add a test to stop counting when an empty row is found instead.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
garla
Member


Reged: 12/18/07
Posts: 34
Re: regarding the row count, [Re: 507073]
      #451365 - 01/23/08 05:38 AM

hi,
thanks for the answer,
If the datapool has rows with no data in them can u please give me a code help on how to row count till an empty row is found.
thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
507073
Junior Member


Reged: 08/27/04
Posts: 161
Loc: Rochester, NY
Re: regarding the row count, [Re: garla]
      #451394 - 01/23/08 06:44 AM

garla,
I can't give you that since it requires me to know the format and syntax of your data.
Aside from that, I doubt it is the problem.
When you open your datapool you should only see one blank line at the bottom.
If you see thousands of blank lines I'd suggest you delete them. It's sure to cause other problems as well.

Have you run the function before opening your datapool yet?

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
RKY
stranger


Reged: 08/22/06
Posts: 596
Loc: Hyderabad, India
Re: regarding the row count, [Re: garla]
      #451674 - 01/23/08 08:31 PM

Quote:

ram,
i think u r genius but dont make others look stupid please.what is the question over there and what have u suggested. thats not the answer ok.
thanks




garla,
What i was suggessted as one more way, it doesnt mean that it will not make sense of others. Here no one is genious . Every one here to throw their own thoughts and ideas. It is up to you where you have taken or not. Dont try to be too smart.

--------------------

Hope this helps you,


- RKY


Post Extras: Print Post   Remind Me!   Notify Moderator  
garla
Member


Reged: 12/18/07
Posts: 34
Re: regarding the row count, [Re: RKY]
      #453237 - 01/29/08 07:02 AM

ram,
do u have any solution for on how to get the row count for the datapool.
thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
mirfan
Newbie


Reged: 01/13/09
Posts: 7
Re: regarding the row count, [Re: garla]
      #579903 - 07/14/09 11:38 PM

I think you can use this, instead of FOR LOOP:

dp_id = SQADatapoolOpen ("DATAPOOLNAME", False, SQA_DP_SEQUENTIAL, False)

while Not SQADatapoolFetch(dp_id)= sqaDpEOF

it will run untill end of datapool

regards
m-irfan


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  AJ, RSBarber 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2741

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5