Semantic TagsLast updated: 6/2/2023
Semantic Tags are the key ingredient in SQL+ and provide the means to fine tune every aspect of your generated code. Use this guide to gain valuable insight into how each tag performs.
SQL+ Routine Tag
The routine tag is the only tag that is required and is placed at the beginning of a stored procedure or ad-hoc query. This tag signals to the builder that the routine is available for code generation. This tag also defines the select type, accepts a comment and author name, and has the option of changing the timeout to something other than the default. Each part of this tag is covered in detail below.
--+SqlPlusRoutine --&SelectType=NonQuery or SingleRow or MultiRow or JSON or XML or MultiSet --&Comment=Comment --&Author=Author --&CommandTimeout=seconds --+SqlPlusRoutine
*Note that the command timeout is optional.*
- NonQuery – the output of the call will not contain a result set.
- SingleRow – the procedure executes a SELECT that will return a maximum of one row. Used when selecting by a primary key. Since this will return a single row, the result set is mapped to a single instance of a (result object), not a list.
- MultiRow – the procedure executes a SELECT statement that will return an undetermined number of rows. The multi-row result is mapped into a list of (result object) not a single entity.
- JSON – the procedure executes a SELECT … FOR JSON PATH. The result string is mapped to a property - JsonResult.
- MultiSet – use this in combination with Query tags for services that return multiple result sets. See Multiple Result Sets and Query Tags for additional information.
- XML – the procedure executes a SELECT … FOR XML. The result string is mapped to a property XmlResult.
Comment: This provides a comment for your service, and aids in the transfer of knowledge between the creator of the service, and developers using the service.
Author: The creator of the SQL routine. This information provides other developers the means to quickly track and resolve issues about the SQL, you can also provide an email here if so desired.
CommandTimeout: Used to override the default timeout for commands. Enter the number of seconds for the allowed execution time.