simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

ValueError: Found ALTER statement to not existed TABLE COMTCCMMNCODE with SCHEMA None

Open ivbeg opened this issue 3 years ago • 1 comments

Describe the bug ValueError 'Found ALTER statement to not existed TABLE COMTCCMMNCODE with SCHEMA None' on certain files

To Reproduce Steps to reproduce the behavior:

  1. Take file https://github.com/LeeBaekHaeng/GodTest2016/blob/a080fc963eaaf372ec5fab132b954849090a3225/god.test20170818/src/script/tibero/ddl/sts.cst_create_tibero.sql?raw=True
  2. Use code ddl = parse_from_file(filepath)
  3. See error ValueError: Found ALTER statement to not existed TABLE COMTCCMMNCODE with SCHEMA None

That's an especially strange error since no ALTER statement exists in this file.

Expected behavior DDLParserError with a clear error explanation

More examples

  • https://github.com/LeeBaekHaeng/GodTest2016/blob/a080fc963eaaf372ec5fab132b954849090a3225/god.test20170818/src/script/tibero/ddl/sts.cst_create_tibero.sql?raw=True
  • https://github.com/jaewonmun/farm/blob/a84a408bd968d7967f42055035e19a69a0fe8a5d/farmfarm/src/script/tibero/ddl/sym.ccm.cde_create_tibero.sql?raw=True
  • https://github.com/jonghwankwon/egovframe/blob/bc7c35cdf6f46d263dc4c8800cd9958fbf1f61d5/lab301-mvc/src/script/oracle/ddl/uss.ion.ism_create_oracle.sql?raw=True
  • https://github.com/dasomel/seminar/blob/8144dfa3dd4aef9b9242f608369b469bce7ffddf/opdc/30th/source/src/script/oracle/ddl/uat.uia_create_oracle.sql?raw=True
  • https://github.com/dev0000/egov-all-64bit/blob/e780b83bf71c3b0898f89c9d2fa01621056ddcaa/workspace/egov-all/src/script/tibero/ddl/uss.olp.cns_create_tibero.sql?raw=True
  • https://github.com/jang1071/sungjin/blob/351db9bb9bb52ac7ba92ed8e15919c52bc43c8c6/godsoft.test20170409/src/script/oracle/ddl/cop.ems_create_oracle.sql?raw=True

ivbeg avatar Jul 01 '22 18:07 ivbeg

Note for me: Need to add support for case

CREATE TABLE COMTCCMMNCODE
(
	CODE_ID               VARCHAR2(6)  NOT NULL ,
	CODE_ID_NM            VARCHAR2(60)  NULL ,
	CODE_ID_DC            VARCHAR2(200)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	CL_CODE               CHAR(3)  NULL ,
	FRST_REGIST_PNTTM     DATE  NULL ,
	FRST_REGISTER_ID      VARCHAR2(20)  NULL ,
	LAST_UPDT_PNTTM       DATE  NULL ,
	LAST_UPDUSR_ID        VARCHAR2(20)  NULL ,
CONSTRAINT  COMTCCMMNCODE_PK PRIMARY KEY (CODE_ID),
CONSTRAINT  COMTCCMMNCODE_FK1 FOREIGN KEY (CL_CODE) REFERENCES COMTCCMMNCLCODE(CL_CODE) ON DELETE SET NULL
);

xnuinside avatar May 14 '24 20:05 xnuinside