Previous Topic: Operand DefinitionsNext Topic: Operand Definitions


DEFINE AUTHORIZATION Command (CA Datacom SQL Access)

The DEFINE AUTHORIZATION command creates an alternate plan for a program that uses CA Datacom SQL access. The new plan is identified by a name created from the authorization ID, program name, and version number specified in the DEFINE AUTHORIZATION command. You can enter this command as DEFINE AUTHORIZATION or as DEFINE ATZ, DEFINE AUT, or as DEFINE AUTH. You must enter the command from the system that contains the program object. It cannot create the plan from a program in load module format. This command must be executed before a load module for the program is created in the environment. This system name is also used in the new plan name. If a plan already exists with the same name (including the authorization ID), that plan is deleted before the new plan is created. The new plan then takes the place of the old one.

The only thing that changes for the new plan is the authorization ID. The SQL statements are extracted from the existing program object. In the new plan, statements that reference resources defined in the program resource fill‑in as QUAL=N are referenced with the authorization ID specified in the DEFINE AUTHORIZATION command. All other references in the new plan remain the same as in the original plan.

The DEFINE AUTHORIZATION command can also be used to create a plan after a CA Ideal program has been object transported to a production environment. Use of this command replaces the need to transport the plan from the development environment using the utility DDTRSLM.

The statement‑IDs for each statement must match in every plan associated with the program or a runtime error occurs. This type of error can happen if the CA Datacom utility DDTRSLM exports a plan without its associated program, or if the CA Ideal Object Transport Utility transports a program object without its associated plan.

If you need to change plan options for the new plan, use the ALTER PROGRAM ENVIRONMENT command to change the program object after creating the new plan. Then enter the REBIND command, specifying the authorization ID of the new plan on the REBIND command.

This command has the following format:

DEFINE AUTHORIZATION authid FOR PROGRAM name VERSION ver