Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
leocrawf
Posts: 47
Registered: ‎06-06-2011
My Device: bolt2
My Carrier: digicel jamaica

Retrieve one value from a result set

Hi you all,

 

I have been working on a app that uses local database. After I get the data I would love to get one one value from the record set without having to loop.

 

If the result set only returned one value I could call the value using this for example:

 

rs.rows.item(0).subcategory_name

 

 

However if the record set has more than one value or rows this would not work. Is there a way I could just call a value without having to loop like how in php we do this $row['some_row_name']; and we get the first result from the result set?

Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Retrieve one value from a result set

Hi leocrawf,

 

Why wouldn't your code work when there are multiple items in the resultRowSet? As long as there is atleast 1 item, there will be a 0th item.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.