krthkskmr February 2016

Oracle truncating column

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?

Answers


Michael Goltsman February 2016

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.


krthkskmr February 2016

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/

Post Status

Asked in February 2016
Viewed 3,967 times
Voted 9
Answered 2 times

Search




Leave an answer