Allow Simplified SQL Blocks Based on Operation Type (No Mandatory Output for Non-Select)
3884
Views
4
Comments
New
Data & Integrations

Currently, when using the Advanced SQL tool in OutSystems, developers are required to define an Output Structure even for SQL statements that do not return any data — such as INSERT, UPDATE, or DELETE queries.

This mandatory output requirement introduces unnecessary steps in the development process. It creates confusion for beginners and adds extra overhead to simple operations that are not supposed to return results.

Proposed Improvement: Introduce two different types of SQL tools to improve clarity and usability:

  • ExecuteSQL_Select: for queries that return data (e.g., SELECT).

  • ExecuteSQL_NonQuery: for queries that do not return data (e.g., INSERT, UPDATE, DELETE).

  • ExecuteSQL_Scalar: for single-value queries (e.g., COUNT, MIN, MAX).

These naming conventions are inspired by C# and other modern frameworks and would help improve developer efficiency and code readability.

This change would eliminate the unnecessary requirement of defining output structures for non-query operations and streamline the development workflow.

Capture.PNG

I think this could be really useful if implemented.

Follow-up Suggestions on the Original Idea:

Thanks again for providing a space to share feedback on how we use SQL Blocks in OutSystems.

I’d like to propose a couple of additional enhancements that would complement the original idea and improve the developer experience even further:

🔁 Suggestion #2: Define SQL Block Type Instead of Splitting Blocks

Instead of requiring us to create different types of SQL blocks (like ExecuteSQL_Select, ExecuteSQL_Scalar, ExecuteSQL_NonQuery), we can keep the current unified block but add a Type dropdown or selection (e.g., Select, Insert, Update, Delete) when writing the SQL.

  • Based on the selected type:

    • If it's Select, the platform automatically enables and validates the Output Structure.

    • If it's not Select, the Output becomes optional or hidden.

  • This avoids unnecessary errors and makes the intention of the SQL clearer from the beginning.

✨ Suggestion #3: Smart Output Requirement Based on SQL Keywords

Even without a manual selection, the platform can detect SQL keywords like SELECT and automatically enforce Output only when applicable.

  • For example: If the SQL starts with SELECT, then the Output Structure field becomes required.

  • Otherwise, the developer can skip the output field altogether.

Both of these ideas aim to make SQL usage inside OutSystems more intuitive, especially for newcomers or for rapid development. 

This seems like a very good feature it would contribute alot in making applications more maintainable and I strongly agree with the idea that it would help in avoiding confusion for beginners

Changed the category to
Data & Integrations