Which of the following statements about stored procedures is TRUE?
Which of the following statements about stored procedures is TRUE?
There are three main types of stored procedures which can be deployed: SQL procedures, external procedures, and sourced procedures. SQL procedures are written using SQL and run within the database server. External procedures are written in an external programming language and linked to the database. Sourced procedures are based on an existing procedure. These distinctions cover the general categories of stored procedures in many relational database management systems.
The answer A is wrong because stored procedures can be written in SQL and in PL/SQL diaclect (iif you enable DB2_COMPATIBILITY_VECTOR at 800 or at ORA). The answer C is not totally correct : You have at least 4 types of stored procedures : SQL procedures, external procédures, sourced procedures and PL/SQL procedures (for the oracle compatibility). The anwser D is wrong because no two identically-named procedures within a schema are permitted to have exactly the same number of parameters. A duplicate signature raises an SQL error (SQLSTATE 42723). For example, given the statements: CREATE PROCEDURE PART (IN NUMBER INT, OUT PART_NAME CHAR(35)) ... CREATE PROCEDURE PART (IN COST DECIMAL(5,3), OUT COUNT INT) ...Kopieren the second statement will fail because the number of parameters in the procedure is the same, even if the data types are not.
The answer B is correct. The CREATE PROCEDURE (sourced) statement defines a procedure (the sourced procedure) that is based on another procedure (the source procedure). In a federated system, a federated procedure is a sourced procedure whose source procedure is at a supported data source. Example : CREATE PROCEDURE FEDEMPLOYEE SOURCE USER1.P1.EMPLOYEE FOR SERVER S1 WITH RETURN TO CLIENT ALL 2/ Three different types of procedures can be created using this statement "CREATE PROCEDURE". Each of these types is described separately. a) External. The procedure body is written in a programming language. The external executable is referenced by a procedure defined at the current server, along with various attributes of the procedure. b) Sourced. The procedure body is part of the source procedure, which is referenced by the sourced procedure that is defined at the current server, along with various attributes of the procedure. A sourced procedure whose source procedure is at a data source is also called a federated procedure. c) SQL. The procedure body is written in SQL and defined at the current server, along with various attributes of the procedure.
C https://www.ibm.com/docs/en/db2/11.1?topic=statements-create-procedure