Remember To Delimit Statements Within Your Procedure; Use Fully-Qualified Names For Tables In Procedures; Specifying Dates And Times In Procedures - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Some tips for writing procedures

Remember to delimit statements within your procedure

Use fully-qualified names for tables in procedures

Specifying dates and times in procedures

266
You should terminate each statement within the procedure with a semicolon.
Although you can leave off semicolons for the last statement in a statement list,
it is good practice to use semicolons after each statement.
The CREATE PROCEDURE statement itself contains both the RESULT
specification and the compound statement that forms its body. No semicolon is
needed after the BEGIN or END keywords, or after the RESULT clause.
If a procedure has references to tables in it, you should always preface the table
name with the name of the owner (creator) of the table.
When a procedure refers to a table, it uses the group memberships of the
procedure creator to locate tables with no explicit owner name specified. For
example, if a procedure created by
specify the owner of
Table_B
or
must be a member of a group (directly or indirectly) that is the
user_1
user_1
owner of
. If neither condition is met, a table not found message results
Table_B
when the procedure is called.
You can minimize the inconvenience of long fully qualified names by using a
correlation name to provide a convenient name to use for the table within a
statement. Correlation names are described in "FROM clause" in Adaptive
Server IQ Reference Manual.
When dates and times are sent to the database from procedures, they are sent
as strings. The date part of the string is interpreted according to the current
setting of the DATE_ORDER database option. As different connections may
set this option to different values, some strings may be converted incorrectly to
dates, or the database may not be able to convert the string to a date.
You should use the unambiguous date format yyyy-mm-dd or yyyy/mm/dd when
sending dates to the database from procedures. These strings are interpreted
unambiguously as dates by the database, regardless of the DATE_ORDER
database option setting.
For more information on dates and times, see "Date and time data types" in
Adaptive Server IQ Reference Manual.
references
user_1
, then either
must have been created by
Table_B
and does not
Table_B

Advertisement

Table of Contents
loading

Table of Contents