padvou Active Member Licensed User Longtime User Aug 17, 2016 #1 Let's suppose we have following code: Code: cursor1 = SQL1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(???) Next cursor1.close Then we want to add the first row to another list: Code: Dim row As List Dim cols As Int Dim rows As Int row.Initialize rows = Slist.Size Log(Slist.Get(0)) row=Slist.Get(0) 'Header row cols = row.Size What should the code be in the questionmarks, so that each row of the Slist list can be added as an array in the row list?
Let's suppose we have following code: Code: cursor1 = SQL1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(???) Next cursor1.close Then we want to add the first row to another list: Code: Dim row As List Dim cols As Int Dim rows As Int row.Initialize rows = Slist.Size Log(Slist.Get(0)) row=Slist.Get(0) 'Header row cols = row.Size What should the code be in the questionmarks, so that each row of the Slist list can be added as an array in the row list?
padvou Active Member Licensed User Longtime User Aug 17, 2016 #2 I tried using this: Code: Slist.add(cursor1.GetString2(0) & TAB & cursor1.GetString2(1) & TAB & cursor1.GetString2(2) & TAB & cursor1.GetString2(3) & TAB & cursor1.GetString2(4) & TAB & cursor1.GetString2(5) & TAB & cursor1.GetString2(6) & TAB & cursor1.GetString2(7) & TAB & cursor1.GetString2(8)) and then split it like this: Code: row.Add(Regex.Split("/t",Slist.Get(0))) but the row.size returned is always 1. Upvote 0
I tried using this: Code: Slist.add(cursor1.GetString2(0) & TAB & cursor1.GetString2(1) & TAB & cursor1.GetString2(2) & TAB & cursor1.GetString2(3) & TAB & cursor1.GetString2(4) & TAB & cursor1.GetString2(5) & TAB & cursor1.GetString2(6) & TAB & cursor1.GetString2(7) & TAB & cursor1.GetString2(8)) and then split it like this: Code: row.Add(Regex.Split("/t",Slist.Get(0))) but the row.size returned is always 1.
padvou Active Member Licensed User Longtime User Aug 17, 2016 #3 ok, I answered my own question... Code: row.Add(Regex.Split("/t",Slist.Get(0))) should be Code: row.Add(Regex.Split("\t",Slist.Get(0))) Upvote 0
ok, I answered my own question... Code: row.Add(Regex.Split("/t",Slist.Get(0))) should be Code: row.Add(Regex.Split("\t",Slist.Get(0)))
DonManfred Expert Licensed User Longtime User Aug 17, 2016 #4 Code: cursor1 = sql1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(cursor1.GetString("colname")) Next Upvote 0
Code: cursor1 = sql1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(cursor1.GetString("colname")) Next
padvou Active Member Licensed User Longtime User Aug 17, 2016 #5 DonManfred said: Code: cursor1 = sql1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(cursor1.GetString("colname")) Next Click to expand... I get this: java.lang.IllegalArgumentException: column 'colname' does not exist Upvote 0
DonManfred said: Code: cursor1 = sql1.ExecQuery("select CODE, NAME, PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc") For i = 0 To cursor1.RowCount - 1 cursor1.Position = i Slist.add(cursor1.GetString("colname")) Next Click to expand... I get this: java.lang.IllegalArgumentException: column 'colname' does not exist
somed3v3loper Well-Known Member Licensed User Longtime User Aug 17, 2016 #6 padvou said: I get this: java.lang.IllegalArgumentException: column 'colname' does not exist Click to expand... You should specify column name like this : Code: Slist.add(cursor1.GetString("NAME")) or Code: Slist.add(cursor1.GetString("PHONE11")) Upvote 0
padvou said: I get this: java.lang.IllegalArgumentException: column 'colname' does not exist Click to expand... You should specify column name like this : Code: Slist.add(cursor1.GetString("NAME")) or Code: Slist.add(cursor1.GetString("PHONE11"))