{success} Directive

Delimits the success section

Syntax

{success}...{/success}

Details

The {success} and {/success} directive pair delimits the success section. The success section is a part of the update section. In this section, you include the HTML elements and htmSQL directives that you want htmSQL to process when the previous SQL section completes with a return code of zero.
When an SQL section returns with a return code that is not equal to zero, htmSQL ignores the success section.
The success section can include a norows section for instances where no rows are updated.
If you want to submit more SQL statements from within your success section, you can do one of the following:
  • nest one or more SQL sections (with accompanying {library} directive and success, error, and norows sections when necessary) in the success section. All SQL statements are sent to the data source that is specified by the encompassing {update} directive.
  • nest a complete update section in the success section, and use the {update} directive to specify a different data source. The SQL, success, error, and norows sections that are within the nested section will work with data from this new data source.
  • nest a complete query section in the success section to query data from the same data source or from a different data source.
Note: htmSQL does not limit the number of times that you can nest sections within success sections. However, beyond a certain point, you might experience poor performance or your system might run out of memory.