CLOB displaying incorrectly in sqlplus

CLOB displaying incorrectly in sqlplus

Post by ala.. » Sun, 31 Dec 1899 09:00:00



I am trying to do a report/query to display rows in sqlplus which
contain a CLOB field. However, after a shorter (< 50 chars. or so) CLOB
is displayed from the query, subsequent CLOBs do not display correctly.
They only display about 10 characters per line before wrapping to the
next line.

This sounds like a bug to me. Any suggestions?

I strongly prefer not to resort to displaying the CLOB values using
DBMS_OUTPUT(..) and PL/SQL procedures, but rather just continue to use
plain SQL.

I am using Oracle 8.0.5 on Solaris x86 2.6.

Here is an SQL script and the resulting output, which demos this
behavior:

----------------------------------------------------------------------

set linesize 80
set pagesize 1024
set long 512
set longchunksize 512

column msg_text heading 'CLOB field' format a512 word_wrapped

CREATE TABLE test_lob
(
msg_text CLOB
);

INSERT INTO test_lob
(msg_text)
VALUES (
'1 This is the first record in the msg_text field for this table. It is
some what more than 80 chars long in order to test lob field display in
sqlplus '
);

INSERT INTO test_lob
(msg_text)
VALUES (
'2 This is the second record in the msg_text field for this table. It
is somewhat more than 80 chars long in order to test lob field display
in sqlplus. It is more than 2 lines long. '
);

INSERT INTO test_lob
(msg_text)
VALUES (
'3 Third record'
);

INSERT INTO test_lob
(msg_text)
VALUES (
'4 This is the forth record in the msg_text field for this table. It is
somewhat more than 80 chars long in order to test lob field display in
sqlplus '
);

select * from test_lob;

quit;

-----------------------------------------------------------------------

The script's output is:

SQL*Plus: Release 8.0.5.0.0 - Production on Tue Jan 18 13:7:53 2000

(c) Copyright 1998 Oracle Corporation.  All rights reserved.

Connected to:
Oracle8 Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.0.0 - Production

Table dropped.

Table created.

1 row created.

1 row created.

1 row created.

1 row created.

CLOB field
------------------------------------------------------------------------
--------
1 This is the first record in the msg_text field for this table. It is
somewhat more than 80 chars long in order to test lob field display in
sqlplus

2 This is the second record in the msg_text field for this table. It is
somewhat more than 80 chars long in order to test lob field display in
sqlplus. It is more than 2 lines long.

3 Third record
4 This is the forth record i
n the msg_text
 field for thi
s table. It is
 somewhat more
 than 80 chars
 long in order
 to test lob f
ield display i
n sqlplus

Disconnected from Oracle8 Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.0.0 - Production

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Query Analyzer results displays incorrectly?

I've just had my PC upgraded to Win 2000 Server and now QA doesn't display
properly in the results pane. I've tried changing fonts to no avail.

Another developer here has Win 2000 Server and the same settings in QA and
it displays fine for him. Anybody got a clue what's going on?

Michael MacGregor
Database Architect
SalesDriver

2. SQL statement using IN

3. Query Analyser incorrectly displays results

4. SQL Server not fully backing up

5. Access incorrectly displays Form Reference Error

6. Simple question.

7. SQL Displaying Date fields incorrectly?

8. ADO Can't find specified provider

9. MSHFlexgrid Displays Incorrectly

10. PDX 5.0 displays numbers incorrectly - 1441.00 not 145.00

11. Value list - 2 nd field displays incorrectly

12. Incorrectly Displayed Time