Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading XML files that provide a series of fields only if there is data within them. See example below. I cannot load *, otherwise I would do that first and then transform the resident table. Is there a way for me to check to see if a field is there before loading the file?
Monday's Extract (three fields):
| OrderID | Amount | Location | 
| 1 | 10 | Mexico | 
| 2 | 4 | Canada | 
| 3 | 5 | England  | 
Tuesday's Extract (four fields):
| OrderID | Amount | Location | State | 
| 1 | 10 | Mexico | |
| 2 | 4 | Canada | |
| 3 | 5 | England | |
| 4 | 1 | USA | NY | 
Thanks in advance!
ScriptError = 11 denotes 'Field Not Found'. Hence try like:
set ErrorMode=0;
load Field1 from <>;
if ScriptError=11 then
Set vError= 'FieldNotFound';
End If
Can you post a sample xml file?
- Ralf