Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Qualify Name change

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

22 Replies
Chanty4u
MVP
MVP

try   unqualify *;

priyarane
Specialist
Specialist
Author

it won't work as columns are already qualified.

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prma7799
Master III
Master III

Try to give alias name using resindent ..

Clever_Anjos
Employee
Employee

You can rename them using this How to Rename Fields using Mapping Table

priyarane
Specialist
Specialist
Author

I need to use qualify some reasons

priyarane
Specialist
Specialist
Author

there are 1000 of records I have in data, so can you give your thoughts like replacing 'Tab*.' with nothing

Clever_Anjos
Employee
Employee

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