| ORA-00922: missing or invalid option [message #578304] |
Tue, 26 February 2013 13:14  |
 |
shankar680
Messages: 11 Registered: February 2013 Location: HYDERABAD
|
Junior Member |
|
|
create or replace p_aggop(dno number, maxi number,mini number,avgi number,tot number,cnt number) is
cursor c1 is select * from emp1 WHERE DEPTNO=dno GROUP BY DEPTNO;
v_emp1 c1%rowtype;
begin
open c1;
loop
fetch c1 into v_emp1;
select min(v_emp1.sal),max(v_emp1.sal),avg(v_emp1.sal),sum(v_emp1.sal),count(*) into mini,maxi,avgi,tot,cnt from v_emp1;
exit when c1%notfound;
Dbms_output.put_line('EXECUTED ');
end loop;
dbms_output.put_line('The minimum salaray in dept is :'||v_emp1.mini);
dbms_output.put_line('The maximum salaray in dept is :'||v_emp1.maxi);
dbms_output.put_line('The average salaray in dept is :'||v_emp1.avgi);
dbms_output.put_line('The total salaray in dept is :'||v_emp1.tot);
dbms_output.put_line('The total members in dept is :'||v_emp1.cnt);
CLOSE C1;
end;
-
Attachment: ERROR.SQL
(Size: 0.79KB, Downloaded 19 times)
|
|
|
|
|
|
|
|
| Re: ORA-00922: missing or invalid option [message #578312 is a reply to message #578304] |
Tue, 26 February 2013 15:22   |
pablolee
Messages: 2083 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
|
As Blackswan's reply implies, you have omitted the type of object that you are creating. As his reply clearly states, please follow the posting guidelines esp formatting (and possibly supply a little more detail in your future posts.
|
|
|
|
|
|
| Re: ORA-00922: missing or invalid option [message #578395 is a reply to message #578380] |
Wed, 27 February 2013 08:49   |
 |
Michel Cadot
Messages: 54223 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
@cvbharathi89
Don't put solution only hint or clue as requested in OraFAQ Forum Guide, "Responding to Posts" section:
Quote:When responding to questions, if it is obviously a student with a homework assignment or someone else just learning, it is usual to provide hints or clues, perhaps links to relevant portions of the documentation, or a similar example, to point them in the right direction so that they will research and experiment on their own and learn, and not provide complete solutions to problems. In cases where someone has a real-life complex work problem, or at least it may seem complex to them, it may be best to provide a complete demo and explanation.
Regards
Michel
|
|
|
|
|
|
|
|
|
|