Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Writing a procedure

3 posters

Go down

Writing a procedure Empty Writing a procedure

Post  varun 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

Back to top Go down

Writing a procedure Empty Re: Writing a procedure

Post  ngalemmo 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???

ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

Writing a procedure Empty Re: Writing a procedure

Post  MTomasura 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

Back to top Go down

Writing a procedure Empty Re: Writing a procedure

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


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