최신IBM DB2 9.7 Application Development - 000-543무료샘플문제
문제1
A PHP application using the ibm_db2 extension encounters an error executing the SQL shown
below:
<?php
$applicant = array( $_POST["userid"] );
$stmt = db2_prepare( $conn, "INSERT INTO hr.applicants (userid) VALUES ( ? )" );
if ($stmt) {
$result = db2_execute( $stmt, $applicant );
if (!result) {
// Handle Errors
}
}
>
Which command retrieves the SQLSTATE explaining the error?
A PHP application using the ibm_db2 extension encounters an error executing the SQL shown
below:
<?php
$applicant = array( $_POST["userid"] );
$stmt = db2_prepare( $conn, "INSERT INTO hr.applicants (userid) VALUES ( ? )" );
if ($stmt) {
$result = db2_execute( $stmt, $applicant );
if (!result) {
// Handle Errors
}
}
>
Which command retrieves the SQLSTATE explaining the error?
정답: A
문제2
A CLI/ODBC application contains the lines of code shown below:
SQLHANDLE hstmt; /* statement handle */
SQLCHAR *stmt = (SQLCHAR *)"DELETE FROM org WHERE deptnumb = ? ";
SQLSMALLINT parameter1=5;
SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
SQLSetStmtAttr(hstmt, SQL_ATTR_DEFERRED_PREPARE, SQL_DEFERRED_PREPARE_OFF
);
If table ORG does not exist, which two CLI/ODBC APIs will return SQL_ERROR in the variable RC? (Choose two.)
A CLI/ODBC application contains the lines of code shown below:
SQLHANDLE hstmt; /* statement handle */
SQLCHAR *stmt = (SQLCHAR *)"DELETE FROM org WHERE deptnumb = ? ";
SQLSMALLINT parameter1=5;
SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
SQLSetStmtAttr(hstmt, SQL_ATTR_DEFERRED_PREPARE, SQL_DEFERRED_PREPARE_OFF
);
If table ORG does not exist, which two CLI/ODBC APIs will return SQL_ERROR in the variable RC? (Choose two.)
정답: C,D
문제3
Which two SQL statements demonstrate the correct usage of a parameter marker? (Choose two.)
Which two SQL statements demonstrate the correct usage of a parameter marker? (Choose two.)
정답: B,D
문제4
Which two C# .NET code snippets illustrate the valid execution of a SQL statement through the IBM Data Server Provider for .NET? (Choose two.)
Which two C# .NET code snippets illustrate the valid execution of a SQL statement through the IBM Data Server Provider for .NET? (Choose two.)
정답: A,C
문제5
Click the Exhibit button. CREATE FUNCTION deptemployees (idept VARCHAR(3)) RETURNS TABLE (empno CHAR(6), firstnameVARCHAR(12), lastnameVARCHAR(15)) LANGUAGE SQL READS SQL DATA NO EXTERNAL ACTION DETERMINISTIC RETURN SELECT empno, firstnme, lastname FROM employee WHERE workdept = deptemployees.idept; Referring to the exhibit, what contains the proper way to invoke the DEPTEMPLOYEES() user-defined function to return all of the employees that work in department D11?
Click the Exhibit button. CREATE FUNCTION deptemployees (idept VARCHAR(3)) RETURNS TABLE (empno CHAR(6), firstnameVARCHAR(12), lastnameVARCHAR(15)) LANGUAGE SQL READS SQL DATA NO EXTERNAL ACTION DETERMINISTIC RETURN SELECT empno, firstnme, lastname FROM employee WHERE workdept = deptemployees.idept; Referring to the exhibit, what contains the proper way to invoke the DEPTEMPLOYEES() user-defined function to return all of the employees that work in department D11?
정답: B
문제6
Given the two tables shown below: COUNTRIES
COUNTRY CONTINENT_ID Greece 1 Germany 1 Canada 2 CONTINENTS
ID CONTINENT 1 Europe 2 North America 3 Asia A user wants the following result: COUNTRY CONTINENT Greece Europe Which query should the user submit to achieve the result?
Given the two tables shown below: COUNTRIES
COUNTRY CONTINENT_ID Greece 1 Germany 1 Canada 2 CONTINENTS
ID CONTINENT 1 Europe 2 North America 3 Asia A user wants the following result: COUNTRY CONTINENT Greece Europe Which query should the user submit to achieve the result?
정답: D
문제7
An application must insert values into a column that has a TIMESTAMP data type. What is a valid string representation of a TIMESTAMP?
An application must insert values into a column that has a TIMESTAMP data type. What is a valid string representation of a TIMESTAMP?
정답: A
문제8
Click the Exhibit button. PRODUCTS ID NAME QUANTITY
1 Orange juice 30
2 Milk 25 Given the table shown in the exhibit.
Which values will be returned by query shown below?
SELECT XMLGROUP(
id as "Id",name as "Name",quantity as "Quantity"
OPTION ROW "Product") as Products
FROM products
Click the Exhibit button. PRODUCTS ID NAME QUANTITY
1 Orange juice 30
2 Milk 25 Given the table shown in the exhibit.
Which values will be returned by query shown below?
SELECT XMLGROUP(
id as "Id",name as "Name",quantity as "Quantity"
OPTION ROW "Product") as Products
FROM products
정답: C
문제9
Click the Exhibit button.
<personinfo>
<name>John Smith</name>
<address type="private">
<city>New York</city>
<country>US</country>
<phone>850-734-6672</phone>
</address>
<phone type="mobile">796-858-1272 </phone>
<phone type="security">646-252-1053</phone>
</personinfo>
The table PERSON is declared as shown below:
CREATE TABLE person (id BIGINT, info XML)
The document shown in the exhibit is successfully inserted into the table.
How many rows will be returned for the following statement?
SELECT t.* FROM
xmlapp.PERSON,
XMLTABLE (
'$INFO/personinfo'
COLUMNS
name VARCHAR(30) PATH './name',
phone VARCHAR(30) PATH './phone'
) AS t
Click the Exhibit button.
<personinfo>
<name>John Smith</name>
<address type="private">
<city>New York</city>
<country>US</country>
<phone>850-734-6672</phone>
</address>
<phone type="mobile">796-858-1272 </phone>
<phone type="security">646-252-1053</phone>
</personinfo>
The table PERSON is declared as shown below:
CREATE TABLE person (id BIGINT, info XML)
The document shown in the exhibit is successfully inserted into the table.
How many rows will be returned for the following statement?
SELECT t.* FROM
xmlapp.PERSON,
XMLTABLE (
'$INFO/personinfo'
COLUMNS
name VARCHAR(30) PATH './name',
phone VARCHAR(30) PATH './phone'
) AS t
정답: D
문제10
A PHP Web application uses the ibm_db2 extension to establish a persistent connection to a remote database. What must be true of the connections to make full use of the db2_pconnect() API?
A PHP Web application uses the ibm_db2 extension to establish a persistent connection to a remote database. What must be true of the connections to make full use of the db2_pconnect() API?
정답: D