Rob,
One thing you don't say is how the array gets to your program. Is it returned from a query as an array object?
By definition an array exists in memory so has the advantage of processing speed. So will speed be an issue in what you're doing?
However, arrays are difficult to code correctly for (first time, every time) because you have to translate the array elements in your head into what they represent.
I think it's for that reason that they are used less than you might think.
In your case, I would worry more about changes in the presentation of the data and how you handle that in future, 6 or 9 months down the line.
For that reason I would use the following approach:
1) Append from an array into a "checking" table.
2) Check the data now sat in the table for errors, missing data, wrong data types, unusual field entries, etc. (This is the hard part).
3) Append only the checked data that you wish to keep into your permanent tables.
Hope that helps,
Andy
> Hi All
> can somebody please advise which is the best solution to use.
> Append from array OR extract out of a txt file.
> i need to get information out of this array
>
> [{"Id":2773,"Date":"2021-03-08T00:00:00+11:00","StartTime":1615147200,"EndTime":1615183200,"Mealbreak":"2021-03-08T00:30:00+11:00","Slots":[{"blnEmptySlot":false,"strType":"B","intStart":0,"intEnd":1800,"intUnixStart":1615147200,"intUnixEnd":1615149000,"mixedActivity":{"intState":3,"blnCanStartEarly":1,"blnCanEndEarly":1,"blnIsMandatory":1,"strBreakType":"M"},"strTypeName":"Echo","strState":"Scheduled Duration"}],"TotalTime":9.5,"Cost":0,"OperationalUnit":21,"Employee":0,"Comment":"Note: All shift Finish times are nominal and should not be viewed as an expected finish time. For all entitlements please refer to the EBA","Warning":"","WarningOverrideComment":"","Published":false,"MatchedByTimesheet":0,"Open":false,"ApprovalRequired":false,"ConfirmStatus":0,"ConfirmComment":"","ConfirmBy":0,"ConfirmTime":0,"SwapStatus":0,"SwapManageBy":null,"ShiftTemplate":1,"ConnectStatus":null,"Creator":1,"Created":"2021-03-04T10:29:28+11:00","Modified":"2021-03-04T10:30:21+11:00","OnCost":0,"StartTimeLocalized":"2021-03-08T07:00:00+11:00","EndTimeLocalized":"2021-03-08T17:00:00+11:00","ExternalId":null,"ConnectCreator":null,"BidsCount":null},{"Id":2774,"Date":"2021-03-08T00:00:00+11:00","StartTime":1615147200,"EndTime":1615183200,"Mealbreak":"2021-03-08T00:30:00+11:00","Slots":[{"blnEmptySlot":false,"strType":"B","intStart":0,"intEnd":1800,"intUnixStart":1615147200,"intUnixEnd":1615149000,"mixedActivity":{"intState":3,"blnCanStartEarly":1,"blnCanEndEarly":1,"blnIsMandatory":1,"strBreakType":"M"},"strTypeName":"Echo","strState":"Scheduled Duration"}],"TotalTime":9.5,"Cost":0,"OperationalUnit":44,"Employee":0,"Comment":"Note: All shift Finish times are nominal and should not be viewed as an expected finish time. For all entitlements please refer to the EBA","Warning":"","WarningOverrideComment":"","Published":false,"MatchedByTimesheet":0,"Open":false,"ApprovalRequired":false,"ConfirmStatus":0,"ConfirmComment":"","ConfirmBy":0,"ConfirmTime":0,"SwapStatus":0,"SwapManageBy":null,"ShiftTemplate":1,"ConnectStatus":null,"Creator":1,"Created":"2021-03-04T10:30:27+11:00","Modified":"2021-03-04T10:30:57+11:00","OnCost":0,"StartTimeLocalized":"2021-03-08T07:00:00+11:00","EndTimeLocalized":"2021-03-08T17:00:00+11:00","ExternalId":null,"ConnectCreator":null,"BidsCount":null},{"Id":2775,"
>
> i have included the start of the 2nd shift - there are multiple shifts to deal with
> i do not need all the information only parts of it. eg Id, Date, starttime, finishtime, Employee
> i have never done anything with append from array so any help and suggestions would be greatly appreciated. i have saved the output to a txt file with no problems.so ....
>
> Regards Rob
|