Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I call a stored procedure inside the cursor?

Status
Not open for further replies.

theresatan

Programmer
Mar 18, 2002
101
US
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
 
there there satan....let me see if I can help.

I think that if you are executing the procedure within a PL/SQL block, you dont need the command execute.

LINE 14 should look like
getTime_pineline (startDate, enddate);


Let me know if this works for you.

dj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top