scripter50
IS-IT--Management
I have an Oracle query in a NodeJS function and having trouble with the loop thru the record set. Nodejs, hence javascript stuff.
Example: results from query of table with 20 columns, on of which is "ticket".
I loop thru the record set and stuff the values into a mainArray
for(var i in result) {
mainArray.push(result.rows);
}
So now I have a array to work with. I need to loop thru the array, and for every 30 records, grab the "ticket" value
and stuff it into a separate ticketArray. So I would end up with:
ticketArray[1] = '1', '2', '3', ....'30'
ticketArray[2] = '31', '32', '33',....'60'
ticketArray[3] = '62', '63', '64',.....'90' etc....
I can get the first 30 records, but lost on how to get the other values and put them into separate arrays.
Thanks in advance for any help!
Example: results from query of table with 20 columns, on of which is "ticket".
I loop thru the record set and stuff the values into a mainArray
for(var i in result) {
mainArray.push(result.rows);
}
So now I have a array to work with. I need to loop thru the array, and for every 30 records, grab the "ticket" value
and stuff it into a separate ticketArray. So I would end up with:
ticketArray[1] = '1', '2', '3', ....'30'
ticketArray[2] = '31', '32', '33',....'60'
ticketArray[3] = '62', '63', '64',.....'90' etc....
I can get the first 30 records, but lost on how to get the other values and put them into separate arrays.
Thanks in advance for any help!