-->
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: Character is returned instead of String with native SQL
PostPosted: Fri Feb 19, 2010 5:47 am 
Newbie

Joined: Mon Dec 21, 2009 8:51 am
Posts: 6
I have the following problem. I wrote a small app which exports records as insert statements for an oracle database.
As long as I use queries, which return just the columns, everything works fine and the type is properly determined. However, when I use constants in the query, then only the first character is returned as Character[1] object instead of the string.

As an Example:
select * from customer;

works fine. The name of the customer is printed correct.

select 'DummyName' as Name from customer;

returns only Character[1] = 'D'. The problem is, because of the nature of the application is to run any valid SQL query, I can not know which datatype is expected and therefore I can't specify the type beforehand.

Is there a solution to this problem?


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.