-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to Call Oracle Pipelined Functions
PostPosted: Wed Sep 24, 2014 4:45 am 
Newbie

Joined: Wed Aug 20, 2014 5:09 am
Posts: 2
Hi All,

I have to call a pipelined function in oracle from hibernate. How do i call it ?

I tried calling it through native query and named query , nothing works and give me exception

By Native Query:
select * from table(WS_SAMPLE_PACKAGE.pipe_properties(1))

and it gives : No Dialect mapping for JDBC type: 2003

By Named Query
@NamedNativeQuery(name="testTypeQuery",query="{ ? = call WS_SAMPLE_PACKAGE.pipe_properties(1) }",
hints={@javax.persistence.QueryHint(name = "org.hibernate.callable", value = "true")})

and it gives : occuredjavax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

Do i need to some mapping with the custom object i created in oracle to hibernate ?

The Function will be return PRIMARY_L_OBJ
---------------script of the objects ---------------
CREATE OR REPLACE TYPE PRIMARY_L_OBJ AS OBJECT
( l_key VARCHAR2(14 BYTE),
L_STATUS NUMBER(1, 0),
start_date NUMBER(8, 0),
constructor function PRIMARY_L_OBJ return self as result
);

CREATE OR REPLACE TYPE BODY PRIMARY_L_OBJ AS
CONSTRUCTOR FUNCTION PRIMARY_L_OBJ
RETURN SELF AS RESULT
AS
BEGIN
SELF.l_key :=null;
SELF.L_STATUS :=null;
SELF.start_date :=null;
RETURN;
END;
END;


CREATE OR REPLACE TYPE PRIMARY_L_OBJ_TABLE AS TABLE OF PRIMARY_L_OBJ;
------ end --------------


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.