× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 02-Aug-2016 15:02 -0500, David Gibbs wrote:

Does anyone know where the rules for database trigger names are
defined (added using ADDPFTRG)?


The rules for SQL /object/ Identifiers would be applicable. Though the "Object Naming Rules" for the OS are quite similar if not the same.

The Trigger (TRG) help suggests the following, which is quite nearly the same as OS object names [without the 10-char limit]:

"Specify the name of the trigger. The trigger name must be unique to the library. The trigger name is used to distinguish triggers with the same time and event values. You can specify a maximum of 128 characters without delimiters or 258 characters with quotation mark (") delimiters."

Given the catalog files limit SQL identifiers to 128 characters, I suspect the reference to 258 may be an error; more likely, up to 130 characters with the delimiters included -- the catalogs drop the delimiters. The "SQL Limits" docs agree with the 128 limit:
[http://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/db2/rbafzlimtabs.htm] "… Table 1. Identifier Length Limits …"

So anyhow, almost surely the Trigger (TRG) parameter was defined using the Parameter (PARM) [Qualifier Definition (QUAL), had the Trigger Library (TRGLIB) not been separate] with *NAME for the Type Of Value (TYPE) specification; and presumably with the length-limit of 128 enforced. From that help text:

"*NAME
The qualifier is a character string that represents a name.
The maximum length of the name is 256 characters. The first
character must be alphabetic or one of the special characters,
$, @, or #. The remaining characters can be alphanumeric, a
period, an underscore, or one of special characters, $, @, or #.
The name can also be a string of characters starting and ending
with double quotation marks (") or enclosed in parentheses. …"

IBM i V5R4->i5/OS Information Center, Version 5 Release 4->Programming->Control language->CL concepts->i5/OS objects->Object naming rules->Names (*NAME)
[https://www.ibm.com/support/knowledgecenter/ssw_i5_54/rbam6/rbam6names.htm]
"Names (*NAME)

When you create basic names and basic names in quoted form, follow these rules.

*NAME (basic name in unquoted form)

Every basic name can begin with the characters A-Z, $, #, or @ and can be followed by up to nine characters. The remaining characters can include the same characters as the first but can also include numbers 0-9, underscores (_), and periods (.). Lowercase letters are changed to uppercase letters by the system. Basic names used in IBM-supplied commands can be no longer than 10 characters. However, in your own commands, you can define parameters of type *NAME (specified on the TYPE parameter of the PARM or ELEM statements) with up to 256 characters.

Examples of basic names are shown as follows:

A987@.442# ONE_NAME LIB_0690 $LIBX

Names can be entered in quoted or unquoted form. If you use the quoted form, the following rules and considerations also apply:

*NAME (basic name in quoted form)

Every quoted name must begin and end with a quotation mark ("). The middle characters of a quoted name can contain any character except , *, ?, ', ", hex 00 through 3F, or hex FF, and is delimited by a slash. Quoted names allow you to use graphic characters in the name. The quoted form of basic names used in IBM-supplied commands can be no longer than 8 characters (not including the quotation marks). In your own commands, you can define parameters of type *NAME in quoted form with up to 254 characters (not including the quotation marks).

Note: Only basic names can be used in quoted form.

Examples of quoted names are shown as follows:

"A" "AA%abc" "ABC%%abc"

…"

Note: The first of the quoted names just above is a poor example, per later in the above [but past the ellipses] explains that "If a name enclosed in quotation marks is a valid unquoted basic name, the quotation marks are removed. Thus, "ABC" is equivalent to ABC. Because the quotation marks are removed, they are not included in the length of the name. "ABCDEFGHIJ" is, therefore, a valid name on IBM* commands even though it is longer than 10 characters."


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.