To get started with the SQLRules web client read the following information.
The first step is to specify the tables and columns that are to be used by the query. There are two different ways to perform this task: either using this Web Client or uploading a JSON or XML file.
This JSON or XML string with the database schema can be be generated from your database using the XDBSchema tool.
Click the Upload Schema String, copy the schema in the text box and then click Upload this schema. This is an example of a schema file in JSON and XML:
|
|
Once you have declared the schema, you fill in the SQL Query text area, select the kind of rules to tenerate (FPC rules or SQL mutants). A set of addtional options is available in order to fine tune how the rules are generated.
Next, click the Generate button and the rules are displayed: for each rule its classification (Id, Category, Type...), and the SQL query that is to be executed for evaluating the coverage. For FPC an additional textual description of the test point requirement that is satisfied if the rule is covered is shown.
An example of a query to be used with the above schema is:
select S.empnum, sum(W.hours) from staff S left join works W on S.empnum=W.empnum group by S.empnum
Parameters, when present in a query, participate in the generation process in a similar way than columns or constants, and so, their data type must be known by the system. There are several ways to specify each parameter:
?
to denote the query parameters.
However the generated rules can alter the order and number of parameters,
preventing a safe parameter substitution when executing the query.
To avoid this, you must select the Set Numbered JDBC parameters:
The parameters will appear as ?n?
to represent the parameter that matches the n
in the query.
?n?
:name
where name
is the
parameter identifier (it may be a number).