Skip to main content

Reference

 

OutSystems

Unexpected SQL Warning

The Unexpected SQL warning is issued in the following situations:

  • There is a mismatch between the number of select columns SELECT and the output structure in <query>

    You have an SQL query where the specified Output Structure does not match the attributes being selected. This can happen because the number of attributes is different or because there is a data type mismatch.

    Edit your query and do one of the following:

    • Change the specified Output Structure of the query;

    • Change the attributes being selected.

  • SELECT statements with 'Expand Inline' parameters cannot be validated against the output structure in <query>

    Since you have a query with expand in line parameters, it is not possible to check whether the Output Structure matches the selected attributes.

    You should open your SQL query and check whether the specified Output Structure contains the necessary attributes to fetch the selected attributes, specified in the Inline parameters.

  • SELECT statements with '*' cannot be validated against the output structure in <query>

    Since you are selecting all attributes (*) of the entities in the query, the OutSystems platform is not able to confirm that the Output Structure matches these attributes.

    You should open your SQL query and check whether the Output Structure contains the necessary attributes to hold the selected attributes. To avoid this warning it is advisable that you use SELECT {Entity}.* instead of just SELECT *.

  • There is a mismatch between the SELECT'ed entities and the output structure in <query>

    You are selecting the entities, in your query, with SELECT {Entity}.* and the output structure includes these entities or entities with the same definition. In this situation, Service Studio is not able to confirm that the Output Structure matches the selected attributes. This warning is launched when, for example, you are selecting:

    SELECT {EntityA}.* , {EntityB}.* and the order in the output structure is EntityBand EntityA.

    You should change the order by which entities are selected to make it the same as the Output Structure.

  • Unexpected <text> in SQL statements of <query>

    The SQL statement is not recognized by the OutSystems platform, but might be valid. This validation is made based on the Database module property, which indicates the database type where the module is published.

    Re-check the SQL of the query to be sure it is valid.

Double-click on the error line to take you directly to open the SQL editor where the warning was detected.

  • Was this article helpful?