java显示oracel chr(10) [英] java showing oracel chr(10)

查看:411
本文介绍了java显示oracel chr(10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...
我正在使用java-oracle程序,我有一个oracle函数,该函数返回clob,这是附加一组字符串(类型为nvarchar2)的结果...
在oracle函数中,我使用CHR(10)分隔值以换行,请检查此

"a" || chr(10)|| ''b''

这在oracle中有效,我的意思是它看起来像

a
b

但是在我的Java应用程序中,当我检索从oracle函数返回的值时,它出现了

ab

有没有人知道如何做新行?

hello every body ...
I''m working on a java-oracle program , I have an oracle function that returns a clob which is the result of appending a group of Strings (of type nvarchar2) ...
in oracle function I''m separating values using CHR(10) to make a new line , check this

''a'' || chr(10) || ''b''

this works in oracle , I mean it looks like

a
b

But in my java application when I retrieve this value returned from oracle function it appears

ab

does anyone have any idea about what to do to make a new line ?

推荐答案

您的环境如何?
如果是Windows,则需要使用"a" ||. chr(13)|| chr(10)|| ''b''.

chr(13)是回车(CR),而chr(10)是换行(LF).
在unix系统中,chr(10)就足够了,而在Windows上则需要CR和LF.
为了使其更有趣,您仅在Mac OS 9之前的版本中使用了CR
What''s your environment?
If it''s windows you''ll need to use ''a'' || chr(13) || chr(10) || ''b''.

chr(13) is carriage return (CR) and chr(10) is linefeed (LF).
In a unix system chr(10) is enough, while on windows you need both CR and LF.
To make it more fun you used just CR on Mac OS up to version 9


这篇关于java显示oracel chr(10)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