Invalid column name SQL Error: 17006, SQLState: null

Description

Hi,

Is it required that stored procedure must return all the column in the resultset of the mapped class. i was trying to fetch only subset of column & i got the following exception

ERROR [org.hibernate.util.JDBCExceptionReporter] - <Invalid column name>

is it a bug? or is there any alternative solution for this?

Stored procedure

CREATE OR REPLACE PACKAGE BODY Pkg_Test2
IS
PROCEDURE get_my_list(p_record OUT ref_cur ,eventid IN NUMBER)
AS
BEGIN
OPEN p_record FOR
SELECT EVENT_ID, TITLE FROM EVENTS WHERE EVENT_ID=eventid;
END get_my_list;
END Pkg_Test2;
/

mapping file for procedure call

<sql-query name="test_select_sp" callable="true">
<return alias="evaa" class="events.Event">
<return-property name="id" column="EVENT_ID"/>
<return-property name="title" column="TITLE"/>
</return>
{ call pkg_test1.get_selected_list(?,:eventid)}
</sql-query>

Environment

Hibernate 3.2 cr3 with oracle 9i

Activity

Show:
Max Rydahl Andersen
October 4, 2006, 8:37 AM

read the docs - it explain how to do sql projection. and use the forum.hibernate.org for usage forum.

sagar patkar
October 4, 2006, 3:44 PM

Since it is not clear from the docs, can anybody please give example of using/appying sql projection on procedure call through hibernate which returns resultset.. i am not using Query by criteria or HQL in this case.

Christian Bauer
October 4, 2006, 3:49 PM
sagar patkar
October 5, 2006, 9:22 AM

Since stored procedures currently only return scalars and entities, is it so that we should always retrieve all columns of table using select * or the column names which are mapped to particular fields of java class? Can we retrieve single column in result set as result from procedure? Does Hibernate 3.2 version support this feature? Please answer these questions in details since I didn't find any help from http://forum.hibernate.org/

Christian Bauer
October 5, 2006, 9:52 AM

Please stop posting here. This is our TODO list, not your personal support portal. Use the public forum or buy a commercial Hibernate support contract.

Assignee

Unassigned

Reporter

sagar patkar

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure