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

  • Home
  • SEARCH
  • 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 8964573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:37:13+00:00 2026-06-15T16:37:13+00:00

I have a Oracle function which returns sys_refcursor which is CREATE OR REPLACE FUNCTION

  • 0

I have a Oracle function which returns sys_refcursor which is

CREATE OR REPLACE FUNCTION SCOTT.getemployees
   RETURN SYS_REFCURSOR
AS
   o_cursor   SYS_REFCURSOR;
BEGIN
   OPEN o_cursor FOR
      SELECT EMPNO,
             ENAME,
             JOB,
             MGR,
             HIREDATE,
             SAL,
             COMM,
             DEPTNO
        FROM emp;   
   RETURN o_cursor;
END;
/

In my Entity class I have declared as

@Entity
    @javax.persistence.NamedNativeQuery(name = "getEmp", 
    query = "{ ? = call getemployees }", resultClass = Employees.class, hints = {
    @javax.persistence.QueryHint(name = "org.hibernate.callable", value = "true") })
    @Table(name = "EMPLOYEES")
    public class Employees {

In DAO I have

@Inject
    private SessionFactory sessionFactory;

    @Override
    public List<Employees> getEmployees() {

        List query = new ArrayList<Employees>();
         try{
         query = sessionFactory.getCurrentSession()
                .getNamedQuery("getEmp").list();
         }
         catch(Exception e){
             System.out.println("exception "+e.getMessage());
             e.printStackTrace();
         }
        return query;
    }

When I run I am getting exception, what could be the reason for this?

INFO: Hibernate: { ? = call getemployees }
SEVERE: org.hibernate.exception.GenericJDBCException: Missing IN or OUT parameter at index:: 1
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)

  • 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-06-15T16:37:15+00:00Added an answer on June 15, 2026 at 4:37 pm

    I have managed to resolve the issue.

    Database table columns which are defined as numbers are declared as int in Entity class.
    I have changed those to Integer and problem got resolved.

    private Integer deptNo;
    
    public Integer getDeptNo() {
            return deptNo;
        }
    
        public void setDeptNo(Integer deptNo) {
            this.deptNo = deptNo;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VB.Net function which executes a Oracle Stored Proc and returns a
In my Entity class I have the following, calling a oracle function which returns
I have a PL/SQL function (running on Oracle 10g) in which I update some
I have to write an Oracle procedure which should invoke an Oracle function returning
So we have this SYS_CONTEXT function in Oracle, which takes two parameters, first a
I have a function with 1 argument (date) which encapsulates 1 query like SELECT
The PHP function oci_connect (which connects to an Oracle database) just returns false if
I have an oracle function which is given below. when I run this in
I have this RTRIM and REGEXP function in Oracle SQL query which is working
We are using Magento as our eCommerce platform. We have Oracle apps in which

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.