2

I have a table, which contain a clob field having some data. When I export, i couldn't get the data of clob field.

  CREATE TABLE "ADMIN"."TABLE" 
   (    "ID" NUMBER(10,0), 
    "DATAS" CLOB
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "SYSTEM" 
 LOB ("DATAS") STORE AS BASICFILE (
  TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
REM INSERTING into ADMIN.TABLE
SET DEFINE OFF;



Insert into ADMIN.TABLE (ID) values (1);

This is the exported sql query. Here you can find the last line in 'Insert into ADMIN.TABLE (ID) values (1);' No 'DATAS' field here. Its a clob field.

Prashobh Chandran
  • 301
  • 1
  • 3
  • 9
  • Possible duplicate of [How to export clob field datas in oracle sql developer](https://stackoverflow.com/questions/42244941/how-to-export-clob-field-datas-in-oracle-sql-developer) – Steve Chambers Oct 11 '17 at 13:55

1 Answers1

4

You'll have to do this.

SELECT  /*insert*/*  FROM ADMIN.TABLE;

Click run script, not run statement. This will produce the insert statements you are looking for.

JDro04
  • 650
  • 5
  • 15
  • My table clob field contains arabic text. So after using the above query, the result showing improperly. – Prashobh Chandran Aug 25 '16 at 05:40
  • maybe try `alter session set nls_language='Arabic';` before running the above select. I don't deal with Arabic data, so I can't be sure this works – JDro04 Aug 25 '16 at 12:23
  • +1 Had the same question and this method worked very well - could even restrict to export the single record I wanted by including a WHERE clause. – Steve Chambers Oct 11 '17 at 13:54