SAS/IntrNet 9.2: htmSQL |
In order for htmSQL to create your Web page, you must first provide htmSQL with an input file. This file contains the HTML and SQL that you want processed.
When someone wants to access your Web page, they pass a URL that contains the name and location of the input file to htmSQL. The URL can also contain information used to resolve variable references that are in the input file.
If you are not familiar with htmSQL, you can follow the link at the bottom of this page to try the sample exercise that we provide.
An input file can contain zero or more of the following elements:
variable references. The references can be to columns selected in queries, to variables specified in the URL, or to variables that htmSQL automatically defines and supplies values for. The references are replaced by the current value of the variable.
complete query sections, delimited by the
{query}
and
{/query}
directive pair.
Each query section contains at least one SQL/eachrow
section pair and can contain multiple pairs. For each SQL section,
you can include a norows section.
{sql}
and
{/sql}
directive pair and
specifies how to construct a
query that htmSQL sends to a SAS/SHARE server.
{eachrow}
and
{/eachrow}
directive pair
and describes how to display the results set.
{norows}
and
{/norows}
directive pair and contains the steps to
take when the previous SQL section does not return any rows.
complete update sections, delimited by the
{update}
and
{/update}
directive pair. Each update section
contains one or more
SQL sections. For each SQL section you can include
success and error sections.
{sql}
and
{/sql}
directive pair and
specifies how to construct an SQL statement that htmSQL sends to a
SAS/SHARE server.
{success}
and
{/success}
directive pair and contains the steps to
take when the SQL is processed with a return code of zero. The success
section can also contain a norows section.
{error}
and
{/error}
directive pair and contains the steps to
take when the SQL is processed with a nonzero return code.
{library}
directive. The {library}
directive can be included in both the query and update
sections and defines a high-level qualifier that you use in the names of tables and views in
your SQL queries and statements.
{label}
directive. The {label}
directive enables you to display the label for a column in a
results set.
included files. Use the
{include}
directive
to specify
another file for htmSQL to process before continuing with the
current file.
htmSQL comments.
All text contained between {*
and a closing brace
}
is considered an htmSQL comment and is
not written to stdout
.
Everything else in the input file is written, as is, to
stdout
. This includes text, HTML, and newline
characters.
For more information about the elements that you can use in an input file, see Syntax for htmSQL Directives. For step-by-step instructions on creating and using an htmSQL input file, see A Step-by-Step Guide to Creating an htmSQL Web Page.
For introductory exercises in using htmSQL, see Getting Started Exercises.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.