Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
In script I am reading data from an existing qvd file. The script can not see filed 'field1' if in qvd it is 'FIELD1'. Some of the fields are in upper case, others are in lower. How can I make it case insensitive? I tried FORCE UPPER CASE, but it didn't help.
Hi Volha,
It looks like an adventure, but it can be as variant
//set the mode of ignoring errors
set ErrorMode=0;
LOAD
[Variant1 Field Name]
...
FROM
...
If ScriptError>0 //did not guess the name of the field
LOAD
[Variant2 Field Name]
...
FROM
...
End If
........
If ScriptError>0 //did not guess the name of the field
LOAD
[VariantN Field Name]
...
FROM
...
End If
//set mode errors default
set ErrorMode=1;
Regards,
Andrey
Hi,
Use Upper() in script and for column names in you can use alise name
try like'
Upper(fieldName) as FIELDNAME
Regards,
Swathi
So you read different qvds with changing fieldnames???
You may use a script like:
MyTable: LOAD * FROM .....qvd;
FOR i = 1 TO NOOFFIELDS('MyTable')
LET sOldField = FIELDNAME(i, 'MyTable');
LET sNewField = UPPER(sOldField);
RENAME FIELD $(sOldField) TO $(sNewField);
So you have all fields in Upper-case and continue with uniform names.
Peter
Hi All,
Actually it helped to avoid an issue with case insensitivity when I install Hortonworks driver instead of Cloudera.