Study Guides and Actual Real Exam Questions For Oracle OCP, MCSE, MCSA, CCNA, CompTIA


Advertise

Submit Braindumps

Forum

Tell A Friend

    Contact Us

 Home

 Search

Latest Brain Dumps

 BrainDump List

 Certifications Dumps

 Microsoft

 CompTIA

 Oracle

  Cisco
  CIW
  Novell
  Linux
  Sun
  Certs Notes
  How-Tos & Practices 
  Free Online Demos
  Free Online Quizzes
  Free Study Guides
  Free Online Sims
  Material Submission
  Test Vouchers
  Users Submissions
  Site Links
  Submit Site

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Online Training Demos and Learning Tutorials for Windows XP, 2000, 2003.

 

 

 

 





Braindumps for "1Z0-147" Exam

Oracle9i Program with PL/SQL

 Question 1. 
Examine this function:

CREATE OR REPLACE FUNCTION CALC_PLAYER_AVG
(V_ID in PLAYER_BAT_STAT.PLAYER_ID%TYPE)
RETURN NUMBER
IS
V_AVG NUMBER;
BEGIN
SELECT HITS / AT_BATS
INTO V_AVG
FROM PLAYER_BAT_STAT
WHERE PLAYER_ID = V_ID;
RETURN (V_AVG);
END;

Which statement will successfully invoke this function in SQL *Plus?

A. SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;
B. EXECUTE CALC_PLAYER_AVG(31);
C. CALC_PLAYER(.RUTH.);
D. CALC_PLAYER_AVG(31);
E. START CALC_PLAYER_AVG(31)

Answer: A

Explanation:
A function can be invoked in SELECT Statement provided that the function does not modify any database tables. The function must use positional notation to pass values to the formal parameters. The formal parameters must be of the IN mode. They should return data types acceptable to SQL and they should not include any transaction, session, or system control statements.

Incorrect Answers
B. You can't call a function in this way, in this way you can call a procedure, because function must return a value, to call a function using EXECUTE command you should declare a bind variable using the VARIABLE command then assign the value returned from the function to this variable, in the following way:

SQL> VARIABLE v_get_value NUMBER
SQL> EXECUTE :v_get_value := CALC_PLAYER_AVG(31)
PL/SQL procedure successfully completed.
SQL> PRINT v_get_value
V_GET_VALUE
1
C. Again this way can't be use for calling a function in PL/SQL block because the function return a value and this values must be assigned to PL/SQL variable or to bind variable. Like this
DECLARE
v_get_from_fn NUMBER;
BEGIN
v_get_from := CALC_PLAYER_AVG(31);
END;
/
D. Same as C.
E. START is use to execute a script.

Question 2. 
Which three are true statements about dependent objects? (Choose three)

A. Invalid objects cannot be described.
B. An object with status of invalid cannot be a referenced object.
C. The Oracle server automatically records dependencies among objects.
D. All schema objects have a status that is recorded in the data dictionary.
E. You can view whether an object is valid or invalid in the USER_STATUS data 
     dictionary view.
F. You can view whether an object is valid or invalid in the USER_OBJECTS data  
    dictionary view.

Answer:  A, C, F

Incorrect Answers:
B, D, E

Question 3. 
You have created a stored procedure DELETE_TEMP_TABLE that uses dynamic SQL to remove a table in your schema. You have granted the EXECUTE privilege to user A on this procedure. When user A executes the DELETE_TEMP_TABLE procedure, under whose privileges are the operations performed by default?

A. SYS privileges
B. Your privileges
C. Public privileges
D. User A.s privileges
E. User A cannot execute your procedure that has dynamic SQL.

Answer: B

Explanation:
When you create a procedure, it will be executed under the privileges of the creator, unless the procedure has the following statement AUTHID CURRENT_USER. If you specify AUTHID CURRENT_USER, the privileges of the current user are checked at run time, and external references are resolved in the schema of the current user. Like this example

SQL> CREATE OR REPLACE PROCEDURE delete_temp_table(v_table varchar2)
2 AUTHID CURRENT_USER
3 IS
4 BEGIN
5 EXECUTE IMMEDIATE 'DROP TABLE '||V_TABLE;
6 END;
7 /

Procedure created.
If the procedure is create in this way then the EXECUTE IMMEDIATE statement will be execute under the privilege of the user who executes the procedure, but if we skip line 2 then the procedure will be executed under the privilege of the owner of the procedure.

