troubleshooting Question

stored procedure with multiple functionality for dropping and creating indexes

Avatar of sam2929
sam2929 asked on
DB2COBOL
74 Comments1 Solution1910 ViewsLast Modified:
Hi there,
Can any let me know if it is possible to have procedure with below functionality?
The stored procedure should have the following functionality:
Should have an argument for the table schema name.
Should have an argument for the table name.
Should have an argument for creating or deleting the indexes for the specified table.
Should have an argument for  performing the action (creating or deleting) on all secondary indexes for the specified table. True by default. If set to false all indexes regardless of type (eg. unique , not unique) .
Should have an override to drop or create specific indexes.
Be dynamic to allow other table indexes to dropped and recreated in this fashion (investigate using the system catalogs).
Ignore (do not raise an error) when dropping indexes that are not found for the specified table in the database.
Ignore (do not raise an error) when creating indexes already exiting for the specified table in database.
ASKER CERTIFIED SOLUTION
Kent Olsen
Data Warehouse / Database Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 74 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 74 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros