Стартовая страница › Форумы › Понять, как работает ПО › Импорт и экспорт данных с Администратор
- В этой теме 5 ответов, 3 участника, последнее обновление 8 лет, 3 месяца назад сделано
Mikhail.
-
АвторЗаписи
-
05.04.2018 в 09:56 #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 ]Правильный ли порядок действий я выполнил? Может кто-нибудь подскажет в чем ошибка?
05.04.2018 в 13:00 #8864
manjey73УчастникНужно импортировать КП предварительно. И тут была засада, не знаю, Михаил вылечил или нет, если в новой базе уже есть такой КП, то импортнуть его было нельзя.
В таком случае заходим в базу каналов и все КП отключаем на всех каналах. Импортируем без КП, создаем новый КП и все каналы привязываем к новому КП.06.04.2018 в 18:03 #8866
MikhailМодераторДобрый день!
Общий принцип такой:
Если в таблице есть ячейкии с выпадающими значениями, значит эта таблица зависит от другой таблицы. При вставке записей в 1-ю таблицу, записи во 2-й таблице должны существовать с теми же идентификаторами (или номерами).06.04.2018 в 18:04 #8867
MikhailМодераторТаблица входных каналов зависит от многих таблиц, в том числе от таблицы КП.
09.04.2018 в 14:45 #8871skoda_rapid2017
УчастникСпасибо за помощь. Все получилось.
10.04.2018 в 15:22 #8882
MikhailМодераторОК ))
-
АвторЗаписи
- Для ответа в этой теме необходимо авторизоваться.