Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
DB2 UDB 703 - Test Sample 1. Which of The

DB2 UDB 703 - Test Sample 1. Which of The

Ratings: (0)|Views: 16|Likes:
Published by Vidhya Subramanian

More info:

Published by: Vidhya Subramanian on Jan 05, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

01/05/2010

pdf

text

original

 
DB2 UDB 703 - Test Sample1. Which of the following static SQL statements can use a hostvariable?A. FETCHB. ROLLBACK C. DROP INDEXD. ALTER TABLE2. Which of the following JDBC interfaces contains methods thatare called to determine whether or not cursors persist acrossCOMMIT boundaries?A. ResultSetB. StatementC. DatabaseMetaDataD. ResultSetMetaData3. Which of the following JDBC objects can be used to determinethe SQLSTATE if execution of a query fails?A. StatementB. ResultSetC. SQLExceptionD. ResultSetMetaData4. Which of the following can be used to access a DB2 databasefrom a workstation that does not have any DB2 code installed?A. Trigger B. Java AppletC. SQL RoutinesD. External Stored Procedure5. Which of the following programming interfaces can be used to program static queries from a Java application?A. CLIB. JTAC. JDBCD. SQLJE. OLEDB6. Given a cursor C1 on table T1. For every row fetched from T1,open a cursor C2 on table T2. For every row fetched from T2,update column C1 in table T2 and issue a COMMIT.Which of the following must define cursor C1?A. DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROMt1B. DECLARE c1 CURSOR WITH RETURN FOR SELECT *FROM t1C. DECLARE c1 CURSOR FOR SELECT * FROM t1 FOR UPDATE OF t2D. DECLARE c1 CURSOR FOR SELECT * FROM t1 FOR UPDATE OF c17. Given an ODBC/CLI program with a single connection, twothreads and the following actions:Thread 1: INSERT INTO mytab VALUES (1)Thread 2: INSERT INTO mytab VALUES (2)Thread 1: INSERT INTO mytab VALUES (3)Thread 1: ROLLBACK Thread 2: INSERT INTO mytab VALUES (4)Thread 1: COMMITAssuming that AUTOCOMMIT is ON, how many records will besuccessfully inserted into the table MYTAB?A. 1B. 2C. 3D. 48. Given a table that has columns defined:SMALLINT_COLUMN SMALLINT NOT NULLVARCHAR_COLUMN VARCHAR(20)Which of the following statements is used to retrieve rows from thetable and allows the second column to be checked for NULLvalues?A. FETCH * INTO :hv1, :hv2B. FETCH CURSOR1 INTO :hv1, :hv2C. FETCH * INTO :hv1, :hv2 :hv2indD. FETCH CURSOR1 INTO :hv1, :hv2 :hv2ind9. Given the following TWO SQL stored procedures:Procedure 1:CREATE PROCEDURE myStorproc(p1 int, p2 char)language sqlspecific spintchar BEGINIF ( P1 = 0 OR P1 = 1 ) THEN UPDATE DUMMY SET COL1 =INT(P2);END IF ;ENDProcedure 2:CREATE PROCEDURE myStorproc(p1 int)language sqlspecific spintBEGINIF ( P1 = 0 OR P1 = 1 ) THEN UPDATE DUMMY SET COL1 =P1 ;END IF ;ENDWhich of the following statements will remove Procedure 1 fromthe database?A. DROP PROCEDURE myStorproc (p1, p2)B. DROP PROCEDURE myStorproc (int, char)C. DROP SPECIFIC PROCEDURE spintchar (p1, p2)D. DROP SPECIFIC PROCEDURE spintchar (int, char)E. DROP SPECIFIC PROCEDURE myStorproc (int, char)10. During which of the following are SQL statements optimizedwhen using DB2 CLI?A. cursor openB. precompile phaseC. application bindingD. statement preparation11. Given the following table and trigger definition:TABLE: DEPTINFODeptID DeptTitle DeptCount====== ========= =========1 SALES 52 MKTG 2
 
