powered by simpleCommunicator - 2.0.59     © 2025 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Как записать XLS файл (именно файл!) в базу DB2
7 сообщений из 7, страница 1 из 1
Как записать XLS файл (именно файл!) в базу DB2
    #37889970
vadipok
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Добрый день коллеги!
Подскажите пожалуйста как это сделать, если это вообще можно сделать.
Доку перерыл, погуглил, не помогло.

База DB2 9.7,
файлик /tmp/color.xls
Версия ОС Linux version 2.6.18-238.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))

Спасибо за помощь!
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37890071
Troglodit
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
есть тип данных BLOB, если xls сохраняется в xml формате, то можно записываеть его в xml тип поле.
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37890095
Mark Barinstein
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
vadipok,

Здравствуйте.

Создайте файл /tmp/color.csv с 1-й строкой:
"color.xls"

Если у вас есть таблица my_table с полем b типа blob, то при соединении с базой выполните:

Код: plaintext
import from /tmp/color.csv of del lobs from /tmp insert into my_table (b)
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37890133
vadipok
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Mark Barinstein,

Спасибо огромное коллеги.
Выбирал метод Mark Barinstein.

Очень помогли. )
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37893786
vadipok
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Mark Barinsteinvadipok,

Здравствуйте.

Создайте файл /tmp/color.csv с 1-й строкой:
"color.xls"

Если у вас есть таблица my_table с полем b типа blob, то при соединении с базой выполните:

Код: plaintext
import from /tmp/color.csv of del lobs from /tmp insert into my_table (b)



Добрый день!
Для поля типа Clob эта команда хорошо работает, но как только меняю тип поля на Blob выводит вот такую ошибку:


$ db2 "import from /tmp/color of del lobs from /tmp insert into portal_kich_fpk.clob_test3 (my_blob)"
SQL3109N The utility is beginning to load data from file "/tmp/color".

SQL3148W A row from the input file was not inserted into the table. SQLCODE
"-668" was returned.

SQL0668N Operation not allowed for reason code "7" on table
"PORTAL_KICH_FPK.CLOB_TEST3". SQLSTATE=57016

SQL3185W The previous error occurred while processing data from row "1" of
the input file.

SQL3110N The utility has completed processing. "1" rows were read from the
input file.

SQL3221W ...Begin COMMIT WORK. Input Record Count = "1".

SQL3222W ...COMMIT of any database changes was successful.

SQL3149N "1" rows were processed from the input file. "0" rows were
successfully inserted into the table. "1" rows were rejected.


Number of rows read = 1
Number of rows skipped = 0
Number of rows inserted = 0
Number of rows updated = 0
Number of rows rejected = 1
Number of rows committed = 1

Почему так? Объясните пожалуйста.
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37893834
Mark Barinstein
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
vadipok...
SQL3148W A row from the input file was not inserted into the table. SQLCODE
"-668" was returned.

SQL0668N Operation not allowed for reason code "7" on table
"PORTAL_KICH_FPK.CLOB_TEST3". SQLSTATE=57016
...

db2 "? SQL0668N"

SQL0668N Operation not allowed for reason code "<reason-code>" on table
"<table-name>".

Explanation:

Access to table "<table-name>" is restricted. The cause is based on the
following reason codes "<reason-code>":

...
7

The table is in the reorg pending state. This can occur after
an ALTER TABLE statement containing a REORG-recommended
operation.
...
User response:
...
7

Reorganize the table using the REORG TABLE command.
...
После изменения типа поля как у вас надо делать реорганизацию таблицы, чтоб в нее можно было писАть.
...
Рейтинг: 0 / 0
Как записать XLS файл (именно файл!) в базу DB2
    #37893854
vadipok
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Mark Barinsteinvadipok...
SQL3148W A row from the input file was not inserted into the table. SQLCODE
"-668" was returned.

SQL0668N Operation not allowed for reason code "7" on table
"PORTAL_KICH_FPK.CLOB_TEST3". SQLSTATE=57016
...

+
db2 "? SQL0668N"

SQL0668N Operation not allowed for reason code "<reason-code>" on table
"<table-name>".

Explanation:

Access to table "<table-name>" is restricted. The cause is based on the
following reason codes "<reason-code>":

...
7

The table is in the reorg pending state. This can occur after
an ALTER TABLE statement containing a REORG-recommended
operation.
...
User response:
...
7

Reorganize the table using the REORG TABLE command.
...
После изменения типа поля как у вас надо делать реорганизацию таблицы, чтоб в нее можно было писАть.


Все отлично! Спасибо большое!
...
Рейтинг: 0 / 0
7 сообщений из 7, страница 1 из 1
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Как записать XLS файл (именно файл!) в базу DB2
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]