Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6165639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:12:03+00:00 2026-05-23T22:12:03+00:00

I’m having trouble calling an Oracle stored procedure in Java. I added a stored

  • 0

I’m having trouble calling an Oracle stored procedure in Java. I added a stored procedure to the database like this:

         String SQL = "CREATE OR REPLACE PROCEDURE LIVERESULTS() " +
                    "IS " +
                    "BEGIN" +
                            " SELECT POOL_ID, POOL_MBR_ID, BSLN_CD, PGE_TYP_NM, SERV_NM, CL_FILE_NM" +
                            " FROM LBMADM.TPPO_MSTR_MAP " +
                            " ORDER BY SERV_NM" +
                            " WHERE PGE_TYP_NM = 'live' ; " +
                    "END";

                    stmtLIVE = con.createStatement();
                    stmtLIVE.executeUpdate(SQL);

And now I’m trying to call it like this :

CallableStatement cs;

                 try {
                         cs = con.prepareCall("{call LIVERESULTS() }");
                         rs = cs.executeQuery();

                         while (rs.next()) {
 .....

However, I’m getting the following errors:

 java.sql.SQLException: ORA-06550: line 1, column 7:
 PLS-00905: object UT9J.GENERATE_SQL_FOR_LIVE is invalid
 ORA-06550: line 1, column 7:
 PL/SQL: Statement ignored

I can’t quite figure out where I’m going wrong. I read Oracle’s documentation on it and I believe I did everything right, but I guess not. If anyone can shed some light on the situation I’d really appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:12:03+00:00Added an answer on May 23, 2026 at 10:12 pm

    There are multiple issues here..

    1) Why do you want to create the procedure inside Java Code? You should create it directly in Oracle using SQLPLUS or any other Database tool.

    2) Oracle does not expect () when there are no in/out/in-out parameters, so you don’t need them. You also need as “as” or “is” keyword after the “create or replace procedure”. Otherwise, This will give the compile time error that you are seeing..

      1  CREATE OR REPLACE PROCEDURE LIVE
      2  IS
      3  begin
      4    null;   ---This would usually have your logic, 
                   --Null indicates "DO nothing". Just to concentrate on 
                   --the "declare" issues
      5* end;
    SQL> /
    
    Procedure created.
    

    3) The third error is that you are selecting fields from a table, but there are no varibles “INTO” which you are selecting them.

      1  CREATE OR REPLACE PROCEDURE LIVE
      2  AS
      3    v_ename scott.emp.ename%type;
      4  begin
      5    select ename
      6      from scott.emp
      7      where empno = 7369;
      8* end;
    SQL> /
    
    Warning: Procedure created with compilation errors.
    
    SQL> show errors
    Errors for PROCEDURE LIVE:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    5/3      PLS-00428: an INTO clause is expected in this SELECT statement
    
      1  CREATE OR REPLACE PROCEDURE LIVE
      2  AS
      3    v_ename scott.emp.ename%type;
      4  begin
      5    select ename
      6      into v_ename
      7      from scott.emp
      8      where empno = 7369;
      9* end;
    SQL> /
    
    Procedure created.
    

    4) You are creating a procedure called “LIVE” and calling “LIVERESULTS”.Again, you don’t need () after the Procedure call.

    5) Based on Allan’s comments below and Cybernate’s answer(+1), if you are trying to return a result set, you should open a refcursor for your select and then return it to the calling program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
this is what i have right now Drawing an RSS feed into the php,
I want to count how many characters a certain string has in PHP, but
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.