How to get the output of sql queries in FitNesse + DbFit?

I'm trying to get a sql query in DBfit using ie !|Execute|select * from abc|

, but I don't know how it will display in DBfit.

+3


source to share


2 answers


I think you are looking for a table Inspect Query

(you can find reference docs on this here ).

!|Inspect Query|select * from abc|



Doing so will print the query result.

+5


source


First, the execution device is typically used for actions that do not return data, such as:

!|Execute|insert into tablename values (…)|

      

or

!|Execute|update tablename st... where...|

      

However, even some actions without data have more specific commands. The above update can be done, for example, with



!|Update|tablename               |
|field_to_change=|field_to_select|
|new value       |matching value |

      

Use the query tool to return data

!|query|select Id, BatchNum from tablename|
|Id    |BatchNum?                         |
|1     |>>Bat1                            |
|2     |<<Bat1                            |

      

As shown, just put your field names on the line below the fixture and then your data lines below that.

+3


source







All Articles