Forum Discussion

ushaplaxo's avatar
ushaplaxo
Contributor
15 years ago

How to pass SQL queries

Hello,

I have installed Soap UI Pro 4.0 beta and I would like to know how I can pass multiple sql queries to the mysql database in a test step.

Thanks,
Usha

7 Replies

  • Hi,

    How do you mean? Do you want to join the result of multiple queries into one result in a JDBC TestStep? Or just run a number of queries independently of eachother?

    regards,

    /Ole
    eviware.com
  • ushaplaxo wrote:
    Yes, I want to multiple sql queries in one JDBC test step.

    Will UNION do the trick?

    E.g:
    SELECT one, two, three UNION four, five, six


    Otherwise, I don't understand what you want to do.


    Regards

    Henrik
    eviware.com
  • Multiple inserts:
    insert into tableA (col1) values (:var1); insert into tableB (col2) values (:var2);
  • Hi again,

    Can I store my sql statements in a file. Create a file datasource test step with ";" as the separator and call each line of the file in the jdbc test step and loop back to the data source for the next line?

    Please let me know if there is any other way of doing this.

    Thanks,
    Usha
  • Hi Usha,

    that definitely sounds possible; define properties for the different "columns" in your file and then use them via property-expansion in your JDBC statement(s)..

    does that work ?

    regards,

    /Ole
    eviware.com
  • I am passing the sql statements in a script now. Looks like it works except that I get the following error:

    java.sql.SQLException: Field 'created' doesn't have a default value

    the field 'created' is of type datetime. I tried entering "yyyy-mm-dd 00:00:00", "now()", "null" as deault value, But I keep getting the same error. How do I resolve this error?

    Thanks!
    Usha