Hi Andy,
try this:

private void updateTableEnumValue(enumId _enum, int _oldValue, int
_newValue )
{
    int             tablecounter, fieldCounter;
    Dictionary      dictionary;
    SysDictTable    dictTable;
    SysDictField    dictField;
    Common          _table;
    ;
    dictionary = new Dictionary();
    ttsbegin;
    // loop all Tables
    for (tableCounter = 1; tableCounter <= dictionary.tableCnt();
tableCounter++)
    {
        dictTable = new SysDictTable(dictionary.tableCnt2Id
(tableCounter));
        if (dictTable == null)
            continue;
        for (fieldCounter = 1; fieldCounter <= dictTable.fieldCnt();
fieldCounter++)
        {
            dictField = new SysDictField(dictTable.id(),
dictTable.fieldCnt2Id(fieldCOunter));
            if (dictField == null)
                continue;
            if (dictField.enumId() == _enum)
            {
                _table = dictTable.makeRecord();
                _table.selectForUpdate(true);
                while select _table
                 where _table.(dictField.id()) == _oldValue
                {
                    _table.(dictField.id()) = _newValue;
                    _table.doUpdate();
                }
            }
            dictField = null;
        }
        dictTable = null;
    }
    ttscommit;
}

good luck
Claudia



--- In [EMAIL PROTECTED], "agramm2000"
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> How can I change entries of a base enum in all tables where a field
> of this type exists.
>
> I will do this by code, running over all tables looking for such
> fields and changes content of the field for given entry to another
> entry.
>
> Is this possible?
>
> Any Idea?
>
> Regards
> Andi


Yahoo! Groups Sponsor
ADVERTISEMENT
Click to learn more...


Yahoo! Groups Links

Reply via email to