Javascript Loop Issue

Using NodeJS.oracle, hence the use of javascript for my loop, but can't use jquery....
I have a record set from an Oracle query that returns twenty columns, one of which is "ticket".
I need to loop thru the results, and for every 30 records, push the value of "ticket" into a separate array. So I would end up with:
ticketArray1 = '1', '2', '3', ...... '30'
ticketArray2 = '31', '32', '33' ..... '60'
ticketArray3......

so I loop thru the query results and pus the results into a mainArray, that works fine

then I need to loop thru the mianArray and populate the ticket arrays. I can figure out how to get the value from the first 30 but I'm lost on getting values thereafter and populating separate arrays.
Thanks in advance for any assistance.
kevbob650Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phil PhillipsDevOps ArchitectCommented:
I think I know what you're getting at, but I'm not 100% sure.  Could you post what you have so far for the first 30?  I should be able to build off of that.
0
Tom BeckCommented:
Here's a fiddle that divides an array of 100 items into groups of 30.

http://jsfiddle.net/tommyBoy/nwtbwxrz/
0
kevbob650Author Commented:
Still confused, this is what I have, but getting an error saying "arrTicketList[arrTicketList.length] is not defined"
This is the result set of an Oracle query, 20 columns, I need column 4 for example.  See attached code example, I wasn't able to show code with braced "i" values??
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Phil PhillipsDevOps ArchitectCommented:
Looks like your code didn't attach.

Though, "arrTicketList[arrTicketList.length]" won't work because arrays start at 0.  So, the last element of an array would be at "arrTicketList.length - 1"
0
kevbob650Author Commented:
Let me try the attachment again, not sure what happened, never attached a file before but it wouldn't let me submit the file since it had brackets with an iterator, go figure.
code-example.txt
0
Tom BeckCommented:
I updated my jsFiddle to include a multidimensional array with twenty columns (represents your Oracle return). I extract the fourth column value into groups of five. I used your variable names where appropriate.

http://jsfiddle.net/jg17b533/5/
0
kevbob650Author Commented:
Thanks TomBeck,
We're getting closer!  So what your code does is uses a list but I need to create a series of arrays that I can loop thru on further steps  I will loop thru each new array and call a nodeJs function for each value(scary). Hence I was trying to develop a series of arrays like:
arrTicketList[0] = ['tkt1',' tk2',' tk3'. , etc...]
arrTicketList[1] = ['tkt1',' tk2',' tk3'. , etc...]
arrTicketList[2] = ['tkt1',' tk2',' tk3'. , etc...]
etc..
But I also tried using the 'i' value but I get the same error, arrTicketList is not defined?
0
Tom BeckCommented:
Left the <UL> in place and added in the arrTicketList array of arrays.

http://jsfiddle.net/jg17b533/6/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevbob650Author Commented:
Thanks for all of the posts, very helpful
0
Tom BeckCommented:
You're welcome. Thanks for the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.