我使用如下代码:insert into test as select 'gg' || chr(13) || 'd' a from dual;  插入一条数据,为什么查询出来的结果还是一行,中间有空格隔开的;
 前台应用系统查询出来的结果也是如此,如何以2段内容显示?只用这么多分了

解决方案 »

  1.   

    没问题.sql windows里的数据是不分行展示的.在command windows可以清楚的看出是回车不是空格.
    SQL> create table test (name varchar2(100));
     
    Table created
     
    SQL> insert into test as select 'gg' || chr(13) || 'd' a from dual;
     
    insert into test as select 'gg' || chr(13) || 'd' a from dual
     
    ORA-00926: 缺失 VALUES 关键字
     
    SQL> insert into test  select 'gg' || chr(13) || 'd' a from dual;
     
    1 row inserted
     
    SQL> select * from test;
     
    NAME
    --------------------------------------------------------------------------------
    gg
    d
     
    SQL> 
      

  2.   


    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Nov 15 17:37:05 2010Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
    With the Partitioning, Data Mining and Real Application Testing optionsSQL> select 'as'||chr(10)||'12' from dual;'AS'|
    -----
    as
    12
    SQL> select 'as'||chr(13)||'12' from dual;'AS'|
    -----
    12SQL> 
    好像13不可以啊
      

  3.   

    SQL> select 'as'||chr(13)||'12' from dual;
     
    'AS'||CHR(13)||'12'
    -------------------
    as
    12
     
    SQL> 
    没问题啊