Can anyone help me with sed or awk to do a bulk replace of the below requirements.
"REC_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (
START WITH +7486
INCREMENT BY +1
MINVALUE +7467
MAXVALUE +2147483647
NO CYCLE
CACHE 20
NO ORDER ) )
The above needs to be replaced with
"REC_ID" INTEGER NOT NULL
##############################################
REC_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (
START WITH +241
INCREMENT BY +1
MINVALUE +222
MAXVALUE +2147483647
NO CYCLE
CACHE 20
NO ORDER ) ,
"SYS_START" TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW BEGIN ,
"SYS_END" TIMESTAMP(12) NOT NULL IMPLICITLY HIDDEN GENERATED ALWAYS AS ROW END ,
"TRANS_START" TIMESTAMP(12) IMPLICITLY HIDDEN GENERATED ALWAYS AS TRANSACTION START ID ,
PERIOD SYSTEM_TIME ("SYS_START","SYS_END") )
The above needs to replaced to
"REC_ID" INTEGER NOT NULL,
"SYS_START" TIMESTAMP(12) NOT NULL ,
"SYS_END" TIMESTAMP(12) NOT NULL ,
"TRANS_START" TIMESTAMP(12) )
RudiC - My apologies for not using the code. Thanks for making it code format. The statement that you mentioned is not required for the output. It is not considered as a column in the target database. So it is not required. Appreciate for any support.
I'm afraid its not too clear how to identify the partial lines / statements to be removed. While it were pretty easy to remove anything after e.g. "NOT NULL" or starting with "IMPLICITLY" or "GENERATED" I'm pretty sure someone would come back with yet another statement for which that approach would not work. On top, there seems to be an opening parethesis missing.
Please specify exactly how to identify the to be removed parts.