File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes could not read column value from result set: IS6_32_0_; Invalid column name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "could not read column value from result set: IS6_32_0_; Invalid column name" Watch "could not read column value from result set: IS6_32_0_; Invalid column name" New topic

could not read column value from result set: IS6_32_0_; Invalid column name

mahdi asgari

Joined: Jun 16, 2008
Posts: 1
I have get the following Exception when running named query "TblBisYeganChildsByYeganId"
I search in the forumn and read the hibernate refrerence but i cant find the correct solution,
would you please help me, it it a bug?
I am using Oracle10G,Hibernate

The exception:
{ ? = call pkg_bis_yegan.func_sel_childsbyyeganid(?) }
[INFO ] - could not read column value from result set: IS6_32_0_; Invalid column name
[WARN ] - SQL Error: 17006, SQLState: null
[ERROR] - Invalid column name

my Hibernate-Mapping xml

<class lazy="true" name="com.test.TblBisYegan" table="TBL_BIS_YEGAN" schema="AMAD">
<id name="pkYeganId" type="java.lang.Long">
<column name="PK_YEGAN_ID" precision="22" scale="0" />
<generator class="assigned" />
<many-to-one name="tblBisInfoBaseDetail" class="com.test.TblBisInfoBaseDetail" fetch="join" lazy="false">
<column name="FK_INFO_BASE_DETAIL_ID" precision="22" scale="0" />
<many-to-one name="tblBisYegan" class="com.test.TblBisYegan" fetch="join" lazy="false">
<column name="FK_YEGAN_ID" precision="10" scale="0" />
<property name="unitNum" type="java.lang.Long">
<column name="UNIT_NUM" precision="22" scale="0" />
<property name="yeganName" type="java.lang.String">
<column name="YEGAN_NAME" length="100" not-null="true" />
<property name="isActive" type="java.lang.Long">
<column name="IS_ACTIVE" precision="1" scale="0" />
<property name="isCreateAmval" type="java.lang.Long">
<column name="IS_CREATE_AMVAL" precision="22" scale="0" />

<sql-query name="TblBisYeganChildsByYeganId" callable="true">
<return class="com.test.TblBisYegan">
<return-property name="pkYeganId" column="PK_YEGAN_ID"/>
<return-property name="yeganName" column="YEGAN_NAME"/>
<return-property name="unitNum" column="UNIT_NUM"/>
<return-property name="tblBisInfoBaseDetail">
<return-column name="PK_INFO_BASE_DETAIL_ID"/>
<return-property name="tblBisYegan">
<return-column name="PARENT_YEGAN_ID"/>
{ ? = call pkg_bis_yegan.func_sel_childsbyyeganid( kyeganid) }


My Function is:

create or replace package body pkg_bis_yegan is
function func_sel_childsbyyeganid(p_fk_yegan_id number)
return sys_refcursor is
func_result SYS_REFCURSOR;
open func_result for
select tbl_bis_yegan.pk_yegan_id,
null parent_yegan_id,
null pk_info_base_detail_id
from tbl_bis_yegan
where tbl_bis_yegan.fk_yegan_id = p_fk_yegan_id
order by tbl_bis_yegan.yegan_name;
return func_result;
end pkg_bis_yegan;

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Sounds like you have an invalid column name in your mapping. Check you have mapped this correctly (NB: the Hibernate exception should tell you the offending name. If you are not seeing this check how you log exceptions - you may be obscuring the message).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
kaven zhang

Joined: Aug 06, 2008
Posts: 1
Hi, I met the some problem at first.
because my sql-query it is like this:
<sql-query name="create_batch_sp" callable="true">
<return alias="sgStagingBatch" class="">
{ ? = call temp_pkg.create_batch(:url) }
after reading your post, i change it to:
<sql-query name="create_batch_sp" callable="true">
<return alias="sgStagingBatch" class="">
<return-property name="gbatchId" column="GBATCH_ID"></return-property>
<return-property name="grpsInTotal" column="GRPS_IN_TOTAL"></return-property>
<return-property name="timeStarted" column="TIME_STARTED"></return-property>
<return-property name="timeFinished" column="TIME_FINISHED"></return-property>
<return-property name="inProcessInd" column="IN_PROCESS_IND"></return-property>
<return-property name="errorDesc" column="ERROR_DESC"></return-property>
<return-property name="errorType" column="ERROR_TYPE"></return-property>
<return-property name="createDt" column="CREATE_DT"></return-property>
<return-property name="updDt" column="UPD_DT"></return-property>
<return-property name="batchStatusCd" column="BATCH_STATUS_CD"></return-property>
<return-property name="batchTypeCd" column="BATCH_TYPE_CD"></return-property>
<return-property name="batchStateCd" column="BATCH_STATE_CD"></return-property>
<return-property name="hostUrl" column="HOST_URL"></return-property>
{ ? = call temp_pkg.create_batch(:url) }
it works now
so i suppose it is not a bug, you should recheck your configuration file
I agree. Here's the link:
subject: could not read column value from result set: IS6_32_0_; Invalid column name
It's not a secret anymore!