How to Avoid SQLPlus output truncating

All we need is an easy explanation of the problem, so here it is.

I have the following column in oracle database table.

Column name : objectdata
Data type : LONG RAW

When I query this column via sqlplus output is like below.

SQL> select objectdata from tableA where login_id = 'xxxxxxxx';
O
-
A

This should be actually

Objectdata
----------------------
ACED0005737200136A617661... (very long value)

I have tried
set long 10000 SET PAGESIZE 32766 SET LINESIZE 32766 etc. Still it shows as truncated. How to get this value without truncated?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

FAQ: LONGS and LONG RAW Columns (Doc ID 1022030.6)

  1. How can you view LONG and LONG RAW data?

    You can view LONG and LONG RAW data using OCI,PRO*C,
    FORM4.0 and 4.5 GUI, pl/sql.
    LONG RAW cannot be viewed using sqlplus, sqldba.

LONG RAW

Note: SQL*Plus is unable to SELECT a LONG RAW column, you have to
write your own program (in C, Java, VB, PHP or whatever supports OCI
or OO4O).

Meaning, it can not be displayed directly, you need to process or convert it to something else.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply