Progress
Programming
Handbook


Creating Aliases in Applications

You cannot assign and reference an alias in the same procedure. You must assign an alias to a logical database name prior to compiling and running procedures that use that alias. For example, alias1.p below fails to compile when it reaches the FOR EACH statement, because you cannot assign and reference the alias myalias in a single procedure:

alias1.p
/* Note that this procedure does not work */ 
CREATE ALIAS myalias FOR DATABASE sports. 
FOR EACH myalias.customer: 
  DISPLAY customer. 
END. 

To solve this problem, split alias1.p into two procedures, as in the following examples:

alias2.p
CREATE ALIAS myalias FOR DATABASE sports. 
RUN dispcust.p. 

dispcust.p
FOR EACH myalias.customer:      /* myalias.customer */ 
  DISPLAY customer.             /* myalias.customer */ 
END. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095