Greetings all,
Machine : PENTIUM
Os :Windows 2000
Product : DB2 UDB EE Release : 7.2
I've extracted data from a RDBMS database and try to load into DB2
database. I extracted the data in the form of delimited ASCII format.
The separator for
each colum is '|'
I found that some of the colum value of the data file is in '*' value.
The
representation of null value for colums on that particular RDBMS is
'*'. Therefore column like integer,date, time and string would be
represented as
'*' if it is null
For an example below is a portion of data file
-------------------------------------------
CIP| 1| *****| ********|Ciprofloxacin
CHL| 1| *****| ********|Chloramphenicol
CEP| 1| *****| ********|Cephalothin
The 3rd colums is an integer data type and the 4th is a date data
type.
Table structure for the above data is as follows
CREATE TABLE "LAB"."ANTIBIOTIC" (
"CODE" VARCHAR(3) NOT NULL ,
"KEY_NUM" INTEGER NOT NULL ,
"SUPER_NUM" INTEGER ,
"SUPER" DATE,
"NAME" VARCHAR(40) ,
"UNIT_COST" DECIMAL(12,2) ,
"UNITS" VARCHAR(15) ,
"DOSAGE" VARCHAR(15) )
IN "LISUSRTBLSPACE_3" ;
-- DDL Statements for primary key on Table "LAB"."ANTIBIOTIC"
ALTER TABLE "LAB "."ANTIBIOTIC"
ADD PRIMARY KEY
("CODE",
"KEY_NUM");
The load commad used is
LOAD FROM F:\reload_reject\labantibiotic OF DEL MODIFIED BY dumpfile =
f:\reload_reject\labantibiotic.rej
pagefreespace=0 totalfreespace=0 coldel| chardel"" decpt.
timeformat=""HH:MM"" dateformat=""DD/MM/YYYY""
MESSAGES db2load.msg INSERT INTO LAB.ANTIBIOTIC COPY NO INDEXING
MODE
AUTOSELECT ;
commit work
The above statement seem to fail as DB2 could not understand data
value '*'
for INTEGER and DATE data type. I tried using USEDEFAULTS option in my
LOAD command but it still fails. How do i load the '*' value into the
table?
Is is possible ?
Please advice.
Thanks in advance.
Uthuras 2 2941
The easiest would be to edit the file and replace |********| by ||.
Uthuras wrote: Greetings all,
Machine : PENTIUM Os :Windows 2000 Product : DB2 UDB EE Release : 7.2
I've extracted data from a RDBMS database and try to load into DB2 database. I extracted the data in the form of delimited ASCII format. The separator for each colum is '|'
I found that some of the colum value of the data file is in '*' value. The representation of null value for colums on that particular RDBMS is '*'. Therefore column like integer,date, time and string would be represented as '*' if it is null
For an example below is a portion of data file
------------------------------------------- CIP| 1| *****| ********|Ciprofloxacin CHL| 1| *****| ********|Chloramphenicol CEP| 1| *****| ********|Cephalothin
The 3rd colums is an integer data type and the 4th is a date data type. Table structure for the above data is as follows
CREATE TABLE "LAB"."ANTIBIOTIC" ( "CODE" VARCHAR(3) NOT NULL , "KEY_NUM" INTEGER NOT NULL , "SUPER_NUM" INTEGER , "SUPER" DATE, "NAME" VARCHAR(40) , "UNIT_COST" DECIMAL(12,2) , "UNITS" VARCHAR(15) , "DOSAGE" VARCHAR(15) ) IN "LISUSRTBLSPACE_3" ;
-- DDL Statements for primary key on Table "LAB"."ANTIBIOTIC"
ALTER TABLE "LAB "."ANTIBIOTIC" ADD PRIMARY KEY ("CODE", "KEY_NUM");
The load commad used is
LOAD FROM F:\reload_reject\labantibiotic OF DEL MODIFIED BY dumpfile = f:\reload_reject\labantibiotic.rej pagefreespace=0 totalfreespace=0 coldel| chardel"" decpt. timeformat=""HH:MM"" dateformat=""DD/MM/YYYY"" MESSAGES db2load.msg INSERT INTO LAB.ANTIBIOTIC COPY NO INDEXING MODE AUTOSELECT ;
commit work
The above statement seem to fail as DB2 could not understand data value '*' for INTEGER and DATE data type. I tried using USEDEFAULTS option in my LOAD command but it still fails. How do i load the '*' value into the table? Is is possible ?
Please advice.
Thanks in advance.
Uthuras
--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands
Greetings Anton,
It works! Thanks.
Uthuras
Anton Versteeg <an************@nnll.iibbmm.com> wrote in message news:<3F**************@nnll.iibbmm.com>... The easiest would be to edit the file and replace |********| by ||.
Uthuras wrote:
Greetings all,
Machine : PENTIUM Os :Windows 2000 Product : DB2 UDB EE Release : 7.2
I've extracted data from a RDBMS database and try to load into DB2 database. I extracted the data in the form of delimited ASCII format. The separator for each colum is '|'
I found that some of the colum value of the data file is in '*' value. The representation of null value for colums on that particular RDBMS is '*'. Therefore column like integer,date, time and string would be represented as '*' if it is null
For an example below is a portion of data file
------------------------------------------- CIP| 1| *****| ********|Ciprofloxacin CHL| 1| *****| ********|Chloramphenicol CEP| 1| *****| ********|Cephalothin
The 3rd colums is an integer data type and the 4th is a date data type. Table structure for the above data is as follows
CREATE TABLE "LAB"."ANTIBIOTIC" ( "CODE" VARCHAR(3) NOT NULL , "KEY_NUM" INTEGER NOT NULL , "SUPER_NUM" INTEGER , "SUPER" DATE, "NAME" VARCHAR(40) , "UNIT_COST" DECIMAL(12,2) , "UNITS" VARCHAR(15) , "DOSAGE" VARCHAR(15) ) IN "LISUSRTBLSPACE_3" ;
-- DDL Statements for primary key on Table "LAB"."ANTIBIOTIC"
ALTER TABLE "LAB "."ANTIBIOTIC" ADD PRIMARY KEY ("CODE", "KEY_NUM");
The load commad used is
LOAD FROM F:\reload_reject\labantibiotic OF DEL MODIFIED BY dumpfile = f:\reload_reject\labantibiotic.rej pagefreespace=0 totalfreespace=0 coldel| chardel"" decpt. timeformat=""HH:MM"" dateformat=""DD/MM/YYYY"" MESSAGES db2load.msg INSERT INTO LAB.ANTIBIOTIC COPY NO INDEXING MODE AUTOSELECT ;
commit work
The above statement seem to fail as DB2 could not understand data value '*' for INTEGER and DATE data type. I tried using USEDEFAULTS option in my LOAD command but it still fails. How do i load the '*' value into the table? Is is possible ?
Please advice.
Thanks in advance.
Uthuras
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Carlos G Benevides |
last post by:
I have a ASP.Net web application that has two assemblies that run
under com+. Under Windows 2000 the two assemblies are added to com+
automatically when instantiated from the web site. For this...
|
by: StephenRichter |
last post by:
I have installed the trial of db2 enterprise server on my w2k PC. Have
also installed fix pack 8 of that product.
I am using it to connect from an asp.net web page to an IBM as400. the
400 is...
|
by: DT |
last post by:
We have service oriented architecture
that comprises of a number of Win2k/IIS boxes.
Some of these web service applications access an AS400
system for data acess (We are using HitSoftware's Ritmo...
|
by: Chris Bower |
last post by:
Reposted from aspnet.buildingcontrols:
Ok, I've got a bunch of derived controls that all have a property Rights of
type Rights (Rights is an Enumerator). I wrote a custom TypeConverter so
that I...
|
by: Abi |
last post by:
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack...
|
by: whidbey |
last post by:
Hello friends, I am whidbey, new to thescripts and dot net as well.I am working over Online Shopping Cart,web application.I design a page (webform5.aspx) where user search books then select the books...
|
by: whidbey |
last post by:
Hello friends, I am whidbey, new to thescripts and dot net as well.I am working over Online Shopping Cart,web application.I design a page (webform5.aspx) where user search books then select the books...
|
by: wildman |
last post by:
Trying to read XML files from SSIS and load into SQL Server.
I tested this before and it was working before I placed in a forevery
contrainer. also, my simple xml file had to be retyped cause I...
|
by: Elliot |
last post by:
When decrypt the xml, output "Unable to retrieve the decryption key."
Can anyone help me solve the problem?
I got the code from http://msdn.microsoft.com/en-us/library/ms229746.aspx
using...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |