Try OpenEdge Now
skip to main content
SQL Development
Performing Multi-database Queries : Multi-database query overview : Working with catalogs in multi-database queries : Working with catalogs and stored procedures
 
Working with catalogs and stored procedures
A stored procedure may be called during a client session with multiple catalogs active.
A stored procedure in an auxiliary catalog can be called by explicitly qualifying the procedure name by the catalog name. For example:
"call sales_db.smith.total_sales(‘Mary Jones')"
The SQL statements executed from within a stored procedure are interpreted in light of the multiple catalogs active. Consider a stored procedure in an auxiliary database. Tables referenced from statements in the stored procedure, if they are not qualified by a catalog name, will refer to tables in the default catalog, or primary database. This may not be what the author of the stored procedure intended. To avoid such problems, fully qualify table names if such usage is anticipated.