Forum Discussion

TomK's avatar
TomK
Contributor
16 years ago

Groovy script to setup test DB

Hi all,

I have been using groovy script to setup the test DB from a set of test data from another database (we have lots of test data).

Is there a way in Groovy (I admit I'm not an expert on Groovy) to insert the data from one DB to another DB without having to explicitly set the column names? It's getting a little labour intensive and it would be great help to have a script to iterate through the table and insert those rows in the test DB without having to manually create the SQL with the column names.

Essentially I want to retrieve the column names from the result set.

Thanks,

Tom

2 Replies

  • svreddyt's avatar
    svreddyt
    Occasional Contributor
    Hi all,

    I have been using groovy script to setup the test DB from a set of test data from another database (we have lots of test data).

    Is there a way in Groovy (I admit I'm not an expert on Groovy) to insert the data from one DB to another DB without having to explicitly set the column names? It's getting a little labour intensive and it would be great help to have a script to iterate through the table and insert those rows in the test DB without having to manually create the SQL with the column names.

    Essentially I want to retrieve the column names from the result set.

    Thanks,
  • svreddyt's avatar
    svreddyt
    Occasional Contributor
    Hi Ole

    I am also looking same kind of scenario could please help me how to proceed with below scenario

    I have been using groovy script to setup the test DB from a set of test data from another database (we have lots of test data).

    Is there a way in Groovy (I admit I'm not an expert on Groovy) to insert the data from one DB to another DB without having to explicitly set the column names? It's getting a little labour intensive and it would be great help to have a script to iterate through the table and insert those rows in the test DB without having to manually create the SQL with the column names.

    Essentially I want to retrieve the column names from the result set.

    Thanks,
    SR