db2topg.pl is throwing error
swapnilvaze opened this issue · 8 comments
Hello,
We created DDLs from DB2 zOS system and tried to run script in below format:
./db2topg.pl -f sql1.txt -o testdir
It throws below error:
I don't understand <CREATE TABLE "A90DVDT"."DLR_FAM_MRKTSHR_FY_END"
at ./db2topg.pl line 880, line 24.
For testing we used file with below content:
cat sql1.txt
-- This CLP file was created using DB2LOOK Version "10.5"
-- Timestamp: Tue Dec 6 04:14:28 CST 2016
-- Database Name: DB239
-- Database Manager Version: DB2 Version 11.1.0
-- Database Codepage: 1208
-- DDL Statements for Table "A90DVDT"."DLR_FAM_MRKTSHR_FY_END"
CREATE TABLE "A90DVDT"."DLR_FAM_MRKTSHR_FY_END"
(
"DEALER_ID" CHAR(6) NOT NULL ,
"MKTSHR_MONTH" DATE NOT NULL ,
"L12_DP_DLR_IN_AOR" DECIMAL(15,6) ,
"L12_DP_DLR_OUT_AOR" DECIMAL(15,6) ,
"L12_DP_DLR_SHARE" DECIMAL(8,5) ,
"L12_SA_DLR_SHARE" DECIMAL(8,5) ,
"L12_CA_DLR_SHARE" DECIMAL(8,5) ,
"L12_U90_DLR_IN_AOR" DECIMAL(15,6) ,
"L12_U90_DLR_OUT_AOR" DECIMAL(15,6) ,
"L12_U90_DLR_SHARE" DECIMAL(8,5)
);
We tried removing double quotes and all comments from file, still we are receiving same error.
Thanks,
Swapnil Vaze
Hi,
Please don't remove the quotes, they are accepted by the program.
It seems that there are subtle differences (maybe with db2 zos). The db2 dumps I got till today were all putting the closing parentheses at the end of the line.
Could you send me the whole script so I can correct all problems directly instead of going back and forth ?
If that's ok, please email it to cousinmarc at gmail dot com
Regards
What you sent me doesn't remotely resemble to what you put in this issue: double quotes are gone, carriage returns aren't at the same place… please send me the original file
Ok, that's what I feared… DB2 UDB and DB2 zOS dumps are quite different. Making this script work with DB2 zOS means modifying a lot of things. It amounts to writing a new program.
I've modified the README to specify that this script only works with UDB.
Please, i have DB2 UDB and have the same problem
[db2inst1@ltdedb16 db2topg]$ ./db2topg.pl -f my_db2_sql_script.sql -o my_output_dir -d INTELID -u db2inst1 -p teste
I don't understand <ALTER STOGROUP "IBMSTOGROUP"
at ./db2topg.pl line 880, line 21.
Please send me the sql file at cousinmarc at gmail dot com
(I will keep it private of course)