Designing external stored procedures
The stored procedures can be defined either in SQL or in a high-level programming language. If their definition is written in high-level language, then they are known as external procedures. Their definition is very similar to a normal program written in a language. There could be various reasons to prefer external procedures. For instance, if we want to perform actions external to the database, then external procedures can be very useful. It could be very useful in encapsulating complex business logic in an external procedure, where we can exploit all the features of a high-level programming language.
DB2 supports the following languages for external stored procedures:
C/C++
Java
.NET common language runtime languages
OLE
Cobol
Getting ready
We need the following privileges to create a stored procedure:
CREATIN
orIMPLICIT
schema privilege, whichever is applicableIndividual privileges needed to execute all SQL statements used in the procedure