- Joined
- Oct 28, 2006
- Messages
- 36,581
- Likes received
- 3,172
- Thanks received
- 1,186
This is why Oracle does my f****** nut in.
Consider the following stored procedure call :
Code:DECLARE commentTypeId integer; BEGIN Exec SP_ADD_COMMENT_TYPE ('New comment Type', commentTypeId); END;
According to the examples on the web this is fine. According to the examples given on here this is fine.
According to the SQL Developer tools THIS IS NOT FINE.
I have tried it with and without EXEC. I have tried it with and without CALL. I have tried it in SQL+.
![]()
I'm not sure what examples you've been looking at, but I've never seen exec or call included in a PL/SQL block.
EXEC is a SQL*Plus command to execute the procedure from the command line.
The following works fine for me in APEX, so should be fine in any other version of the database from 8i onwards (all I did was remove the word exec from your example):
Code:
create or replace procedure sp_add_comment_type ( p_comment IN VARCHAR2, p_commentID OUT PLS_INTEGER ) AS
BEGIN
p_commentID := -1;
END;
/
Procedure created.
0.11 seconds
DECLARE
commentTypeId integer;
BEGIN
SP_ADD_COMMENT_TYPE ('New comment Type', commentTypeId);
END;
/
Statement processed.
0.00 seconds
If I add exec or call to the code, then I get the error message you describe. If I don't then the code works fine for me.