3 DEVELOPMENT 17CREATE TRIGGER notifyAFTER UPDATE OF deptid,deptcount ON deptinfoREFERENCING OLD AS o NEW AS nFOR EACH ROW DB2SQL MODEWHEN(o.DeptCount=0 OR n.DeptId<4)BEGININSERT INTO notifylog VALUES(CURRENTTIMESTAMP,'Check on Dept Changes');ENDHow many rows will be inserted into the NOTIFYLOG table as aresult of the trigger activations caused by the successful executionof the following set of SQL statements?UPDATE DeptInfo SET DeptCount = DeptCount+1UPDATE DeptInfo SET DeptTitle = 'MARKETING' WHEREDeptId=2UPDATE DeptInfo SET DeptCount = 10 WHERE DeptID=1A. 2B. 3C. 4D. 512. Given the following embedded SQL pseudocode:Start ProgramEXEC SQL BEGIN DECLARE SECTIONUSERA CHARACTER (8)USERB CHARACTER (8)PW CHARACTER (8)COLVAL CHARACTER (16)EXEC SQL END DECLARE SECTIONEXEC SQL INCLUDE SQLCAEXEC SQL WHENEVER SQLERROR GOTO ERRCHK (program logic)(:usera contains the string "usera")( wa contains a valid password)(:userb now contains the string "userb")( wb contains a valid password)EXEC SQL CONNECT TO samplea USER :usera USING waEXEC SQL SELECT col1, col2 FROM tablea(program logic to retrieve results)EXEC SQL COMMIT(more program logic)EXEC SQL CONNECT TO sampleb USER :userb USING wbEXEC SQL SELECT col1, col2 FROM tablexEXEC SQL DELETE FROM tablea WHERE col1= :colval //1stdeleteEXEC SQL COMMIT(more program logic)EXEC SQL SET CONNECTION sampleaEXEC SQL DELETE from tablea where col1= :colval //2nd deleteEXEC SQL COMMITEXEC SQL CONNECT RESETERRCHK (check error information in SQLCA)(Cleanup)End ProgramWhat table will be updated in "samplea" if the second DELETEcompletes successfully?A. usera.tablexB. userb.tableaC. usera.tableaD. userb.tablex13. Which of the following ODBC/CLI statement handle attributes permits an application to change the memory address of all bound parameter markers without making any ODBC/CLI API calls?A. SQL_ATTR_PARAM_BIND_TYPEB. SQL_ATTR_PARAM_STATUS_PTR C. SQL_ATTR_PARAM_OPERATION_PTR D. SQL_ATTR_PARAM_BIND_OFFSET_PTR 14. Given a table created using the statement:CREATE TABLE abc.stuff (i INT)A user called XYZ is to be enabled to access data from tableABC.STUFF using an implicit schema.Assuming the necessary privileges have been granted, which of thefollowing statements issued by user ABC will provide this result?A. CREATE ALIAS stuff FOR abc.stuff B. CREATE VIEW abc.stuff FOR xyz.stuff C. CREATE ALIAS abc.stuff FOR xyz.stuff D. CREATE VIEW xyz.stuff AS SELECT i FROM abc.stuff 15. Which of the following is required to successfully execute aDB2 Call Level Interface (CLI) application?A. The user must have EXECUTE privilege on the application.B. The developer must have EXECUTE privilege on theapplication.C. The user must have sufficient privileges on referenced tables.D. The developer must have sufficient privileges on referencedtables.16. USERA has authority to access all tables in a database. WhichDB2 application development interface should be used to restrictUSERA from accessing tables with payroll information duringapplication runtime?A. CLIB. JDBCC. Embedded static SQLD. Embedded dynamic SQL17. Given the following:EXEC SQL BEGIN DECLARE SECTION;char var1[20];short var2;EXEC SQL END DECLARE SECTION;Which two of the following examples correctly demonstrate the useof host variables within an SQL statement?

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->