|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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; |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > PL/SQL Procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|