Incorrect Answers
A: SYS privilege has nothing with is.
C: What is the public privileges? There is nothing called public privileges.
D: This will be true if the procedure contains the AUTHID CURRENT_USER.
E: There is no problem in having a dynamic SQL statement in Procedure.

Question 4. 
Examine this code: 

CREATE OR REPLACE PRODECURE add_dept(p_dept_name VARCHAR2 DEFAULT 'placeholder', p_location VARCHAR2 DEFAULT 'Boston')
IS
BEGIN
INSERT INTO departments
VALUES (dept_id_seq.NEXTVAL, p_dept_name, p_location);
END add_dept;
/

Which three are valid calls to the add_dep procedure ? (Choose three)

A. add_dept;
B. add_dept( .Accounting .);
C. add_dept(, .New York .);
D. add_dept(p_location=> .New York .);

Answer: A, B, D

Explanation:
A is correct because both of the parameter have a default values.
B is correct because here we call the procedure using position notation, and the first parameter for the procedure will have the value 'Accounting', and since the second parameter has a default value then we can skip it, and in this case it will take the default value.
D is correct because here we are calling the procedure using naming notation, the value 'New York' will go to the parameter p_location, and the parameter p_dept_name will have the default value.

Incorrect Answer
C: You can't use this way and assume that the PL/SQL will understand that he should assign the default value for the first parameter. This is incorrect way for calling.

Question 5. 
Which two statements about packages are true? (Choose two)

A. Packages can be nested.
B. You can pass parameters to packages.
C. A package is loaded into memory each time it is invoked.
D. The contents of packages can be shared by many applications.
E. You can achieve information hiding by making package constructs private.

Answer: D, E

Explanation:
Actually theses are some of the advantages of the package, sharing the package among applications and hide the logic of the procedures and function that are inside the package by declaring them in the package header and write the code of these procedures and functions inside the package body.

Incorrect Answers:
A: Packages can not be nested
B: Parameters can't be passed to a package; parameters can be passed to procedures and functions only.
C: By the first time you call a procedure, function, or reference a global variable within the package, the whole package will be loaded into the memory and stay there, so when ever you need to reference any of the package's constructs again you will find it in the memory.

Question 6. 
Which two programming constructs can be grouped within a package? (Choose two)

A. Cursor
B. Constant
C. Trigger
D. Sequence
E. View

Answer: A, B

Explanation:
The constructs that can be grouped within a package include:
Procedures and Functions
Cursors, Variables and Constants
Composite data types, such as TABLE or RECORD
Exceptions
Comments
PRAGMAs

Incorrect Answers:
C: Triggers are objects that we create are created on the tables.
D: Sequences can't be grouped inside the packages, but we can reference then inside the package.
E: Views are created and they are database objects, and they can't be grouped inside the packages.

Question 7. 
Which two statements describe the state of a package variable after executing the package in which it is declared? (Choose two)

A. It persists across transactions within a session.
B. It persists from session to session for the same user.
C. It does not persist across transaction within a session.
D. It persists from user to user when the package is invoked.
E. It does not persist from session to session for the same user.

Answer: A, E

Explanation:
You can keep track of the state of a package variable or cursor, which persists throughout the user session, from the time the user first references the variable or cursor to the time the user disconnects.

1. Initialize the variable within its declaration or within an automatic, one-time-only procedure.
2. Change the value of the variable by means of package procedures.
3. The value of the variable is released when the user disconnects.

Incorrect Answers
B: Each session will have its own value for the variables
C: It persists across the transactions and through the user session.
D: Each user has his own values and results, because each user has his own users.

Question 8. 
Which code can you use to ensure that the salary is not increased by more than 10% at a time nor is it ever decreased?

A. ALTER TABLE emp ADD CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND   
     sal*1.1);
B. CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp 
     FOR EACH ROW
     WHEN (new.sal < old.sal OR
      new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, .Do not   
     decrease salary not
     increase by more than 10% );
     END;
C. CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp    
     WHEN (new.sal <
     old.sal OR new.sal > old.sal * 1.1)
     BEGIN RAISE_APPLICATION_ERROR ( - 20508, .Do not decrease salary not    
     increase by more than 10% );
     END;
D. CREATE OR REPLACE TRIGGER check_sal AFTER UPDATE OR sal ON emp  
     WHEN (new.sal <
     old.sal OR -new.sal > old.sal * 1.1)
     BEGIN RAISE_APPLICATION_ERROR ( - 20508, .Do not decrease salary not   
     increase by more than 10% );
     END;

