Forum Discussion

peti2005's avatar
peti2005
Occasional Contributor
6 years ago

CREATE TABLE does not work from JDBC test step

Hello SoapUI community

I have SQL Server DB.

When I execute the following JDBC test step it runs without any error:

drop table if exists ##GTA_PFile100_Precondition_Result;

create table ##GTA_PFile100_Precondition_Result
(
        checkResult nvarchar(2000)
)

insert into ##GTA_PFile100_Precondition_Result (checkResult) values ('Failed');

Request Log:

2019-08-06 16:08:23 - Sql executed: drop table if exists ##GTA_PFile100_Precondition_Result;

create table ##GTA_PFile100_Precondition_Result
(
        checkResult nvarchar(2000)
);

insert into ##GTA_PFile100_Precondition_Result(checkResult) values ('Failed');
2019-08-06 16:08:23 - response time: 3ms (54 bytes)

In result the only drop command was applied to the database. The create and insert commands were not.

There are similar topics and the solution is to use the grrovy script to execute sql commands. I am curious why drop is working but create is not. Could you pls help me with it?

  • Try creating separate test steps for each statement.

    Each statement you send may produce a result set, so when SoapUI gets a result from the first statement, it stores it as the result of the test step and stops.
  • JHunt's avatar
    JHunt
    Community Hero
    Try creating separate test steps for each statement.

    Each statement you send may produce a result set, so when SoapUI gets a result from the first statement, it stores it as the result of the test step and stops.
    • peti2005's avatar
      peti2005
      Occasional Contributor

      My fault. I was creating global temporary table which exists only until the current session is open. I will close this topic.