Groovy SQL with dynamic insert

245 Views Asked by At

I'm writing a groovy script to archive data from a table of live database to an archive database (schemas). at present the table structure is same in both database schemas. that might get changed by adding new columns to the live table later based on the project requirements. doing those changes to the archive table is possible manually.

But my question here is, after writing the SQL inserts like :

insert into live.tableName (col1, col2,...coln) values (val1,val2,..,valn);

in the groovy script would crash if such indecent happens to be in the future. so is there any good way of doing these sort of requirement in groovy/ groovy sql ? please help or suggest a proper mechanism please.

0

There are 0 best solutions below