Answer: B

Explanation:
Row triggers are the correct chose for solving the problem. A row trigger fires each time the table is affected by the triggering event. If the triggering event affects no rows, a row trigger is not executed. Row triggers are useful if the trigger action depends on data of rows that are affected or on data provided by the triggering event itself. You can create a BEFORE row trigger in order to prevent the triggering operation from succeeding if a certain condition is violated.
Within a ROW trigger, reference the value of a column before and after the data change by prefixing it with the OLD and NEW qualifier.

Incorrect Answers:
A: Check constraint can't do this job lets take a look:
SQL> ALTER TABLE emp ADD
2 CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1)
3 /
Table altered.
SQL> select ename, sal
2 from emp
3 where ename = 'CERT';
ENAME SAL
CERT 5000
Now let's issue an update statement
SQL> update emp
2 set sal = 10
3 where ename = 'CERT';
1 row updated.

As you can see the check constraint can't compare the old value with the new value.
D,C: You can use NEW and OLD qualifier with row level triggers, If in the CREATE TRIGGER statement you didn't say FOR EACH ROW then the trigger will be statement level trigger

Question 9. 
Examine this code: 

CREATE OR REPLACE PACKAGE bonus
IS
g_max_bonus NUMBER := .99;
FUNCTION calc_bonus (p_emp_id NUMBER)
RETURN NUMBER;
FUNCTION calc_salary (p_emp_id NUMBER)
RETURN NUMBER;
END;
/
CREATE OR REPLACE PACKAGE BODY bonus
IS
v_salary employees.salary%TYPE;
v_bonus employees.commission_pct%TYPE;
FUNCTION calc_bonus (p_emp_id NUMBER)
RETURN NUMBER
IS
BEGIN
SELECT salary, commission_pct
INTO v_salary, v_bonus
FROM employees
WHERE employee_id = p_emp_id;
RETURN v_bonus * v_salary;
END calc_bonus
FUNCTION calc_salary (p_emp_id NUMBER)
RETURN NUMBER
IS
BEGIN
SELECT salary, commission_pct
INTO v_salary, v_bonus
FROM employees
WHERE employees
RETURN v_bonus * v_salary + v_salary;
END cacl_salary;
END bonus;
/

Which statement is true?

A. You can call the BONUS.CALC_SALARY packaged function from an INSERT  
     command against the
     EMPLOYEES table.
B. You can call the BONUS.CALC_SALARY packaged function from a SELECT  
     command against the
     EMPLOYEES table.
C. You can call the BONUS.CALC_SALARY packaged function form a DELETE  
     command against the
     EMPLOYEES table.
D. You can call the BONUS.CALC_SALARY packaged function from an UPDATE   
     command against the
     EMPLOYEES table.

Answer: B

Explanation:
For the Oracle server to execute a SQL statement that calls a stored function, it must know the purity level of a stored functions, that is, whether the functions are free of side effects. Side effects are changes to database tables or public packaged variables (those declared in a package specification). Side effects could delay the execution of a query, yield order-dependent (therefore indeterminate) results, or require that the package state variables be maintained across user sessions. Various side effects are not allowed when a function is called from a SQL query or DML statement. Therefore, the following restrictions apply to stored functions called from SQL expressions:

• A function called from a query or DML statement may not end the current transaction, create or roll back to a savepoint, or alter the system or session
• A function called from a query statement or from a parallelized DML statement may not execute a DML statement or otherwise modify the database
• A function called from a DML statement may not read or modify the particular table being modified by that DML statement

Question 10. 
Which statement is valid when removing procedures?

A. Use a drop procedure statement to drop a standalone procedure.
B. Use a drop procedure statement to drop a procedure that is part of a package. Then  
     recompile the package specification.
C. Use a drop procedure statement to drop a procedure that is part of a package. Then  
     recompile the package body.
D. For faster removal and re-creation, do not use a drop procedure statement. Instead,  
     recompile the procedure using the alter procedure statement with the REUSE  
     SETTINGS clause.

Answer: A

Explanation:
The DROP DROCEDURE statement is used to drop a stand alone procedure

Incorrect Answers:
B: You can't drop a procedure that's inside a package, you have to drop the package, and in this case the whole procedures, functions,... that are inside the packages will be dropped.
C: Same as B.
D: REUSE SETTINGS is used to prevent Oracle from dropping and reacquiring compiler switch settings. With this clause, Oracle preserves the existing settings and uses them for the recompilation.


