EXPORT AS INSERT STATEMENTS: But in SQL Plus the line overrides 2500 characters!

Posted by The chicken in the kitchen on Stack Overflow See other posts from Stack Overflow or by The chicken in the kitchen
Published on 2010-04-29T08:56:05Z Indexed on 2010/04/30 6:57 UTC
Read the original article Hit count: 324

Filed under:
|

Hello, I have to export an Oracle table as INSERT STATEMENTS.

But the INSERT STATEMENTS so generated, override 2500 characters.

I am obliged to execute them in SQL Plus, so I receive an error message.

This is my Oracle table:

CREATE TABLE SAMPLE_TABLE
(
   C01   VARCHAR2 (5 BYTE) NOT NULL,
   C02   NUMBER (10) NOT NULL,
   C03   NUMBER (5) NOT NULL,
   C04   NUMBER (5) NOT NULL,
   C05   VARCHAR2 (20 BYTE) NOT NULL,
   c06   VARCHAR2 (200 BYTE) NOT NULL,
   c07   VARCHAR2 (200 BYTE) NOT NULL,
   c08   NUMBER (5) NOT NULL,
   c09   NUMBER (10) NOT NULL,
   c10   VARCHAR2 (80 BYTE),
   c11   VARCHAR2 (200 BYTE),
   c12   VARCHAR2 (200 BYTE),
   c13   VARCHAR2 (4000 BYTE),
   c14   VARCHAR2 (1 BYTE) DEFAULT 'N' NOT NULL,
   c15   CHAR (1 BYTE),
   c16   CHAR (1 BYTE)
);

ASSUMPTIONS:

a) I am OBLIGED to export table data as INSERT STATEMENTS; I am allowed to use UPDATE statements, in order to avoid the SQL*Plus error "sp2-0027 input is too long(>2499 characters)";

b) I am OBLIGED to use SQL*Plus to execute the script so generated.

c) Please assume that every record can contain special characters: CHR(10), CHR(13), and so on;

d) I CAN'T use SQL Loader;

e) I CAN'T export and then import the table: I can only add the "delta" using INSERT / UPDATE statements through SQL Plus.

© Stack Overflow or respective owner

Related posts about sql

Related posts about plus