• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Oracle stored proc simple problem"

Collapse

  • TheFaQQer
    replied
    Originally posted by darmstadt View Post
    I haven't got a clue but have you tried it without the space:



    Most programming languages don't have a space between a function and parameters...
    Oracle doesn't care one way or the other whether there are 0, 1 or >1 spaces included.

    It's clever like that

    Leave a comment:


  • TheFaQQer
    replied
    Originally posted by suityou01 View Post
    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.

    Leave a comment:


  • lilelvis2000
    replied
    Originally posted by suityou01 View Post
    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+.

    This is supposed to work
    Code:
    DECLARE
    commentTypeId integer;
    BEGIN
     SP_ADD_COMMENT_TYPE ('New comment Type', commentTypeId);
    END;
    But if that isn't working then it may indicate that there is something wrong with the SP..or a permissions issue. Like the execute privilege is not granted to you...which would be odd if you created the SP.

    You're using SQL Developer so when you look at the SP in the procedures 'folder' is there a 'x' next to the SP?

    Leave a comment:


  • Spacecadet
    replied
    have you tried CALL instead of EXEC?

    Leave a comment:


  • mudskipper
    replied
    Oracle is rusty, but don't you need a colon in front of the variable?

    And it's not got a value - what's it trying to do?

    Leave a comment:


  • eek
    replied
    Code:
    DECLARE
    commentTypeId integer;
    IS
    BEGIN
    Exec SP_ADD_COMMENT_TYPE ('New comment Type', commentTypeId);
    END;
    is what I think is missing.

    Leave a comment:


  • d000hg
    replied
    Originally posted by darmstadt View Post
    I haven't got a clue but have you tried it without the space:



    Most programming languages don't have a space between a function and parameters...
    Most - C-style anyway - allow it though Worth a try though.

    Leave a comment:


  • darmstadt
    replied
    I haven't got a clue but have you tried it without the space:

    Exec SP_ADD_COMMENT_TYPE('New comment Type', commentTypeId);
    Most programming languages don't have a space between a function and parameters...

    Leave a comment:


  • suityou01
    replied
    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.

    PLS-00103: Encountered the symbol SP_ADD_COMMENT_TYPE when expecting one of the following ......
    I have tried it with and without EXEC. I have tried it with and without CALL. I have tried it in SQL+.

    Leave a comment:


  • d000hg
    replied
    Leave the coding for the Bobs.

    Leave a comment:


  • eek
    replied
    Originally posted by MarillionFan View Post
    Sounds like this project is going to hell in a handcart.
    It was destined to do that the day SY submitted his application form.

    A little knowledge is a dangerous thing as this topic clearly demonstrates.

    Leave a comment:


  • MarillionFan
    replied
    Sounds like this project is going to hell in a handcart.

    Leave a comment:


  • TheFaQQer
    replied
    Suity,

    If you want more critique (if this is something that your off-shore team has produced and you want to try and look smart)....

    1) Why isn't this a function rather than a procedure?

    2) Why use INTEGER rather than PLS_INTEGER as the datatype?

    Leave a comment:


  • d000hg
    replied
    Originally posted by suityou01 View Post
    A simple understanding that I would expect you people to make. I DESIGNED the system. Now I am helping them code it, despite protestations that I am to Oracle what MF is to Microsoft. Go figure.
    It's great how you respond to people's help. Maybe keep your sense of aggrieved genius for General.

    Leave a comment:


  • TheFaQQer
    replied
    Originally posted by doodab View Post
    Who is the vendor? McCain?
    They sound cheap as chips

    Leave a comment:

Working...
X