theresatan
Programmer
Hi:
I have a stored procedure getTime_pineline (startDate, enddate), it takes two input parameters and it works as expected.
I tried to put it in a cursor and pass the parameter to it, I got following:
SQL> declare
2 cursor time_est is
3 select weekBegindate + 2,weekEndDate
4 from time_by_week
5 where weekEndDate > sysdate-21
6 and weekEndDate < add_months(sysdate, 1);
7 startDate date;
8 enddate date;
9 begin
10 open time_est;
11 loop
12 fetch time_est into startDate, enddate;
13 exit when time_est%notfound;
14 execute getTime_pineline (startDate, enddate);
15 --dbms_output.put_line (startDate ||'_'||enddate);
16 end loop;
17 close time_est;
18 dbms_output.put_line ('end');
19 end;
20 /
execute getTime_pineline (startDate, enddate);
*
ERROR at line 14:
ORA-06550: line 14, column 12:
PLS-00103: Encountered the symbol "GETTIME_PINELINE" when expecting one of the
following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "GETTIME_PINELINE" to continue.
Thanks!
Theresa
I have a stored procedure getTime_pineline (startDate, enddate), it takes two input parameters and it works as expected.
I tried to put it in a cursor and pass the parameter to it, I got following:
SQL> declare
2 cursor time_est is
3 select weekBegindate + 2,weekEndDate
4 from time_by_week
5 where weekEndDate > sysdate-21
6 and weekEndDate < add_months(sysdate, 1);
7 startDate date;
8 enddate date;
9 begin
10 open time_est;
11 loop
12 fetch time_est into startDate, enddate;
13 exit when time_est%notfound;
14 execute getTime_pineline (startDate, enddate);
15 --dbms_output.put_line (startDate ||'_'||enddate);
16 end loop;
17 close time_est;
18 dbms_output.put_line ('end');
19 end;
20 /
execute getTime_pineline (startDate, enddate);
*
ERROR at line 14:
ORA-06550: line 14, column 12:
PLS-00103: Encountered the symbol "GETTIME_PINELINE" when expecting one of the
following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "GETTIME_PINELINE" to continue.
Thanks!
Theresa