i am looking for a db2 method to import a .csv file (IMPORT.CSV) like this:
2020-01-01;1.234.567,12345
in the a DB2 table MY_TABLE:
CREATE TABLE
MY_TABLE
(
DTRIF DATE,
SALDO DECIMAL(18,5)
);
i tried "INGEST" method:
INGEST FROM FILE IMPORT.CSV FORMAT DELIMITED
(
$data date,
$decimale char(18)
)
INSERT INTO MY_TABLE(dtrif,saldo)
VALUES(
$data,
CAST(REPLACE(REPLACE($decimale, '.', ''), ',', '.') AS DECIMAL(18,5))
);
but the result is:
DTRIF SALDO
2020-01-01 12345.00000
why?
The following works correctly for me (other variations are possible) with Db2-LUW v11.1.4.5: