Problem creating procedure using SQL Developer [message #540454] |
Mon, 23 January 2012 14:38 |
|
mallethead@verizon.net
Messages: 10 Registered: January 2012 Location: New Jersey
|
Junior Member |
|
|
Hello,
I think this is probably a simple answer but I'm not seeing it. I am trying to get my stored procedures together again after many years of working on MS SQL server. I'm alternating between using SQL-Plus and Oracle SQL Developer for Mac. In SQL Developer - which I like to use - I keep getting errors at the point where the END command for the package header occurs and the create command for the package body starts.
I've found that if I run the following in SQL-Plus I'm OK but if I try it from SQL Developer I get a compile error such as following or else an error telling me that it expects function, or pragma or something to that effect:
Error(8,1):PLS-00103:Encountered the symbol "/"
The code is as follows:
--------------------------------------
CREATE OR REPLACE PACKAGE MACR_SAMPLE_PROC_4 AS
PROCEDURE sampleproc_4(
pParam1 in integer,
pParam2 out varchar2);
END MACR_SAMPLE_PROC_4;
CREATE OR REPLACE PACKAGE BODY MACR_SAMPLE_PROC_4 AS
PROCEDURE SampleProc_4(
pParam1 in integer,
pParam2 out varchar2) IS
BEGIN
IF pParam1 = 1
THEN
pParam2 := 'Hello !!';
ELSE
pParam2 := 'Goodbye !!';
END IF;
END SampleProc_4;
END MACR_SAMPLE_PROC_4;
--------------------------------
Can someone tell me what I need to do differently in SQL Developer?
Many thanks,
Mallethead
|
|
|
Re: Problem creating procedure using SQL Developer [message #540455 is a reply to message #540454] |
Mon, 23 January 2012 15:04 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
I don't like gui tools like SQL Developer, so I don't know how it handles things, but if you were doing this in SQL*Plus, you would have to put a slash (/) after the header and body sections. I do not see any in yours, but maybe SQLDeveloper "implies" them?
|
|
|
|
|
|
|
|
|
|
Re: Problem creating procedure using SQL Developer [message #540467 is a reply to message #540465] |
Mon, 23 January 2012 19:28 |
|
mallethead@verizon.net
Messages: 10 Registered: January 2012 Location: New Jersey
|
Junior Member |
|
|
wvu1999,
Thanks for the link. I had looked at an article on that site this weekend while desparately searching for some answers. I didn't see the Sql Developer Category link in the left nav then but I do now. Looking forward to checking them out.
I understand about the emulator - that is helpful.
mallethead
|
|
|