Oracle truncating column

谁说胖子不能爱 提交于 2020-01-06 19:55:19

问题


I have the following query.

insert into ORDER_INFO(ORDINF_PK,ORDINF_LGNDET_PK_FK,MEDIA_TYPE,ORDINF_MUSIC_FK,DAT)
values (1,1,'Music',21,TO_DATE('14-OCT-2015','DD-MON-YYYY'));

insert into ORDER_INFO(ORDINF_PK,ORDINF_LGNDET_PK_FK,MEDIA_TYPE,ORDINF_MUSIC_FK,ORDINF_SERIES_FK,DAT)
values (2,2,'Series',71,23,TO_DATE('07-NOV-2015','DD-MON-YYYY'));

however when I do:

select * from ORDER_INFO;

I get:

truncating (as requested) before column ORDINF_SERIES_FK

truncating (as requested) before column ORDINF_MOVIES_FK

 ORDINF_PK ORDINF_LGNDET_PK_FK           MEDIA_TYPE ORDINF_MUSIC_FK      DAT
---------- ------------------- -------------------- --------------- ---------
     1                       1                Music              21 14-NOV-14
     2                       2               Series              71 07-NOV-15

I understand that it is truncating ORDINF_MOVIES_FK because there is no entry in that column, but why is it truncating the column ORDINF_SERIES_FK?


回答1:


Pay attention - both rows inserted and ARE in the database, so INSERT succeeded. The warning you get is a warning from SQLPlus program that means that column is display not with full width (maybe the definition of column is long and SQLPlus decides to show column shorter because data you have in there is short). You do not need to worry about this in any case.

See this link for more explanation about SQL*Plus wrap.




回答2:


I managed to solve the issue, I did this.

set wrap on;
set pagesize 50000;
set linesize 120;

link here: http://www.anattatechnologies.com/q/2012/01/sqlplus-pagesize-and-linesize/



来源:https://stackoverflow.com/questions/35263976/oracle-truncating-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!