Below is one of the options to read all rows of all columns of data in an Excel.
- Loop through each row of the Excel (you don't need to know the number of rows in this case it will take automatically)
- arrReadExcel is an Array type variable which holds the Excel data and can give the dynamic number of columns and rows in the system variables ArrayColumns and ArrayRow respectively.
- The Message Box will show each row of data for each column.
- A ColumnTimes counter variable is used to increment in order to read data from each column and reset back after every end of inside loop.
Alternatively you can also read the data from the array itself as below, but you will need to use Row and Column variables to loop through them.
eg; $arrReadExcel(1,2)$ will give data from 1st row and 2nd column of the array. Instead of 1 and 2 you need to use variables and increment them as needed.
how to define dynamic array and assign value to each row & column.
select distrinct (data1) as col1 from excelsheet
then i have 10 records. how to re-define array variable so i can start loop through data from sql record set to array (row,1)= datasetcolumn (1)