Home » Other » Training & Certification » please try to answer these questions asap
please try to answer these questions asap [message #308030] Thu, 20 March 2008 16:31 Go to next message
aatishpatel
Messages: 4
Registered: March 2008
Junior Member


1. An Exit statement can only be used inside a PL/SQL loop. (Points: 14)
True
False


2. What is true about the following PL/SQL block.
DECLARE
i NUMBER := 1;
BEGIN
LOOP
dbms_output.put_line (i);
i := i+1;
END LOOP;
END;
(Points: 14)
An infinite loop.
Will continue printing numbers beginning with 1 until the buffer overflow limit is reached.
both 1 and 2 are correct.
Will give syntax error.


3. How many times is a While loop executed if the test condition always evaluates to FALSE? (Points: 14)
Infinte
Will never execute
Will give runtime error
Will give syntax error


4.
What is the value of a FOR loop counter after the termination of the loop?
(Points: 14)
same as lower limit
same as upper limit
Undefined
0 (zero)


5. An inner loop can use a variable declared in the outer loop but the outer loop can not use variable declared in the inner loop. (Points: 14)
True
False


6. What types of PL/SQL loops can be nested one inside another? (Points: 14)
A simple loop inside a WHILE loop.
A WHILE loop inside a simple loop.
Any loop can be nested inside another loop.
None of the above.


7. An implicit cursor is automatically associated (generated) with every DML statement. (Points: 14)
True
False


8. Main advantage of using an explicit cursor is that it allows you to process rows returned by SELECT statement, one row a a time. (Points: 14)
True
False


9. The following PL/SQL block, when excuted will display,
DECLARE
CURSOR csr_ac (p_name VARCHAR2) IS
SELECT empno, name, sal
FROM emp
WHERE name LIKE '%p_name%';
BEGIN
FOR rec_ac IN csr_ac ('LE')
LOOP
DBMS_OUTPUT.PUT_LINE(rec_ac.empno || ' ' ||rec_ac.name || ' '||v_sal);
END LOOP ;
CLOSE csr_ac;
END;
/

(Points: 14)
employee number, name and salary of all emplyees.
employee number, name and salary of all emplyees whose name contains string, 'LE' .
will not display anything.


10. Once all of the rows in the cursor have been processed (retreived), the cursor should be closed. Otherwise, it will generate syntax error. (Points: 14)
True
False


11. A PL/SQL procedure can be created and stored in the database without execution of the code. (Points: 14)
True
False


12. PL/SQL functions returns a scalar value and PL/SQL procedures return nothing. Both can take zero or more number of parameters as input or output. (Points: 14)
True
False


13. In a PL/SQL procedure, parameter modes for formal parameters are (Points: 14)
IN
OUT
IN OUT
All of the above


14. What are the methods for passing parameters in PL/SQL procedures. (Points: 14)
Positional
Named
Combination of positional and Named.
all of the above


15. A PL/SQL function can be called as part of a SQL expression or as part of a PL/SQL expression.

(Points: 14)
True
False


16. In PL/SQL function, multiple RETURN statements are allowed, usually within an IF statement. Only one RETURN statement will be executed. (Points: 14)
True
False


17. The parameters of a function must be labeled IN or the function will not complete successfully. (Points: 14)
True
False


18. IN OUT paramenters are permissible in PL/SQL functions. (Points: 14)
True
False


19. PL/SQL package groups logically related program units like procedures and function. (Points: 14)
True
False


20. Advantage(s) of PL/SQL packages is(are) (Points: 14)
Modularity
Easier application design
Better performance
all of the above


21. All procedures and functions in a package body must be declared in the package specification. (Points: 14)
True
False


22. A trigger is a PL/SQL block that executes implicitly whenever a particular event takes place. (Points: 14)
True
False


23. emp table has the following trigger on it.
CREATE OR REPLACE TRIGGER secure_emp
Before INSERT ON emp
Begin
IF (TO_CHAR (sysdate,'DY') IN ('SAT','SUN'))
OR (TO_CHAR (sysdate, 'HH24') NOT BETWEEN '08' AND '18') THEN
RAISE_APPLICATION_ERROR (-20500, 'System not available. Please try later');
END IF;
END;

It will restrict any user accessing emp table from
(Points: 14)
inserting any data into emp table
updating any data in emp table
deleting any row from emp table.
inserting any row into emp table outside regular business hours of 8 a.m to 6 p.m. Monday through Friday.


24. A trigger can fire for which of the following? (Points: 14)
Before a triggering event.
after a triggering event
before or after the triggering event.


25. A BEFORE INSERT trigger fires for which of the following? (Points: 14)
Before an update is issued against the triggering table
After an INSERT is issued against the triggering table
Before an INSERT is issued against the triggering table
all of the above
Re: please try to answer these questions asap [message #308031 is a reply to message #308030] Thu, 20 March 2008 16:43 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
email me with your bank details and a direct debit agreement for $5000 per month and I will answer all of these questions for you
Re: please try to answer these questions asap [message #308033 is a reply to message #308030] Thu, 20 March 2008 16:45 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
OP ignored the following
PL/SQL Experts
Advanced Oracle PL/SQL questions - stored procedures, functions, packages and triggers. Newbies should not post to this forum!
& posted beginner's questions in Expert forum.

OP should visit http;//tahiti.oracle.com & RTFMs
Re: please try to answer these questions asap [message #308070 is a reply to message #308030] Fri, 21 March 2008 00:51 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
hm.. you made a typo in one of your questions..

And, out of curiosity, why are all questions rated 14 points? Why not simply 1 point per question?

[Updated on: Fri, 21 March 2008 00:52]

Report message to a moderator

Re: please try to answer these questions asap [message #308086 is a reply to message #308030] Fri, 21 March 2008 01:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Always post your Oracle version (4 decimals).

Regards
Michel
Re: please try to answer these questions asap [message #310054 is a reply to message #308086] Mon, 31 March 2008 01:54 Go to previous message
manoj12
Messages: 185
Registered: March 2008
Location: India
Senior Member
Firstly you should understand thorougly as to what is PL/SQL all about.Answering these simple questions will be of no meaning to you.So underSTAND THINGS FIRST AND TRY TO SOLVE YOURSELF.I think that will make you confident
Previous Topic: RMAN
Next Topic: 10g OCP materials 1Z0-007
Goto Forum:
  


Current Time: Fri Dec 02 22:55:28 CST 2016

Total time taken to generate the page: 0.08973 seconds