Iam trying to write a PL/SQL function in Squirrel client. when Iam tryin to excute a script in squirrel getting this error. Please help me as Im new to this squirrel client.

Script:

CREATE  FUNCTION totalHoliday
RETURN int IS
   total int:= 0;
BEGIN
   SELECT count(*) into total
   FROM dbo.HOLIDAY;
   RETURN total;
END;
/

Error: Incorrect syntax near the keyword 'RETURN'. SQLState: S0001 ErrorCode: 156 Error occured in: CREATE FUNCTION totalHoliday RETURN int IS total int:= 0

I tried by giving AS Instead of IS but did'nt work..

1

There are 1 best solutions below

0
On

In the SQL tab in the Session Properties dialog change the Statement Separator from ; to /.