# 1 Catalogued SQL queries

Web Services / SQL catalog (Deprecated) / SQL Statement
The system allows to perform queries to the Axional backend via SOAP calls.
The query request must exists registered in the catalogue of a backend database dictionary, or within the master Wic.
Each query consists of two parts: a code naming the quey itself and a statement.
The Frontend always invokes the query by its code, and the underlying statement is executed, at the backend side.
As results, the dataflow prevents the transaction against the execution of arbitrary code, delivered from the client side.

Queries can have filtering parameters and variables. The filtering and output columns of the query are defined in the object wic_sqlc_object_out while variables are stored in wic_sqlc_object_colvar .

The filtering condition is constructer upon the column marked are filterable and the data sent by the client and is automatically added to the query. If the WHERE clause already contains conditions the system will look for the string $0 and will replace with the condition: ... <where> geanmovh.refter ='A' AND$0
</where>


Variable conditions allow more control over the conditions of the query. Variables are replaced using the ${VARNAME} notation. Each of the declared variables will be replaced using the value sent from the client, for instance: ... <where> geanmovh.refter =${codlab}   AND geanmovh.fecmov between ${fecini} AND${fecfin}
</where>


When a query has filtering columns or variabled defined, then in the client side an form will appear to allow to input of the filtering values

wic_sqlc_object
Label Description
Code Record identifier code
Information Information of the object

SQL query SQL query to execute

Cache indicates if the select can be cached

• Default: 0
• Values:
• 1: Yes.
• 0: No.
Created by The user who has created the record

• Default: USER
Date created Date of registering

• Default: CURRENT
Modified by The last user who has updated the record

• Default: USER
Date updated Date of the last update

• Default: CURRENT

## 1.1 Output columns and search options(wic_sqlc_object_out)

By defining output columns, a columns name can be mapped (product of an SQL/XSQL operation) to it's corresponding table name. This allows the system to identify column properties such as labels, includes.. etc that are associated with a table/column pair.

It is possible to define the visibility of a column or set a column to perform grand total sums.

It is also possible to define whether or not a column is filterable, the filter is required or the filter must perform exact matching. When a column is set to be filterable, an form box with the filterable fields appear at the left side of the table.

Here the information about each column is being defined. Information such as the label description, type and if or if not the column has includes. It might happen that a column of the SQL does not have the same name of the table where its information is saved (due to the use of alias or because the column has the properties of a fk column and the information had not been duplicated. On these situations the Real Table and the Real column data are telling us the name of the column in the SQL, while the Table and the Column are giving us the information about where to get the data related to the column.
The information found here will also indicate which columns must be filtered mandatorily, which can be filtered and which ones can't and the filtration method (exact filtering or not). Here it is also possible to indicate if a column should or should not be visible.

wic_sqlc_object_out
Label Description
Identifier ID of the SQL call
Order Order of columns
Table Table name of the column to find the table information
Real table Table name of the table where to get the label
Column Column name of the output.
Real column Name of the column in the database when searching for the column data. Only needed if the column name in the SQL is not the same than the name at the database
Filtrable Tells if the column is filterable

• Default: 0
• Values:
• 1: Yes.
• 0: No.
Filtre Required Tells if the filter is required or not

• Default: 0
• Values:
• 1: Yes.
• 0: No.
Exact filter Indicates if this column is filtered with an equality or with a LIKE(%SOMETHING%)

• Default: 0
• Values:
• 1: Yes.
• 0: No.
Total Show a summation of the column data. Only if numeric data

• Default: 0
• Values:
• 1: Yes.
• 0: No.
Hide column Hide the column

• Default: 0
• Values:
• 1: Yes.
• 0: No.

• Default: 0
• Values:
• 0: .
• 1: Internal.
• 2: External.
• 3: Dispatch. Dispatch

## 1.2 Variables (wic_sqlc_object_colvar)

At the Variables, we can create variables that can be used to build the query.

wic_sqlc_object_colvar
Label Description
ID ID of the SQL call
Order Variable request order
Variable Variable code
Table Table from which obtain the description
Description Variable description
Type Variable type

• Default: C
• Case: Upshift
• Values:
• C: Char.
• D: Date.
• T: DateTime.
• I: Integer.
• F: Decimal.
• E: Expression.
Values Variable default values

A variable is defined by its name, the code of the SQL catalogued at which it does reference and its type. Moreover, each variable may have some extra parameter such as a default value a label description and a table from where to get even extra data related to the variable like includes.