niusouti.com

单选题Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Li

题目
单选题
Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Line Processor?()
A

CALL increase_salary('A00')

B

VALUES increase_salary('A00')

C

CALL increase_salary('A00', ?)

D

VALUES increase_salary('A00', ?)


相似考题
更多“单选题Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Li”相关问题
  • 第1题:

    You need to design the retrieval of advertising statistics without compromising security. What should you do?()

    • A、Design a Notification Services solution that sends the advertising statistics to specified subscribers by e-mail.
    • B、Design a SQL Server Web service that runs a stored procedure to return the statistics on a call from the advertisers application.
    • C、Design a Database Mail solution that sends the advertising statistics to e-mail addresses that are specified in a table.
    • D、Design a stored procedure to return the statistics on a call from the advertisers application.
    • E、Design a user-defined function to return the statistics on a call from the advertisers application.

    正确答案:B

  • 第2题:

    You are creating the DEPT_SAL data block from the PAYHIST form. Users should be able to enter a valid department ID number, which will then display the employee salary information for that department. This data block could potentially retrieve a large number of records. Since users will probably only view a small number of these records, only 10 records should be fetched at one time. How would you create the data block?()

    • A、Select The Data Blocks node in the Object Navigator and click the Create button. Choose to build the data block manually, enter the procedure name in the Query Data Source Columns property, and the procedure code in the Query Data Source Arguments property. 
    • B、Choose Tools -> Data Block Wizard, select Table as the data source type, and base the block on the columns from the tables. 
    • C、Choose Tools -> Data Block Wizard, select, View as the data source type, and base the block on the columns from the tables. 
    • D、Select the Data Blocks node in the Object Navigator and click the Create button. Choose to build the data block manually, alter the Query Data Source Type property to 'FROM clause query', and enter the SELECT statement in the Query Data Source Name property. 
    • E、Select the Data Block node in the Object Navigator and click the Create button. Alter the Query Data Source Type, Query Data Source Name, Query Data Sources Columns, and Query Data Source Arguments properties to create a stored procedure that uses a red cursor.

    正确答案:E

  • 第3题:

    Which of the following tools for DB2 V9 allows a user to create and debug a SQL stored procedure?()

    • A、Control Center
    • B、Development Center
    • C、Developer Workbench
    • D、Stored Procedure Builder

    正确答案:C

  • 第4题:

    Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Line Processor?()

    • A、CALL increase_salary('A00')
    • B、VALUES increase_salary('A00')
    • C、CALL increase_salary('A00', ?)
    • D、VALUES increase_salary('A00', ?)

    正确答案:C

  • 第5题:

    You are creating a stored procedure that will delete data from the Contact table in a SQL Server 2005 database. The stored procedure includes the following Transact-SQL statement to handle any errors that occur. BEGIN TRY   BEGIN TRANSACTION   DELETE FROM Person.Contact WHERE ContactID = @ContactID COMMIT TRANSACTION END TRY   BEGIN CATCH   DECLARE @ErrorMessage nvarchar(2000) DECLARE @ErrorSeverity int DECLARE @ErrorState int SELECT @ErrorMessage = ERROR MESSAGE(),@ErrorSeverity=ERROR SEVERITY(),@ErrorState = ERROR STATE() RAISERROR (@ErrorMessage, @ErrorSeverity, @ErrorState) END CATCH;      You test the stored procedure and discover that it leaves open transactions. You need to modify the stored procedure so that it properly handles the open transactions. What should you do?()

    • A、Add a COMMIT TRANSACTION command to the CATCH block.
    • B、Remove the COMMIT TRANSACTION command from the TRY block.
    • C、Add a ROLLBACK TRANSACTION command to the CATCH block.
    • D、Add a ROLLBACK TRANSACTION command to the TRY block.

    正确答案:C

  • 第6题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a stored procedure. The stored procedure implements a database maintenance process. A SQL Server Agent job should be created to that runs the stored procedure. Besides this, you must make sure that after it is completed successfully, the job is removed.  What should you do? ()

    • A、You should create a job which is assigned to the Database Maintenance category
    • B、You should create an Alert which will run another to delete the maintenance job.
    • C、You should create a job. You schedule the job to run only once.
    • D、You should create a job. The job uses the Automatically delete job option

    正确答案:D

  • 第7题:

    单选题
    You are creating a stored procedure that will delete data from the Contact table in a SQL Server 2005 database. The stored procedure includes the following Transact-SQL statement to handle any errors that occur. BEGIN TRY   BEGIN TRANSACTION   DELETE FROM Person.Contact WHERE ContactID = @ContactID COMMIT TRANSACTION END TRY   BEGIN CATCH   DECLARE @ErrorMessage nvarchar(2000) DECLARE @ErrorSeverity int DECLARE @ErrorState int SELECT @ErrorMessage = ERROR MESSAGE(),@ErrorSeverity=ERROR SEVERITY(),@ErrorState = ERROR STATE() RAISERROR (@ErrorMessage, @ErrorSeverity, @ErrorState) END CATCH;      You test the stored procedure and discover that it leaves open transactions. You need to modify the stored procedure so that it properly handles the open transactions. What should you do?()
    A

    Add a COMMIT TRANSACTION command to the CATCH block.

    B

    Remove the COMMIT TRANSACTION command from the TRY block.

    C

    Add a ROLLBACK TRANSACTION command to the CATCH block.

    D

    Add a ROLLBACK TRANSACTION command to the TRY block.


    正确答案: D
    解析: 暂无解析

  • 第8题:

    单选题
    You need to design the retrieval of advertising statistics without compromising security. What should you do?()
    A

    Design a Notification Services solution that sends the advertising statistics to specified subscribers by e-mail.

    B

    Design a SQL Server Web service that runs a stored procedure to return the statistics on a call from the advertisers application.

    C

    Design a Database Mail solution that sends the advertising statistics to e-mail addresses that are specified in a table.

    D

    Design a stored procedure to return the statistics on a call from the advertisers application.

    E

    Design a user-defined function to return the statistics on a call from the advertisers application.


    正确答案: C
    解析: 暂无解析

  • 第9题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a stored procedure. The stored procedure implements a database maintenance process. A SQL Server Agent job should be created to that runs the stored procedure. Besides this, you must make sure that after it is completed successfully, the job is removed.  What should you do? ()
    A

    You should create a job which is assigned to the Database Maintenance category

    B

    You should create an Alert which will run another to delete the maintenance job.

    C

    You should create a job. You schedule the job to run only once.

    D

    You should create a job. The job uses the Automatically delete job option


    正确答案: C
    解析: 暂无解析

  • 第10题:

    单选题
    You are creating the DEPT_SAL data block from the PAYHIST form. Users should be able to enter a valid department ID number, which will then display the employee salary information for that department. This data block could potentially retrieve a large number of records. Since users will probably only view a small number of these records, only 10 records should be fetched at one time. How would you create the data block?()
    A

    Select The Data Blocks node in the Object Navigator and click the Create button. Choose to build the data block manually, enter the procedure name in the Query Data Source Columns property, and the procedure code in the Query Data Source Arguments property. 

    B

    Choose Tools -> Data Block Wizard, select Table as the data source type, and base the block on the columns from the tables. 

    C

    Choose Tools -> Data Block Wizard, select, View as the data source type, and base the block on the columns from the tables. 

    D

    Select the Data Blocks node in the Object Navigator and click the Create button. Choose to build the data block manually, alter the Query Data Source Type property to 'FROM clause query', and enter the SELECT statement in the Query Data Source Name property. 

    E

    Select the Data Block node in the Object Navigator and click the Create button. Alter the Query Data Source Type, Query Data Source Name, Query Data Sources Columns, and Query Data Source Arguments properties to create a stored procedure that uses a red cursor.


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    Which of the following tools for DB2 V9 allows a user to create and debug a SQL stored procedure?()
    A

    Control Center

    B

    Development Center

    C

    Developer Workbench

    D

    Stored Procedure Builder


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    In your multitenant container database (CDB) containing pluggable database (PDBs), the HR user executes the following commands to create and grant privileges on a procedure: CREATE OR REPLACE PROCEDURE create_test_v (v_emp_id NUMBER, v_ename VARCHAR2,v_SALARY NUMBER, v_dept_id NUMBER) BEGIN INSERT INTO hr.test VALUES (V_emp_id, V_ename, V_salary, V_dept_id); END; / GRANT EXECUTE ON CREATE_TEST TO john, jim, smith, king; How can you prevent users having the EXECUTE privilege on the CREATE_TEST procedure from inserting values into tables on which they do not have any privileges?()
    A

    Create the CREATE_TEST procedure with definer’s rights.

    B

    Grant the EXECUTE privilege to users with GRANT OPTION on the CREATE_TEST procedure.

    C

    Create the CREATE_TEST procedure with invoker’s rights.

    D

    Create the CREATE_TEST procedure as part of a package and grant users the EXECUTE privilege the package.


    正确答案: C
    解析: 暂无解析

  • 第13题:

    You need to ensure that the stored procedure that inserts new loan requests can access data in tables that are stored in another database on the same SQL Server instance. Which two actions should you perform?()

    • A、Ensure that the stored procedure and the tables are owned by users that are associated with the same SQL Server login.
    • B、Ensure that the stored procedure and the tables are owned by the same database user.
    • C、Ensure that the stored procedure and the tables use the same database schema.
    • D、Configure the multiuser database option on both databases.
    • E、Configure the cross-database ownership chaining option on both databases.

    正确答案:A,E

  • 第14题:

    The accounting manager wants you to create a form that when queried will display a calculated total of year-to-date actual expenditures for the found code entered. The values needed to generate this summary data are stored in multiple tables. Which data source type can you assign to the data block for this form without having the DBA create a database object?()

    • A、database table 
    • B、transactional trigger 
    • C、stored procedure 
    • D、FROM clause query 
    • E、client-side procedure

    正确答案:D

  • 第15题:

    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?

    • A、SELECT TABLE(EMPLIST()) FROM EMPLOYEE
    • B、SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE
    • C、SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE
    • D、SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t

    正确答案:D

  • 第16题:

    In your multitenant container database (CDB) containing pluggable database (PDBs), the HR user executes the following commands to create and grant privileges on a procedure: CREATE OR REPLACE PROCEDURE create_test_v (v_emp_id NUMBER, v_ename VARCHAR2,v_SALARY NUMBER, v_dept_id NUMBER) BEGIN INSERT INTO hr.test VALUES (V_emp_id, V_ename, V_salary, V_dept_id); END; / GRANT EXECUTE ON CREATE_TEST TO john, jim, smith, king; How can you prevent users having the EXECUTE privilege on the CREATE_TEST procedure from inserting values into tables on which they do not have any privileges?()

    • A、Create the CREATE_TEST procedure with definer’s rights.
    • B、Grant the EXECUTE privilege to users with GRANT OPTION on the CREATE_TEST procedure.
    • C、Create the CREATE_TEST procedure with invoker’s rights.
    • D、Create the CREATE_TEST procedure as part of a package and grant users the EXECUTE privilege the package.

    正确答案:C

  • 第17题:

    You are a database administrator for your company. You are responsible for a SQL Server 2005 database that has several indexes. You need to write a stored procedure that checks the indexes for fragmentation. Which Transact-SQL statement should you use?()

    • A、DBCC DBREINDEX
    • B、SELECT * FROM sys.dm_db_index_physical_stats
    • C、DBCC INDEXDEFRAG
    • D、SELECT * FROM sys.indexes

    正确答案:B

  • 第18题:

    单选题
    You are creating the SAL_INFO data block on the EMP_QUERY form. The SALARY field should only be populated if the logged-on user is a manager. Since this query could potentially return a large amount of records, you have created a stored procedure which uses a ref cursor on which to base the data block. How would you create the data block?()
    A

    Click the Data Blocks node in the Object Navigator and click the create button. Choose to build the data block manually. Enter the procedure name in the Query Data Source Columns property and the procedure code in the Query Data Source Arguments property. 

    B

    Choose Tools -> Data Block Wizard, select Table as the data source type, and base the data block on the columns included in the procedure. 

    C

    Select the Data Blocks node in the Object Navigator and click the Create button. Choose to build the data block manually, alter the Query Data Source Type property to 'Ref cursor', and enter the name of the procedure in the Query Data Source Name property. 

    D

    Select the Data Blocks node in the Object Navigator and click the Create button. Alter the Query Data Source Name, Query Data Source Columns, and Query Data Source Arguments properties to create a stored procedure that uses a ref cursor. 

    E

    Launch the Data Block Wizard, select Stored Procedures as the data source type, and base the block on the procedure.


    正确答案: A
    解析: 暂无解析

  • 第19题:

    单选题
    Given the following stored procedure:CREATE PROCEDURE increase_salary ( IN p_workdept CHAR(6), OUT p_sum DECIMAL(9,2) ) SET p_sum = (SELECT SUM(salary) FROM employee WHERE workdept=p_workdept);How can this stored procedure be called from the Command Line Processor?()
    A

    CALL increase_salary('A00')

    B

    VALUES increase_salary('A00')

    C

    CALL increase_salary('A00', ?)

    D

    VALUES increase_salary('A00', ?)


    正确答案: C
    解析: 暂无解析

  • 第20题:

    单选题
    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?
    A

    SELECT TABLE(EMPLIST()) FROM EMPLOYEE

    B

    SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE

    C

    SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE

    D

    SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    What is the proper procedure to recover a lost tempfile?()
    A

    Restore the backup copy of the tempfile from the backup media. 

    B

    Re-create the tempfile with the create tempfile command. 

    C

    Copy an existing tempfile from another database. 

    D

    Re-create the tempfile with the create tablespace command. 

    E

    Re-create the tempfile with the alter tablespace command.


    正确答案: C
    解析: 暂无解析

  • 第22题:

    单选题
    You work in a company which is named Wiikigo Corp. The company uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named DB1 in the instance. DB1 has a table which is named Table01 and a stored procedure named Procedure01. Procedure01 choose data from Table01 by using a sp_executesql Transact-SQL statement. You company security rules forbid users to access tables directly in any database. Look at the exception below: "Msg 229, Level 14, State 5, Line 1 The SELECT permission was denied on the object 'Table01', database 'DB1', schema 'dbo'." The exception is raised when Procedure01 is executed by users. You must make sure that e user can successfully execute Procedure1 complying with the company rules. So what action should you perform to achieve this goal?()
    A

    You should execute the GRANT SELECT ON dbo.Table01 TO User1 Transact-SQL statement. 

    B

    You should execute the GRANT EXECUTE ON dbo.Procedure1 TO User1 Transact-SQL statement. 

    C

    You should alter Procedure01 and add the WITH EXECUTE AS OWNER option to its header 

    D

    You should alter Procedure01 and add the EXECUTE AS USER = 'dbo' option immediately before the call to the sp_executesql stored procedure.


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There are user-defined stored procedures. Now you have to make sure two things, first, the names of all user-defined stored procedures must contain the prefix usp_ on all instances; second, stored procedures that do not contain this prefix cannot be created by you.  So what should you do to ensure this two?()
    A

    You should create a policy that targets the name of the stored procedure that is evaluated on change. 

    B

    You should create a policy that targets the name of the stored procedure that is evaluated on demand.

    C

    You should create a condition that targets the name of stored procedure that is evaluated on demand. 

    D

    You should create a condition that targets the name of the stored procedure that isevaluated on change. 


    正确答案: C
    解析: 暂无解析

  • 第24题:

    单选题
    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?
    A

    SELECT TABLE(EMPLIST()) FROM EMPLOYEE

    B

    SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE

    C

    SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE

    D

    SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t


    正确答案: B
    解析: 暂无解析