procedures [message #281488] |
Sat, 17 November 2007 07:59 |
mrparr
Messages: 9 Registered: October 2007
|
Junior Member |
|
|
Could anyone help, take a look at this and tell me what I am missing.
I have to customize the given PL/SQL template to reproduce and display the menu. STOP as soon as I can see the full display and prompt me for your input. STOP as soon as soon as I can get the menu to display as shown.
R2D2 Car Repair Shop
==================
Main Menu
=========
Select One of the Options Below:
1. Work with Employee Table
2. Work with Maintenance Tasks Table
3. Work with Car Repair Order Table
4. Work with Repair Material Inventory Table
5. Work with Quarries and Reports
6. End Program
Enter Your Selection(1-6)=>:
2.0 Briefly discuss the problem and the reason why the GetSelection Procedure
will not work to prompt the end-user for his/her selection. What work-around recommendation would
you make?
SQL> CREATE OR REPLACE PROCEDURE DisplayMenu
2 AS
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE(CHR(0));
5 DBMS_OUTPUT.PUT_LINE(CHR(0));
6 DBMS_OUTPUT.PUT_LINE(CHR(0));
7 DBMS_OUTPUT.PUT_LINE(CHR(0));
8 DBMS_OUTPUT.PUT_LINE(CHR(0));
9 DBMS_OUTPUT.PUT_LINE(CHR(0));
10 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||CHR(9)||'R2D2 Car Repair Shop');
11 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||CHR(9)||'====================')
12 DBMS_OUTPUT.PUT_LINE(CHR(0))
13 DBMS_OUTPUT.PUT_LINE(CHR(0)),
14 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||CHR(9)||CHR(9)||'Main Menu');
15 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||CHR(9)||CHR(9)||'=========')
16 DBMS_OUTPUT.PUT_LINE(CHR(0))
17 DBMS_OUTPUT.PUT_LINE(CHR(0)),
18 DBMS_OUTPUT.PUT_LINE('Select One of the Options below:');
19 DBMS_OUTPUT.PUT_LINE(CHR(0));
20 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'1. Work With Employee Table');
21 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'2. Work With Maintenance Tasks Table');
22 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'3. Work With Car Repair Order Table');
23 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'5. Work With Quarries and Reports');
24 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'6. End Program');
25 DBMS_OUTPUT.PUT_LINE(CHR(0));
26 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||'Enter Your Selection=>:');
27 END DisplayMenu;
28
29
30 DECLARE
31 SET SERVEROUTPUT OFF FEEDBACK ON;
32 PROMPT
33 v_Option Number;
34 BEGIN
35 DisplayMenu();
36 GetSelection();
37 EXCEPTION
38 WHEN OTHERS THEN
39 NULL;
40
41 END GetSelection;
42 /
Warning: Procedure created with compilation errors.
SQL> show procedures
SP2-0158: unknown SHOW option "procedures"
SQL> show errors
Errors for PROCEDURE DISPLAYMENU:
LINE/COL ERROR
-------- -----------------------------------------------------------------
12/6 PLS-00103: Encountered the symbol "DBMS_OUTPUT" when expecting
one of the following:
:= . ( % ;
The symbol ":=" was substituted for "DBMS_OUTPUT" to continue.
13/6 PLS-00103: Encountered the symbol "DBMS_OUTPUT" when expecting
one of the following:
. ( * % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || multiset member SUBMULTISET_
The symbol "." was substituted for "DBMS_OUTPUT" to continue.
LINE/COL ERROR
-------- -----------------------------------------------------------------
13/34 PLS-00103: Encountered the symbol "," when expecting one of the
following:
. ( * % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || multiset member SUBMULTISET_
14/71 PLS-00103: Encountered the symbol ";" when expecting one of the
following:
. ( ) , * % & | = - + < / > at in is mod remainder not range
rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or
LINE/COL ERROR
-------- -----------------------------------------------------------------
like between || multiset member SUBMULTISET_
16/6 PLS-00103: Encountered the symbol "DBMS_OUTPUT" when expecting
one of the following:
:= . ( % ;
The symbol ":=" was substituted for "DBMS_OUTPUT" to continue.
17/6 PLS-00103: Encountered the symbol "DBMS_OUTPUT" when expecting
one of the following:
. ( * % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
LINE/COL ERROR
-------- -----------------------------------------------------------------
between || multiset member SUBMULTISET_
The symbol "." was substituted for "DBMS_OUTPUT" to continue.
17/34 PLS-00103: Encountered the symbol "," when expecting one of the
following:
. ( * % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || multiset member SUBMULTISET_
18/62 PLS-00103: Encountered the symbol ";" when expecting one of the
following:
LINE/COL ERROR
-------- -----------------------------------------------------------------
. ( ) , * % & | = - + < / > at in is mod remainder not range
rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or
like between || multiset member SUBMULTISET_
30/1 PLS-00103: Encountered the symbol "DECLARE" when expecting one of
the following:
end not pragma final instantiable order overriding static
member constructor map
|
|
|
Re: procedures [message #281491 is a reply to message #281488] |
Sat, 17 November 2007 08:29 |
|
Michel Cadot
Messages: 68716 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
1/ Read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
2/ Always post your Oracle version (4 decimals).
3/ PL/SQL executes on SERVER and so does not interacts with client (unless you use Forms, in this case you don't post in the correct forum)
4/ A create procedure command ends with a /, so line 28 should be /
5/ when others the null is an ERROR
6/ "41 END GetSelection;" where GetSelection starts?
7/ ...
Regards
Michel
[Updated on: Sat, 17 November 2007 08:31] Report message to a moderator
|
|
|
|
|
Re: procedures [message #281519 is a reply to message #281495] |
Sat, 17 November 2007 20:05 |
mrparr
Messages: 9 Registered: October 2007
|
Junior Member |
|
|
Thank you, I was not looking for anyone to do my homework. I just needed someone to point somethings that I did not see. I did correct the errors and successfully completed the assignment. Thank you for following your own guidelines on politeness!!!
|
|
|
Re: procedures [message #281587 is a reply to message #281519] |
Sun, 18 November 2007 09:02 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Oh, come on! You didn't see the obviousCheck line terminators | 12 DBMS_OUTPUT.PUT_LINE(CHR(0))
13 DBMS_OUTPUT.PUT_LINE(CHR(0)),
14 DBMS_OUTPUT.PUT_LINE(CHR(9)||CHR(9)||CHR(9)||CHR(9)||'Main Menu');
|
and needed to be pushed into the right direction? You've been sloppy, and that's the whole truth. Posting such a code and expecting someone to spend his/her time to help you about such things is just not right, whether you like it or not.
If you really managed to make it work - congratulations! I'm really glad to hear that!
|
|
|