{norows} Directive

Delimits the norows section

Syntax

{norows}...{/norows}

Details

The {norows} and {/norows} directive pair delimits the norows section. The norows section is a part of the query and success sections. In this section, you include the HTML elements and htmSQL directives that you want htmSQL to process when the previous SQL section does not return or update any rows. After processing a norows section in a query section, htmSQL skips to either the next SQL section or to the end of the query section, whichever comes first. After processing a norows section in a success section, htmSQL skips to the end of the success section.
When an SQL section returns or updates at least one row of data, htmSQL ignores the norows section and continues processing the input file starting with the first line after the norows section.
If you want to submit more SQL statements from within your norows section, you can do one of the following:
  • nest one or more SQL sections (with accompanying {library} directive and eachrow, success, error, and norows sections when necessary) in the norows section. All SQL statements are sent to the data source that is specified by the encompassing {query} or {update} directives.
  • nest a complete query or update section in the norows section. The SQL, eachrow, success, error, and norows sections that are within the nested section will work with data from the data source that is specified on the {query} or {update} directive.
Note: htmSQL does not limit the number of times that you can nest sections within norows sections. However, beyond a certain point, you might experience poor performance or your system might run out of memory.