Signing on
To join information from a table and a database record, sign on to the subschema that contains the database record and sign on to the table. Use a view id in the SIGNON statement to keep each signon active and to qualify records and tables that share the same name:
signon table emp view emptab ! signon ss=empss01 view empssc&RB.
Comparing view IDs to alias names
A view ID applies when you sign on to more than one subschema. It qualifies records or tables that have the same name in different subschemas.
An alias applies to records and tables in the SELECT statement. It qualifies fields (columns) and sets that have the same name in different records or tables.
Coding the SELECT statement
Once you have signed on to the subschemas, code the SELECT statement like this:
Example— Joining a table and a record
Join table EMP and database record DEPARTMENT to list all employees and their associated departments by:
signon ss empss01 dictname tstdict view empssc ! signon table emp dictname asfdict view emptab ! select lastname as employee, dept-name-0410 as department from emp, department where deptid = dept-id-0410
order by lastname ! display
EMP/DEPARTMENT REPORT mm/dd/yy EMPLOYEE DEPARTMENT --------------- --------------------------------------------- ANGELO PUBLIC RELATIONS BANK PUBLIC RELATIONS DOUGH INTERNAL SOFTWARE GALLWAY INTERNAL SOFTWARE GARFIELD INTERNAL SOFTWARE GRANGER INTERNAL SOFTWARE HEAROWITZ INTERNAL SOFTWARE HENDON EXECUTIVE ADMINISTRATION JACKSON PUBLIC RELATIONS JACOBI INTERNAL SOFTWARE JENSEN INTERNAL SOFTWARE LITERATA INTERNAL SOFTWARE MCDOUGALL PUBLIC RELATIONS PAPAZEUS EXECUTIVE ADMINISTRATION
|
Copyright © 2013 CA.
All rights reserved.
|
|