Which of the following statements about stored procedures is TRUE?
A.
Stored procedures can be written in SQL PL, but not in the PL/SQL dialect
B.
The CREATE SOURCED PROCEDURE statement defines a procedure that is based on another procedure in a federated database
C.
There are three types of stored procedures which can be deployed: SQL procedures, external procedures, and sourced procedures
D.
Two identically-named procedures within a schema are permitted to have exactly the same number of parameters, but the parameters must have different data types assigned
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.
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
JamesBond
3 years, 4 months agodb2tester
5 years, 1 month agodb2tester
5 years, 1 month ago