- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is STORED PROCEDURE in a DB2? How will you create a new stored procedure?
The DB2 STORED PROCEDURE are the programs which are directly managed by DBMS. The STORED PROCEDURE generally contains SQLs and they can be called by application programs. The STORED PROCEDURE processes the query and returns the result to the application program. The STORED PROCEDURES can be used for the SQLs which are very often used, so instead of using the same SQL query again and again, we can simply use STORED PROCEDURE.
The other benefit of STORED PROCEDURE is that they are fast and have good performance as compared to static SQLs used in application programs. The STORED PROCEDURE can be written in many languages like COBOL, JAVA, C++, etc. Once we have written a STORED PROCEDURE in any of the languages, we have to register this STORED PROCEDURE in DB2 using below command.
CREATE PROCEDURE ORDERSTAT (IN ORDER_ID CHAR(8), OUT ORDER_STATUS CHAR(3))
A STORED PROCEDURE with the name ORDERSTAT will be created using the above command which will take the input as ORDER_ID and gives ORDER_STATUS in output.
- What is stored procedure and how can we create MySQL stored procedures?
- MySQL Stored Procedure to create a table?
- How to create MongoDB stored procedure?
- How can a MySQL stored procedure call another MySQL stored procedure inside it?
- Create a stored procedure with delimiter in MySQL
- How can a COBOL-DB2 program call a STORED PROCEDURE? Give an example.
- Set conditions in a MySQL stored procedure
- Call Stored Procedures within a Stored Procedure with IF Logic?
- How can we alter a MySQL stored procedure?
- How can we drop a MySQL stored procedure?
- How to display message from a stored procedure?
- How to create a Stored procedure in a database using JDBC API?
- Create a table inside a MySQL stored procedure and insert a record on calling the procedure
- MySQL stored procedure return value?
- MySQL stored-procedure: out parameter?