PlugIns JdbcSlim UserGuide 4TheMappingBetweenTestDataAndCommands
Contents:
To avoid side effects we execute the test in a transaction
| Script | SQLCommand | TransactionDatabase |
| open Connection | ||
| execute | begin transaction | |
Calling a SP/function with select
| Define Properties | StoredProcedures |
| key | value |
| .include | TransactionDatabase |
| CMD | select SQRT(%No%) as root |
| debug |
| SQLCommand | StoredProcedures |
| No | root? |
| 16 | 4.0 |
| 64 | 8.0 |
Rollback the change to not impact future tests
| Script | SQLCommand | TransactionDatabase |
| open Connection | ||
| execute | rollback | |
| close Connection | ||
Check that the rollback worked
| SQLCommand | StartupDatabase | select * from TestData | Query | |
| ID | Name | Phone | City | Profession |
| 1 | Bill | 12345 | Berlin | Doctor |
| 2 | Ben | 6789 | Denver | Artist |
| 3 | Tom | 4567890 | Seoul | Milkman |
| 4 | Till | 332211 | Berlin | Senator |
| 5 | Sarah | 999999 | Paris | Hero |
| 6 | James | #null# | London | Butler |
| 7 | Bert | 432 | Washington | President |
| 8 | Kim | 1 | New York | Banker |