Импорт и экспорт данных с Администратор

Стартовая страница Форумы Понять, как работает ПО Импорт и экспорт данных с Администратор

Просмотр 6 сообщений - с 1 по 6 (из 6 всего)
  • Автор
    Записи
  • #8863
    skoda_rapid2017
    Участник

    Здравствуйте! Как правильно использовать импорт и экспорт входных каналов с одной базы в другую?
    с базы №1 нужно импортировать входные каналы, например, 5521-5542 в базу №2
    Сначала загрузил базу №1, экспортировал каналы 5521-5542 в incnl.dat
    далее загрузил базу №2 и сделал импорт каналов 5521-5542 из файла incnl.dat, но после импорта Администратор выдал ошибку

    05.04.2018 9:53:52 Импорт базы конфигурации
    ——————————————-
    Исходный файл : C:\SCADA\BaseDAT\incnl.dat

    Импорт таблицы базы конфигурации «InCnl (Входные каналы)»
    ———————————————————

    Поля исходной таблицы
    ———————
    CnlNum (System.Int32)
    Active (System.Boolean)
    Name (System.String)
    CnlTypeID (System.Int32)
    ObjNum (System.Int32)
    KPNum (System.Int32)
    Signal (System.Int32)
    FormulaUsed (System.Boolean)
    Formula (System.String)
    Averaging (System.Boolean)
    ParamID (System.Int32)
    FormatID (System.Int32)
    UnitID (System.Int32)
    CtrlCnlNum (System.Int32)
    EvEnabled (System.Boolean)
    EvSound (System.Boolean)
    EvOnChange (System.Boolean)
    EvOnUndef (System.Boolean)
    LimLowCrash (System.Double)
    LimLow (System.Double)
    LimHigh (System.Double)
    LimHighCrash (System.Double)
    ModifiedDT (System.DateTime)

    Поля таблицы, в которую производится импорт
    ——————————————-
    CnlNum (System.Int32)
    Active (System.Boolean)
    Name (System.String)
    CnlTypeID (System.Int32)
    ObjNum (System.Int32)
    KPNum (System.Int32)
    Signal (System.Int32)
    FormulaUsed (System.Boolean)
    Formula (System.String)
    Averaging (System.Boolean)
    ParamID (System.Int32)
    FormatID (System.Int32)
    UnitID (System.Int32)
    CtrlCnlNum (System.Int32)
    EvEnabled (System.Boolean)
    EvSound (System.Boolean)
    EvOnChange (System.Boolean)
    EvOnUndef (System.Boolean)
    LimLowCrash (System.Double)
    LimLow (System.Double)
    LimHigh (System.Double)
    LimHighCrash (System.Double)
    ModifiedDT (System.DateTime)

    Результат импорта таблицы
    ————————-
    Импорт таблицы базы конфигурации завершён с ошибками.
    Добавлено/обновлено записей: 0. Ошибок: 22.

    Ошибки импорта таблицы
    ———————-
    CnlNum = 5521 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5522 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5523 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5524 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5525 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5526 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5527 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5528 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5529 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5530 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5531 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5532 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5533 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5534 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5535 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5536 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5537 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5538 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5539 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5540 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5541 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]
    CnlNum = 5542 : A foreign key value cannot be inserted because a corresponding primary key value does not exist. [ Foreign key constraint name = fk_InCnl_KPNum ]

    Правильный ли порядок действий я выполнил? Может кто-нибудь подскажет в чем ошибка?

    #8864
    manjey73
    Участник

    Нужно импортировать КП предварительно. И тут была засада, не знаю, Михаил вылечил или нет, если в новой базе уже есть такой КП, то импортнуть его было нельзя.
    В таком случае заходим в базу каналов и все КП отключаем на всех каналах. Импортируем без КП, создаем новый КП и все каналы привязываем к новому КП.

    #8866
    Mikhail
    Модератор

    Добрый день!

    Общий принцип такой:
    Если в таблице есть ячейкии с выпадающими значениями, значит эта таблица зависит от другой таблицы. При вставке записей в 1-ю таблицу, записи во 2-й таблице должны существовать с теми же идентификаторами (или номерами).

    #8867
    Mikhail
    Модератор

    Таблица входных каналов зависит от многих таблиц, в том числе от таблицы КП.

    #8871
    skoda_rapid2017
    Участник

    Спасибо за помощь. Все получилось.

    #8882
    Mikhail
    Модератор

    ОК ))

Просмотр 6 сообщений - с 1 по 6 (из 6 всего)
  • Для ответа в этой теме необходимо авторизоваться.