A. CALL Proc1 ( SALES', ?) : Create Procedure Proc1 (In Var1 Varchar (10), Out RC Integer) Specific Myproc Language SQL
A. CALL Proc1 ( SALES', ?) : Create Procedure Proc1 (In Var1 Varchar (10), Out RC Integer) Specific Myproc Language SQL
A. CALL Proc1 ( SALES', ?) : Create Procedure Proc1 (In Var1 Varchar (10), Out RC Integer) Specific Myproc Language SQL
6) Given the following table and the statements within /EXEC and
/END-EXEC below:
TAB1
COL_1 COL_2
A 10
B 20
C 30
D 40
E 50
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM tab1
ORDER BY col_1
OPEN c1
FETCH c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
CLOSE c1
FETCH c1
Which of the following is the last value obtained for COL_2?
a. 20
b. 30
c. 40
d. 50
The correct answer is C. When a cursor that has been declared
with the WITH HOLD option specified (as in the example shown) is
opened, it will remain open across transaction boundaries until
it is explicitly closed; otherwise, it will be implicitly closed
when the transaction that opens it is terminated. In this
example, the cursor is opened, the first three rows are fetched
from it, the transaction is committed (but the cursor is not
closed), another row is fetched from it, and then it is closed
TAB1
COL_1 COL_2
A 10
B 20
C 30
A 10
D 40
C 30
Which of the following statements will return only one record for
each set of repeated rows
found in the final result data set produced?
a. SELECT UNIQUE * FROM tab1
b. SELECT DISTINCT * FROM tab1
c. SELECT UNIQUE(*) FROM tab1
d. SELECT DISTINCT(*) FROM tab1