🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Execute SQL Operator - Calling Oracle Stored Procedure - Invalid SQL Statement

User: "SUPSON"
New Altair Community Member
Updated by Jocelyn
Trying to call an Oracle stored procedure using the Execute SQL operator and getting
Database error occurred: ORA-00900: invalid SQL statement.

The SP I'm trying to call is located within the schema that I've configured the connection for.
I can execute the SP successfully while connected via SQL Developer.

I've tried:
EXECUTE <SP_NAME>
EXECUTE <SCHEMA>.<SP_NAME>
EXEC <SP_NAME>
EXEC <SCHEMA>.<SP_NAME>

I was able to successfully run SELECT SYSDATE FROM DUAL using Execute SQL operator.

Thanks in advance.

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "dfostr"
    New Altair Community Member
    Accepted Answer
    Hi. I had the same issue and found a working solution on Stack Overflow (I can't post the link but search for answer # 47134774) - it seems JDBC does not recognize EXEC so instead wrap your SP within an anonymous PL/SQL block, i.e.:

    BEGIN
      <SP_NAME>
    END;

    User: "SUPSON"
    New Altair Community Member
    OP
    Got it to work...mostly. I used a test stored procedure that had a date in the where clause and I was getting an error around that. Once I changed the query and removed the date reference (just to see if I can even get the StoredProc to run), I was successful in getting the stored procedure to be called. Thanks for the help!