Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi Community,
Due some reason I am using Qualify* for many tables and after qualify and Unqualify, I am trying to get original names.
LIke:
for ex I have fields like
tab1.A
tab1.B
tab2.A
tab2.B
tab3.C
how can I rename them like A,B,C... in script
_Priya
try unqualify *;
it won't work as columns are already qualified.
How come? where is your script?
Remove Qualify statement then? It will resolve issue. Not sure why are you used Qualify and again Rollback needed? Can you explain the logic behind
Try to give alias name using resindent ..
You can rename them using this How to Rename Fields using Mapping Table
I need to use qualify some reasons
there are 1000 of records I have in data, so can you give your thoughts like replacing 'Tab*.' with nothing
This script will iterate over all tables and all columns creating a renaming table
Any table named Tab*.name will be renamed to 'name'
For i = 1 to NoOfTables()
Let tb = TableName(i);
For j = 1 to NoOfFields(TableName(i))
let col = FieldName(j,tb);
if col like 'Tab*' then
renamingtable:
load '$(col)' as from , SubField('$(col)','.',-1) as to AutoGenerate 1;
endif
Next
Next
map:
Mapping load * Resident renamingtable;
drop Table renamingtable;
RENAME Fields using map;
Be carefull with synthetic keys after that