I always hear people are asking how to view the content in LONG, LONG RAW, CLOB and BLOB fields. In SQL*Plus, it's really not easy, but in AnySQL I have special designed commands. This feature allow you to query LONG/LOBs contents to client side OS file (not server side as DBMS_LOB).
LOB command, the query should return one column and one row with LONG or LOB type.
Usage:
LOB query >> file
Note :
>> mean export long/long raw/blob/clob to a file
LOBEXP command, the query should return two columns, first as file name, second as LONG or LOB type column.
Usage:
LOBEXP query
Note :
Query should return tow column as following:
col1 : CHAR or VARCHAR specify the filename.
col2 : blob/clob field.
Following is a demo table in my personal database:
ASQL> SELECT FNAME FROM T_LOB;
FNAME
-----
a.txt
otop
2 rows returned.
ASQL> desc t_LOB;
NO# NAME NULLABLE TYPE
--- ----------------- -------- ------------
1 FNAME VARCHAR2(20)
2 FTEXT CLOB
View it with LOB command:
ASQL> LOB SELECT FTEXT FROM T_LOB WHERE FNAME='otop' >> otop.txt;
Command succeed.
View it with LOBEXP command:
ASQL> LOBEXP SELECT FNAME, FTEXT FROM T_LOB;
Write to file: a.txt , bytes=37
Write to file: otop , bytes=483
Command succeed.
Now check the files generated where you run AnySQL, it's so easy here.