Needs syntax checks for PL/SQL (Stored Procedure) with IN OUT Parameters [message #285855] |
Wed, 05 December 2007 22:11  |
subhashsubramanyam
Messages: 2 Registered: December 2007 Location: INDIA
|
Junior Member |
|
|
Hi Friends,
Could you please help me correct the syntax in the stored procedure below, I hae tried my level best to adjust things with hardly any materials oline:
CREATE OR REPLACE PROCEDURE SP_WEEKDAYS(START_DATE IN DATE, END_DATE IN DATE, CALENDARID IN CHAR(2), TOTALDAYS OUT NUMBER(20), WORKINGDAYS OUT NUMBER(20))
AS
SELECT COUNT(WORKDAY_FLG) INTO TOTALDAYS, SUM(WORKDAY_FLG) INTO WORKINGDAYS FROM RIP_CAL_FACTORY_CALENDAR
WHERE CALENDAR_DATE BETWEEN START_DATE AND END_DATE AND (CALENDAR_ID = CALENDARID) ;
END ;
I get the following errors on the Sqlplus Prompt:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue.
PLS-00103: Encountered the symbol "INTO" when expecting one of the following:
. ( , % from
The symbol ". was inserted before "INTO" to continue
[Updated on: Wed, 05 December 2007 22:12] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Needs syntax checks for PL/SQL (Stored Procedure) with IN OUT Parameters [message #286209 is a reply to message #286169] |
Thu, 06 December 2007 21:32   |
subhashsubramanyam
Messages: 2 Registered: December 2007 Location: INDIA
|
Junior Member |
|
|
Atlast I got it working, Shame that we don't find a better reference. I've tried googling best ways using different combination of key words. Finally a friend helped me correcting the syntax. Thanks to Ayush and others who has attempted to answer here.
CREATE OR REPLACE PROCEDURE SP_WEEKDAYS(START_DT IN DATE, END_DT IN DATE, CALENDARID IN CHAR, TOTALDAYS OUT NUMBER, WORKINGDAYS OUT NUMBER)
IS
BEGIN
SELECT COUNT(WORKDAY_FLG)INTO TOTALDAYS FROM RIP_CAL_FACTORY_CALENDAR
WHERE CALENDAR_DATE BETWEEN START_DT AND END_DT AND (CALENDAR_ID = CALENDARID) ;
SELECT SUM(WORKDAY_FLG) INTO WORKINGDAYS FROM RIP_CAL_FACTORY_CALENDAR
WHERE CALENDAR_DATE BETWEEN START_DT AND END_DT AND (CALENDAR_ID = CALENDARID) ;
END ;
[Updated on: Thu, 06 December 2007 21:35] Report message to a moderator
|
|
|
|