Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.4
-
None
Description
In odb, user can write a map to determine an empty string should be treated as null or empty. However, this feature not work as expected.
For example, I have a table, a map file and a data file as below(you can also refer to attached file):
>>>table:
create table testemp(id int, c1 char(20) not null, c2 char(20));
>>>map:
ID:1
C1:2:emptyasempty
C2:3
>>>data
1,,abc
2,,def
Then run odb cmd to load the data, the expected result is all data should be loaded, the atcual result is as below:
odb.exe -d 14d4 -u trafodion -p traf123 -l src=testdata.txt:tgt=testemp:map=testmap.txt
odb [2019-04-18 16:15:17]: starting ODBC connection(s)... 0
Connected to Trafodion
[0] odb [Oloadbuff(10212)] - Error loading row 1 (State: 23000, Native 0)
[TRAF][Trafodion ODBC Driver] General error. Null Value in a non nullable column. Row: 1 Column: 2
the emptyasempty option does not work as expected:
odb.exe -d 14d4 -u trafodion -p traf123 -l src=testdata.txt:tgt=testemp:map=testmap.txt:show
odb [2019-04-18 16:16:18]: starting ODBC connection(s)... 0
Connected to Trafodion
Record number 1:
COL# COLUMN_NAME ODBC_DATA_TYPE DISP_SZ DEC NULL FLD_LEN [FLD_VALUE]
0 ID SQL_INTEGER 11 0 YES 1 [1]
1 C1 SQL_CHAR 20 0 NO - [(null)]
2 C2 SQL_CHAR 20 0 YES 3 [abc]
Record number 2:
COL# COLUMN_NAME ODBC_DATA_TYPE DISP_SZ DEC NULL FLD_LEN [FLD_VALUE]
0 ID SQL_INTEGER 11 0 YES 1 [2]
1 C1 SQL_CHAR 20 0 NO - [(null)]
2 C2 SQL_CHAR 20 0 YES 3 [def]
odb [2019-04-18 16:16:20]: exiting. Session Elapsed time 2.164 seconds (00:00:02.164)
Attachments
Issue Links
- links to