Writing a procedure

View previous topic View next topic Go down

Writing a procedure

Post  varun on Thu Oct 13, 2011 9:27 am

CREATE OR REPLACE PROCEDURE SERVICE_ALTER IS
IS
1_COUNT
BEGIN
@<SELECT COUNT(*) INTO 1_COUNT>
@FROM HR.HR_PA_EMP_PRIMARY_ASSIGNMENT;
+IF "1_COUNT < '90000'" THEN
+RAISE_APPLICATION_ERROR(FAILED IN MEETING THRESHOLD);
END;
/

this is the procedure i have in oracle 10g and keep getting this error:

2/1 PLS-00103: Encountered the symbol "IS" when expecting one of the following:

begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior external language

I am not able to figure it out.

varun

Posts : 5
Join date : 2011-09-28

View user profile

Back to top Go down

Re: Writing a procedure

Post  ngalemmo on Thu Oct 13, 2011 9:57 am

Its all wrong. Have you written an Oracle SP before?

You got "IS" in twice. I have no idea what the @ and + characters are there for, you didn't declare 1_count right, also I don't think you can have a name that starts with a number, and why is the IF condition in quotes and the error message you are trying to send isn't???

avatar
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

View user profile http://aginity.com

Back to top Go down

Re: Writing a procedure

Post  MTomasura on Thu Oct 13, 2011 10:00 am

You have IS twice.

Should be:

create or replace procedure
()
as (or is)

local variable declaration
begin
code section
exceptions
end;


MTomasura

Posts : 4
Join date : 2011-10-12
Location : Scranton USA

View user profile

Back to top Go down

Re: Writing a procedure

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum