Hi, I discovered a curious problem/bug.
The following few lines of codes should illustrate it:
Dim parser As JSONParser
Response=Job.GetString
parser.Initialize(response)
Log (response)
Log(parser)
Dim trows As List
trows = parser.NextArray
Log(trows)
In this case Resonse vil be a single line of data from a SQL Server table.
The resulting log output from this is:
[{"Fornavn":"Arne","Etternavn":"Husveg","AnsattNr":"105"}]
(JSONTokener) at character 0 of [{"Fornavn":"Arne","Etternavn":"Husveg","AnsattNr":"105"}]
(ArrayList) [{Etternavn=Husveg, Fornavn=Arne, AnsattNr=105}]
So: After Parser.NextArray, the list contain the columns in the order Etternavn,Fornavn,AnsattNr in stead of the original Fornavn,Etternavn,AnsattNr ...!
I am not able to determin any pattern in how this column reordering takes place, even if it seemes to be consistent within one developent session.
If i later would reference this columns by name, there would be no problem. But I am trying to build a dynamic solution that can return any number of columns, so I need to get values by column number using a Map variable.
Regards Jorvart
The following few lines of codes should illustrate it:
Dim parser As JSONParser
Response=Job.GetString
parser.Initialize(response)
Log (response)
Log(parser)
Dim trows As List
trows = parser.NextArray
Log(trows)
In this case Resonse vil be a single line of data from a SQL Server table.
The resulting log output from this is:
[{"Fornavn":"Arne","Etternavn":"Husveg","AnsattNr":"105"}]
(JSONTokener) at character 0 of [{"Fornavn":"Arne","Etternavn":"Husveg","AnsattNr":"105"}]
(ArrayList) [{Etternavn=Husveg, Fornavn=Arne, AnsattNr=105}]
So: After Parser.NextArray, the list contain the columns in the order Etternavn,Fornavn,AnsattNr in stead of the original Fornavn,Etternavn,AnsattNr ...!
I am not able to determin any pattern in how this column reordering takes place, even if it seemes to be consistent within one developent session.
If i later would reference this columns by name, there would be no problem. But I am trying to build a dynamic solution that can return any number of columns, so I need to get values by column number using a Map variable.
Regards Jorvart