13 years ago
SQL interpreter
Hi,
I use Squirrel SQL Client to test SQL Queries before I use them in SoapUI test cases. However, SoapUI did something surprising when I used one I have tested successfully in Squirrel.
I have a database table ‘MAIN_TABLE’ which connects to two other tables, SUB_TABLE_A and SUB_TABLE_B. I want to change only the record of MAIN_TABLE which connects to SUB_TABLE_A with a specific value and to SUB_TABLE_B with a specific value.
This query I used to connect to a DB2 database – it worked in Squirrel:
However, SoapUI interprets this by only executing ‘UPDATE DB.MAIN_TABLE
Set DB.MAIN_TABLE.PROPERTYTOCHANGE='a'’, resulting in a change for the whole column ‘PROPERTYTOCHANGE’ of table MAIN_TABLE.
This query works in SoapUI with the expected result:
Why does the first query work differently in SoapUI? Are there any SQL statements not supported in SoapUI? Any links or information on differing SQL interpretations will be more than welcome.
Greetings, Albert
I use Squirrel SQL Client to test SQL Queries before I use them in SoapUI test cases. However, SoapUI did something surprising when I used one I have tested successfully in Squirrel.
I have a database table ‘MAIN_TABLE’ which connects to two other tables, SUB_TABLE_A and SUB_TABLE_B. I want to change only the record of MAIN_TABLE which connects to SUB_TABLE_A with a specific value and to SUB_TABLE_B with a specific value.
This query I used to connect to a DB2 database – it worked in Squirrel:
Update DB.MAIN_TABLE
Set DB.MAIN_TABLE.PROPERTYTOCHANGE='main'
Where Exists
(Select * From DB.MAIN_TABLE
Inner Join DB.SUB_TABLE_B
On DB.MAIN_TABLE.SUB_TABLE_B_ID=DB.SUB_TABLE_B.ID
Inner Join DB.SUB_TABLE_A
On DB.MAIN_TABLE.SUB_TABLE_A_ID=DB.SUB_TABLE_A.ID
Where DB.SUB_TABLE_B.ONEPROPERTY='b' AND DB.SUB_TABLE_A.OTHERPROPERTY='a')
However, SoapUI interprets this by only executing ‘UPDATE DB.MAIN_TABLE
Set DB.MAIN_TABLE.PROPERTYTOCHANGE='a'’, resulting in a change for the whole column ‘PROPERTYTOCHANGE’ of table MAIN_TABLE.
This query works in SoapUI with the expected result:
Update DB.MAIN_TABLE
Set DB.MAIN_TABLE.PROPERTYTOCHANGE='main'
Where DB.MAIN_TABLE.ID in
(Select DB.MAIN_TABLE.ID From DB.MAIN_TABLE
Inner Join DB.SUB_TABLE_B
On DB.MAIN_TABLE.SUB_TABLE_B_ID=DB.SUB_TABLE_B.ID
Inner Join DB.SUB_TABLE_A
On DB.MAIN_TABLE.SUB_TABLE_A_ID=DB.SUB_TABLE_A.ID
Where DB.SUB_TABLE_B.ONEPROPERTY='b' AND DB.SUB_TABLE_A.OTHERPROPERTY='a')
Why does the first query work differently in SoapUI? Are there any SQL statements not supported in SoapUI? Any links or information on differing SQL interpretations will be more than welcome.
Greetings, Albert