Which of the following records would be returned by the following statement?
Given the following set of statements:
CREATE TABLE tab1 (col1 INTEGER, col2 CHAR(20));
COMMIT;
INSERT INTO tab1 VALUES (123, ‘Red’);
INSERT INTO tab1 VALUES (456, ‘Yellow’);
SAVEPOINT s1 ON ROLLBACK RETAIN CURSORS;
DELETE FROM tab1 WHERE col1 = 123;
INSERT INTO tab1 VALUES (789, ‘Blue’);
ROLLBACK TO SAVEPOINT s1;
INSERT INTO tab1 VALUES (789, ‘Green’);
UPDATE tab1 SET col2 = NULL WHERE col1 = 789;
COMMIT;
Which of the following records would be returned by the following statement?
SELECT * FROM tab1
Which of the following is the last value obtained for COL_2?
Given the following table:
TAB1
COL1 COL2
—– —–
A 10
B 20
C 30
D 40
E 50
And the following SQL statements:
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?
What is the correct way to invoke this procedure from the command line processor (CLP)?
A stored procedure has been created with the following statement:
CREATE PROCEDURE proc1 (IN var1 VARCHAR(10), OUT rc INTEGER)
SPECIFIC myproc LANGUAGE SQL …
What is the correct way to invoke this procedure from the command line processor (CLP)?
Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?
Given the following table:
TEMP_DATA
TEMP DATE
—– —–
45 12/25/2006
51 12/26/2006
67 12/27/2006
72 12/28/2006
34 12/29/2006
42 12/30/2006
And the following SQL statement:
CREATE FUNCTION degf_to_c (temp INTEGER)
RETURNS INTEGER
LANGUAGE SQL
CONTAINS SQL
NO EXTERNAL ACTION
DETERMINISTIC
BEGIN ATOMIC
DECLARE newtemp INTEGER;
SET newtemp = temp – 32;
SET newtemp = newtemp * 5;
RETURN newtemp / 9;
END
Which two of the following SQL statements illustrate the proper way to invoke the scalar function
DEGF_TO_C?
What is the result of the following XQuery expression?
Given the following CREATE TABLE statement:
CREATE TABLE customer(custid INTEGER, info XML)
And the following INSERT statements:
INSERT INTO customer VALUES (1000,
‘<customerinfo xmlns=”http://custrecord.dat” custid=”1000″>
<name>John Doe</name>
<addr country=”United States”>
<street>25 East Creek Drive</street>
<city>Raleigh</city>
<state-prov>North Carolina</state-prov>
<zip-pcode>27603</zip-pcode>
</addr>
<phone type=”work”>919-555-1212</phone>
<email>john.doe@abc.com</email>
</customerinfo>’);
INSERT INTO customer VALUES (1000,
‘<customerinfo xmlns=”http://custrecord.dat” custid=”1001″>
<name>Paul Smith</name>
<addr country=”Canada”>
<street>412 Stewart Drive</street>
<city>Toronto</city>
<state-prov>Ontario</state-prov>
<zip-pcode>M8X-3T6</zip-pcode>
</addr>
<phone type=”work”>919-555-4444</phone>
<email>psmith@xyz.com</email>
</customerinfo>’);
What is the result of the following XQuery expression?
XQUERY declare default element namespace “http://custrecord.dat”; for
$info in db2-fn:xmlcolumn(‘CUSTOMER.INFO’)/customerinfo where
$info/addr/state-prov=”Ontario” return $info/name/text();
Which of the following DB2 data types does NOT have a fixed length?
Which of the following DB2 data types does NOT have a fixed length?
Which of the following is the best statement to use to create a user-defined data type that can be used to sto
Which of the following is the best statement to use to create a user-defined data type that can be
used to store currency values?
Which of the following DB2 data types can be used to store 1000 MB of single-byte character data?
Which of the following DB2 data types can be used to store 1000 MB of single-byte character
data?
Which of the following DB2 data types can NOT be used to create an identity column?
Which of the following DB2 data types can NOT be used to create an identity column?
Which of the following strings can NOT be inserted into an XML column using XMLPARSE()?
Which of the following strings can NOT be inserted into an XML column using XMLPARSE()?