Google
 
Web www.certsbraindumps.com


Braindumps: Dumps for JN0-522 Exam Brain Dump

Study Guides and Actual Real Exam Questions For Oracle OCP, MCSE, MCSA, CCNA, CompTIA


Advertise

Submit Braindumps

Forum

Tell A Friend

    Contact Us





Braindumps for "JN0-522" Exam

Juniper Networks Certified Internet Specialist, –Service Provider (JNCIS-SP)

 Question 1.
Address book entries identify hosts and networks by their location in relation to what?

A. Network entries in the routing table
B. A listing of addresses in the ARP table
C. Security zones on the firewall
D. An interface on the firewall

Answer: C

Explanation:

Question 2.
Which two options allow proper configuration of NAT-dst? (Choose two.)

A. A static route to the appropriate subnet using a private interface as the outbound interface
B. The default address book entry of "any" in the internal zone
C. The default address book entry of "any" in the external zone
D. An address book entry for the address to be translated in the internal zone

Answer: A, D

Explanation:

Question 3.
Which three options allow proper configuration of NAT-dst? (Choose three.)

A. The default address book entry of "any" in the external zone
B. An address book entry for the address to be translated in the internal zone
C. A static route to the appropriate subnet using a private interface as the outbound interface
D. The default address book entry of "any" in the internal zone
E. A secondary address on one of the interfaces in the internal zone

Answer: B, C, E

Explanation:

Question 4.
Which two protocols are defined in the IPSec standard? (Choose two.)

A. ESP
B. IKE
C. GRE
D. AH

Answer: A, D

Explanation:

Question 5.
What is the purpose of the "Permitted IP" address on a ScreenOS device?

A. It is used in policy rules to determine which user traffic is allowed through the ScreenOS 
    device
B. It defines a list of addresses that are trusted to perform management on the ScreenOS device
C. It is the address that an external device uses to gain management access to a ScreenOS  
    device
D. It defines which range of addresses that can access devices connected to the ScreenOS  
    device

Answer: B

Explanation:

Question 6.
See the exhibit:
Exhibit:
 

In the exhibit, which routing command would allow Host A to communicate with host C?

A. Set route 0.0.0.0/0 int e0/3 gateway 177.11.56.254
B. Set route 1.1.70.0 interface e0/3 gateway 177.11.56.254
C. Configure route 1.1.70.0/24 gateway 177.11.56.254 int e0/3
D. Set route 1.1.70.0/24 interface e0/3 gateway 177.11.56.254

Answer: D

Explanation:

Question 7.
What are two benefits of configuring a ScreenOS device in transparent mode? (Choose two.)

A. Policies are easier to create since you do not have to include source and destination IP  
    addresses
B. There is no need to create MIPs or VIPs for incoming traffic to reach protected servers
C. The product can support more VPNs and obtain greater throughput because there is less  
    overhead to manage
D. There is no need to reconfigure the IP addresses of routers or protected servers

Answer: B, D 

Explanation:

Question 8.
Which statement accurately describes the "config rollaback" feature?

A. Once the "Config rollback" feature is enabled, it allows the administrator to re-apply a  
    previously saved configuration file from the flash
B. Once the "Config rollback" feature is enabled, it allows the administrator to revert to the prior  
    ScreenOS image or configuration file in event an upgrade operation aborts
C. The "Config rollback" feature is enabled by default, it allows the administrator to re-reply a  
    previously saved configuration file from flash
D. Once the "Config rollback" feature is enabled, it allows the administrator to re-apply a locked  
    configuration file from a separate area in flash

Answer: D

Explanation:

Question 9.
See the exhibit:
Exhibit:
 

Which order of policies would allow all five policies to be effective in matching traffic?

A. 3,4,2,5,1
B. 3,2,1,5,4
C. 5,3,1,2,4
D. 4,5,3,2,1

Answer: A

Explanation:

Question 10.
Which ScreenOS CLI commands would be used to enable traffic logging in policy edit mode?

A. Set policy traffic-log
B. Set traffic-log
C. Set log
D. Set logging

Answer: C

Explanation:



Google
 
Web www.certsbraindumps.com


Study Guides and Real Exam Questions For Oracle OCP, MCSE, MCSA, CCNA, CompTIA





              Privacy Policy                   Disclaimer                    Feedback                    Term & Conditions

www.helpline4IT.com

ITCertKeys.com

Copyright © 2004 CertsBraindumps.com Inc. All rights reserved.