Database Column Names

2 posts / 0 new
Last post
shamilt4
Offline
Joined: 12/16/2015 - 15:45
Database Column Names

Hello!
I am currently attempting to create a macro using IDEA script.
We bring in a chart of accounts database and join it with another database. To ensure consistency I want to modify the name of one of the fields each time. The naming of the field may vary each time it is imported.
For example:
"DESCRIPTION_FULL_COA" to "DESCRIPTION"
The field will almsot always include the word description in the title. Is there a way to set the following with a variable/wildcard?
task.ReplaceField "DESCRIPTION_FULL_COA", field to replace the "_FULL_COA" with a variable?
Thayou for your help!
Cheers!
Shawn

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Shawn,

Just want to let you know that I haven't been ignoring your comment.  Just been dealing with some real life issues that haven't given me any time to support the site, hopefully that will change soon.

What you want to do can't be done using a wild card to do all of them.  What you need to do is loop through each field in the database and then verify if it contains DESCRIPTION and if it does change the name of the field.  Most of the IDEA equation functions are available using the i to replace the @ so you could use the iLeft to check and see if x number of of characters match what you are looking for and the iReplace to replace it with something else.  If you have problems with the script let me know, I would have liked to have posted a demo for you but haven't had time to create one for you.

Thanks

Brian