General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 19th, 2005, 04:23 AM
madhav007 madhav007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 2 madhav007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 59 sec
Reputation Power: 0
Exclamation PL/SQL Procedure

i have created a procedure named sch_proc but when i try to execute the query i get an error saying:

ORA-06550: line 2, column 8:
PLS-00302: component 'SCH_PROC' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored

the code is:

CREATE OR REPLACE PROCEDURE Sch_Proc(b IN NUMBER)
AS
duedate SCH.due_date%TYPE;
counts NUMBER(7);
infos VARCHAR2(100);
CURSOR sch_cur IS SELECT COUNT(t1.due_date) Scheduled_Events,t1.due_date, t2.case_id || ' ' ||t2.client_name || ' ' || t2.T AS info
FROM SCH t1, SCH t2 WHERE t1.due_date = t2.due_date
GROUP BY t1.due_date,t2.client_name,t2.t,t2.case_id;
BEGIN
IF b= 1 THEN
OPEN sch_cur;
LOOP
FETCH sch_cur INTO counts,duedate,infos;
IF duedate = duedate AND counts = 1 OR counts - 2 = 1 OR counts - 1 = 1 THEN
INSERT INTO TEMP(due_date,scheduled_events,slot1) VALUES(duedate,counts,infos);
ELSIF duedate = duedate AND counts = 2 OR counts - 1 = 2 THEN
UPDATE TEMP SET slot2 = infos WHERE due_date = duedate;
ELSIF duedate = duedate AND counts = 3 THEN
UPDATE TEMP SET slot3 = infos WHERE due_date = duedate;
END IF;
END LOOP;
CLOSE sch_cur;
END IF;
COMMIT;
END Sch_Proc;

please help me regarding this.

Thanks in Advance
Madhavan G V

Reply With Quote
  #2  
Old August 3rd, 2005, 08:27 AM
jalbersdorfer jalbersdorfer is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Location: in Germany, Bavaria
Posts: 5 jalbersdorfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 41 sec
Reputation Power: 0
you made a mistake in procedures declaration.
The syntax is PROCEDURE name(parameter IN DATATYPE) AS ...

try this way:

Code:
procedure name(parameter in number) is
begin
  null; -- is not required, when filled with code!
end name;

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > PL/SQL Procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway