title: Any reason why Oracle limits BLOB size to 4000 bytes when using sequence?
body: <p>I have a weird situation. I am using Oracle and ADO.NET (Visual Studio Dataset). I have a table which includes a BLOB field. Also, I have a sequence for the ID of that table. In ADO.NET, I have a tableAdapter of this table. In the insert query, I wanted it to generate the ID itself so I wrote <code>MYSEQ.NEXTVAL</code> in the insert (Where :ID should be). It works fine. </p>
  
  <p>But, the thing is, when I use sequence inside the query, the BLOB is inserted wrong. No matter what the size is, it inserts 4000 bytes. This is really weird. And, when I don't use the sequence in the insert query, it is fine. I get the NextID with another query and give the outcome to the ID field of insert. It works fine. But I just wonder the reason of it. It looks really stupid. </p>
  
  <p>I am not sure the name is ADO.NET. I am talking about tableadapters and dataset which I use in Visual Studio. Sorry if I am wrong.</p>
  
  <pre><code>INSERT INTO IPYYB_KOM_BASVURUEVRAK
                       (ID, BASVURUID, EVRAK, DOSYAADI, TARIH, TANIM)
         VALUES        (:ID, :BASVURUID, :EVRAK, :DOSYAADI, :TARIH, :TANIM)
  </code></pre>
  
  <p>EVRAK is the file. It is the working code. Below is the not-working code.</p>
  
  <pre><code>INSERT INTO IPYYB_KOM_BASVURUEVRAK
                       (ID, BASVURUID, EVRAK, DOSYAADI, TARIH, TANIM)
         VALUES        (IPYYB_KOM_EVRAK_SEQ.NEXTVAL, :BASVURUID, :EVRAK, :DOSYAADI,
                        :TARIH, :TANIM)
  </code></pre>
  
  <p>this is the sequence,</p>
  
  <pre><code>CREATE SEQUENCE "MUBIS"."IPYYB_KOM_EVRAK_SEQ" MINVALUE 1 
                  MAXVALUE 99999999999999999999999 INCREMENT BY 1 START WITH 21 
                  CACHE 20 NOORDER NOCYCLE ;
  </code></pre>
  
  <p>This is the table,</p>
  
  <pre><code>CREATE TABLE "MUBIS"."IPYYB_KOM_BASVURUEVRAK"
    (
      "ID"        NUMBER NOT NULL ENABLE,
      "BASVURUID" NUMBER,
      "EVRAK" BLOB,
      "DOSYAADI" VARCHAR2(200 BYTE),
      "TARIH" DATE,
      "TANIM" VARCHAR2(200 BYTE),
      CONSTRAINT "IPYYB_KOM_BASVURUEVRAK_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 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 "USERS" ENABLE
    )
    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 "USERS" LOB
    (
      "EVRAK"
    )
    STORE AS BASICFILE
    (
      TABLESPACE "USERS" 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)
    ) ;
  CREATE UNIQUE INDEX "MUBIS"."IPYYB_KOM_BASVURUEVRAK_PK" ON "MUBIS"."IPYYB_KOM_BASVURUEVRAK"
    (
      "ID"
    )
    PCTFREE 10 INITRANS 2 MAXTRANS 255 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 "USERS" ;
  CREATE UNIQUE INDEX "MUBIS"."SYS_IL0000097973C00003$$" ON "MUBIS"."IPYYB_KOM_BASVURUEVRAK"
    (
      PCTFREE 10 INITRANS 2 MAXTRANS 255 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 "USERS" PARALLEL (DEGREE 0 INSTANCES 0) ;
  </code></pre>