DB2 9.7 Application Development v6.0 (C2090-543)

Page:    1 / 7   
Total 100 questions

In a PHP script, which ibm_db2 functions should be used if the user wants to retrieve a row in a result set as an array, indexed by column name?

  • A. db2_fetch_both()
  • B. db2_fetch_array()
  • C. db2_fetch_object()
  • D. db2_fetch_assoc()


Answer : D

In a PHP script, which ibm_db2 functions can be used to retrieve the result set of a query executed against a database table?

  • A. db2_next_result()
  • B. db2_fetch_array()
  • C. db2_execute()
  • D. db2_result()


Answer : B

Which statement(s) will create and bind the package for the program myprogram.sqc?

  • A. BIND myprogram.bnd
  • B. PRECOMPILE myprogram.sqc
  • C. gcc myprogram.sqc -o myprogram BIND myprogram.bnd
  • D. gcc myprogram.sqc -o myprogram REBIND myprogram.sqc


Answer : B

Click the Exhibit button.
UPDATE DBM CFG USING FEDERATED YES;
db2stop;
db2start;
CONNECT TO test;
CREATE WRAPPER oledb LIBRARY 'db2oledb';

CREATE SERVER nwind -

WRAPPER oledb -
OPTIONS (CONNECTSTRING 'Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=f:Northwind.mdb;', COLLATING_SEQUENCE 'Y');
CREATE FUNCTION nwind.customers()
RETURNS TABLE (customerid CHAR(5),
companyname VARCHAR(40),
contactname VARCHAR(30),
contacttitle VARCHAR(30),
address VARCHAR(60),
city VARCHAR(15),
region VARCHAR(15),
postalcode VARCHAR(15),
country VARCHAR(24),
phone VARCHAR(24),
fax VARCHAR(24))

LANGUAGE OLEDB -
EXTERNAL NAME 'nwind!customers';
COMMIT;
CONNECT RESET;
A DB2 Command Line Processor script file containing the commands and statements shown in the exhibit was executed successfully.
Which statement can be used to verify that an OLE DB table function designed to retrieve data from the CUSTOMERS table of the NORTHWIND Microsoft Access database was created successfully?

  • A. SELECT companyname FROM nwind.customers()
  • B. SELECT companyname FROM TABLE (nwind.customers()) AS t
  • C. SELECT companyname FROM oledb.nwind.customers()
  • D. SELECT companyname FROM TABLE (oledb.nwind.customers()) AS t


Answer : B

A CLI/ODBC application uses the SQL FetchScroll() API to retrieve an updatable row set with five rows of data. Each column of the row set is bound to an array of application memory. The API is called with the SQL_FETCH_NEXT
FetchOrientation option and returns SQL_SUCCESS_WITH_INFO. Diagnostics show a truncation SQLSTATE of "01004".
Which API call correctly identifies the record with the failure?

  • A. SQLGetDiagField( hStmt, SQL_DIAG_ROW_COUNT, &(intVal) );
  • B. SQLGetDiagField( hStmt, SQL_DIAG_ROW_NUMBER, &(intVal) );
  • C. SQLGetDescField( hStmt, SQL_DESC_COUNT, &(intVal) );
  • D. SQLGetDescField( hStmt, SQL_DESC_ARRAY_SIZE, &(intVal) );


Answer : B

What is the final result of executing the statements shown below?

CREATE SEQUENCE order_seq -

START WITH 100 -

INCREMENT BY 25 -

MAXVALUE 150 -
CYCLE;
VALUES NEXT VALUE FOR order_seq;
VALUES NEXT VALUE FOR order_seq;
VALUES NEXT VALUE FOR order_seq;
VALUES NEXT VALUE FOR order_seq;

  • A. 100
  • B. 125
  • C. 150
  • D. 175


Answer : A

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

  • A. 2
  • B. 4
  • C. 6
  • D. 0


Answer : D

Which return codes will be returned by SQLFetch() when there are no more records to be retrieved in a result data set?

  • A. SQL_SUCCESS
  • B. SQL_NO_DATA_FOUND
  • C. SQL_WARNING
  • D. SQL_NO_MORE_DATA


Answer : B

Which three are required for a global transaction? (Choose three.)

  • A. Client Application
  • B. Transaction Manager
  • C. Workload Manager
  • D. Application Coordinator
  • E. Resource Manager


Answer : A,B,E

Given the SQL statement shown below:
UPDATE employee SET lastname = CAST(? AS VARCHAR(12))
WHERE empno = ?00050??
What does CAST(? AS VARCHAR(12)) represent?

  • A. a typed host variable
  • B. a typed parameter marker
  • C. a null indicator variable
  • D. a host parameter descriptor


Answer : B

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. rc = SQLExecute(hstmt);
  • B. rc = SQLSetConnectAttr( hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMM?IT_OFF, SQL_NTS);
  • C. rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SHORT, SQL_SMALLINT, 0, 0, ¶meter1, 0, NULL);
  • D. rc = SQLPrepare(hstmt, stmt, SQL_NTS);


Answer : A,D

When creating a trusted connection in CLI/ODBC, it is necessary to set a connection attribute.
What is the connection attribute?

  • A. SQL_ATTR_TRUSTED_CONTEXT_USERID
  • B. SQL_ATTR_TRUSTED_CONTEXT_PASSWORD
  • C. SQL_ATTR_USE_TRUSTED_CONTEXT
  • D. SQL_ATTR_ENABLE_TRUSTED_CONTEXT


Answer : C

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. The commitment control mode must be set to manual commit mode.
  • B. Connections must be established under the same user authentication credentials.
  • C. The persistent connection must be explicitly closed after the database work has completed.
  • D. The commitment control mode must be set to autocommit mode.


Answer : B

While developing a CLI application, you use the code shown below:
SQLCHAR *stmt = (SQLCHAR *)"DELETE FROM org WHERE deptnumb = ? "; cliRC = SQLSetStmtAttr(hstmt, SQL_ATTR_DEFERRED_PREPARE,
SQL_DEFERRED_PREPARE_ON )
cliRC = SQLPrepare(hstmt, stmt, SQL_NTS);
Now, the ORG table does not exist in the database.
What will be the value of "cliRC" after executing the SQLPrepare command?

  • A. SQL_SUCCESS
  • B. SQL_SUCCESS_WITH_INFO
  • C. SQL_INVALID_HANDLE
  • D. SQL_ERROR


Answer : A

What are two valid values for the PARAMETER STYLE clause in the CREATE
PROCEDURE statement? (Choose two.)

  • A. C
  • B. JAVA
  • C. SQL WITH NULLS
  • D. GENERAL WITH NULLS


Answer : B,D

Page:    1 / 7   
Total 100 questions