Insert more than 4000 characters using sql plus

I have a SQL script that creates a database. The problem is that some of the fields are longer than 4000 characters in the INSERT statement and Oracle doesn't seem to like it.
The field is a clob and works fine in the application (i.e. I can insert more than 4000 characters using the app) - how do I achieve this in a SQL script?
Any help is much appreciated.
Cheers,
Steve

Hi,
This pl/sql block works absolutely fine in SQL*Plus inserting > 4000 characters into clob column:
declare
l_str varchar2(8000);
l_str1 varchar2(2400) := 'first part of the verly long string...';
l_str2 varchar2(2400) := 'second part of the verly long string...';
begin
l_str := l_str1 || l_str2;
insert into tmpl values (l_str);
end;
So, you'll have to replace inserts with pl/sql blocks in your script.
Tested in Oracle 8.1.7.0.0
Regards,
Andrew Velitchko
BrainBench MVP for Developer/2000
http://www.brainbench.com

Similar Messages

  • Cannot insert more than 4000 characters using PL/SQL SP  to LONG columns

    I have created a stored procedure which will insert more than 4000 characters in a table having long column.
    The stored procedure body is as follows :
    CREATE OR REPLACE PROCEDURE INSERTTOTEST(P_ZUNIQUEID IN  VARCHAR2,P_LONGVAL  IN LONG)
    AS
    BEGIN
    insert into CLOBVALUESHOW(zuniqueid, longval) VALUES (p_zuniqueid, p_longval) ;
    COMMIT;
    END INSERTTOTEST;
    When I use the RPAD function as below, it executes without any error :
    EXEC INSERTTOTEST('ABCD123',rpad('',32000,'*'))*
    But when I run with real-time values like the following string value :
    '[ERROR] [JTA_Command_Insert_tCatalog]Error invoking Transaction Command action: JTATransactionCommand - A SQL Command Exception occured against JNJ_MDD_OCD_CPL_DS with the following command BEGIN INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1988211','09','ALB','33','NA','0','','','','ALB','8','522','305','710','50','17','208','165','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1988211','09','ALB','33','NA','0','','','','ALB','8','522','305','710','50','17','208','165','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('8257289','67','GGT','15','NA','0','','','','GGT','8','543','305','710','50','21','323','250','','','SP','1','0','','0','0','0','0','0','2','0','0','0','2','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0');'*
    I get the error -
    Error starting at line 1 in command:
    exec P_TESTCLOB(6, '[ERROR] [JTA_Command_Insert_tCatalog]Error invoking Transaction Command action: JTATransactionCommand - A SQL Command Exception occured against JNJ_MDD_OCD_CPL_DS with the following command BEGIN INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, ………..tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0');' *(the statement continues, I have trimmed it as it is not possible that amount of length in the forum. )*
    Error report:
    ORA-06550: line 1, column 1398:
    PLS-00103: Encountered the symbol "1988211" when expecting one of the following:
    ) , * & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec between || multiset member submultiset
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Can anyone tell me why I am getting this error executing the same STORED PROCEDURE while inserting into the LONG column but when using RPAD functions for executing the same STORED PROCEDURE its not happening ?

    >
    But then why will the problem happen with this long string ?
    >
    You don't have a 'long string'. You have a lot of single-quoted strings combined with some unquoted strings.
    There are embedded singel quotes in what you call 'this long string'.
    Try using a different string delimiter so that the quotes do not cause a problem.
    You can use an exclamation point ('!') since there is none in the text you provided.
    Here is an example of what will not work because there is one embedded single quote
    'name LIKE '%DBMS_%%'This is the same value using exclamation as the delimiter - this works because there is no exclamation in the string
    q'!name LIKE '%DBMS_%%'!'1. q must be the first character
    2. ' (single quote) must be the next character
    3. ! (or any delimiter you choose) is the next character
    4. abcdefg. . . -- this is your string that can include single quotes but not an exclamation point
    5. ! is the next to last character - must be the same delimiter used as the third character
    6. ' (single quote) is the last character
    See the 'Text Literals' section of the SQL Reference for more examples
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm
    Note that this one will not work because the string includes the percent
    This is the same value using exclamation as the delimiter - this works because there is no exclamation in the string
    q'%name LIKE '%DBMS_%%'%'

  • Dataype for more than 4000 characters

    Hello,
    I ve got an Oracle 9i Database with an Table which has an Collumn defined as varchar2.
    Now I found, that's still not enough for my application.
    I tried to delete the Table and switch the Data Type to long. Other than expected I'm still not able to insert more than 4000 characters.
    Any ideas?
    Thomas

    Hi Thomas,
    You can look at the sample based on LOB Datatype at this location.
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    There is a method called 'loadSamples' in the source file of this sample(http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html)
    This is the way you insert data into a BLOB or CLOB.
    You can't directly insert data > 4000 characters in a BLOB or CLOB. you need to first create an empty BLOB or CLOB and then insert data into it.
    Regards,
    Anupama

  • Column with more than 4000 characters

    Hi,
    Version: 10.2.0.4.0
    I have a requirement to display more than 4000 characters (clob, long data type) through sql.
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?
    I can use intermediate pl/sql processing if needed.
    Thanks for your help.

    Preta wrote:
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?Yes, what did you try? - Hopefully not LONG
    SQL> drop table t purge;
    Table dropped.
    SQL> create table t (c clob);
    Table created.
    SQL> insert into t values (rpad(to_clob('x'),4001, 'x'));
    1 row created.
    SQL> set long 5000
    SQL> set pages 100
    SQL> select c from t;
    C
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    x
    SQL>Regards
    Peter

  • Displaying more than 4000 characters

    Hi
    I have a report which would display a CLOB field having text of length around 32000 characters.
    I tried to use DBMS_LOB.SUBSTR(<field_name>,32000,1) on the query so that it shows the text at least till 32000 characters on the report but it keeps returning an error ORA-06502 PL/SQL: numeric or value error string - character string buffer too small whenever it is more than 4000 characters in that particular field.
    Can anyone pls suggest any solution ASAP?
    Thanks
    Arnab

    You can split your clob in varchar2 4000 drop table tab1;
    create table tab1 (
      clsplit_id                   number(10)        NOT NULL,
      clsplit_type1val          CLOB                 NULL,
      clsplit_type2val          CLOB                 NULL
    drop type some_list;
    drop type my_t;
    create type my_t as object
          id1 number,
          clob_type number,
          no_clob_lines      number,
          clob_line      number,
          clob_data      varchar2(80)
    show errors
    create type some_list as table of my_t
    show errors
    insert into tab1 values(1, 'a0123456789b0123456789c0123456789d0123456789e0123456789f0123456789leftover',
          'a9876543210b9876543210c9876543210d9876543210e9876543210f9876543210leftover');
    insert into tab1 values(2, '0aaaaaaaaaa1bbbbbbbbbb2cccccccccc3dddddddddd4eeeeeeeeee5ffffffffff',
          'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    insert into tab1 values(3, 'first has data, second null', null);
    insert into tab1 values(4, null, 'first null second has data');
    insert into tab1 values(5, 'short lob', 'short lob');
    commit;
    create or replace function some_func return some_list pipelined is
          num_allowed_chars      number      := 4000;
          clob1_len                  number;
          clob2_len                  number;
          loop_counter            number;
          col_name                  varchar2(100);
          current_line            number;
          i                              integer;
            out_rec my_t := my_t(NULL,NULL,NULL,NULL,NULL);
    begin
          for c1 in ( select clsplit_id, clsplit_type1val, clsplit_type2val from tab1 )
          loop
                -- get first clob
                if c1.clsplit_type1val is not null then
                      clob1_len := dbms_lob.getlength(c1.clsplit_type1val);
                      if clob1_len > num_allowed_chars then
                            for i in 1..ceil(clob1_len/num_allowed_chars) loop
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 1;
                                  out_rec.no_clob_lines := ceil(clob1_len/num_allowed_chars);
                                  out_rec.clob_line := i;
                                  out_rec.clob_data := substr(c1.clsplit_type1val,( i * num_allowed_chars ) - num_allowed_chars + 1,num_allowed_chars);
                                  pipe row(out_rec);
                            end loop;
                      else
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 1;
                                  out_rec.no_clob_lines := 1;
                                  out_rec.clob_line := 1;
                                  out_rec.clob_data := c1.clsplit_type1val;
                                  pipe row(out_rec);
                      end if;
                end if;
                -- get second clob
                if c1.clsplit_type2val is not null then
                      clob2_len := dbms_lob.getlength(c1.clsplit_type2val);
                      if clob2_len > num_allowed_chars then
                            for i in 1..ceil(clob2_len/num_allowed_chars) loop
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 2;
                                  out_rec.no_clob_lines := ceil(clob2_len/num_allowed_chars);
                                  out_rec.clob_line := i;
                                  out_rec.clob_data := substr(c1.clsplit_type2val,( i * num_allowed_chars ) - num_allowed_chars + 1,num_allowed_chars);
                                  pipe row(out_rec);
                            end loop;
                      else
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 2;
                                  out_rec.no_clob_lines := 1;
                                  out_rec.clob_line := 1;
                                  out_rec.clob_data := c1.clsplit_type2val;
                                  pipe row(out_rec);
                      end if;
                end if;
          end loop;
          return;
    end;
    show errors
    select * from
    table(select some_func() from dual)
    order by 1,2,4;

  • Owa_text.vc_arr: can't handle the string with more than 4000 characters?

    In the Oracel Web Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer.
    I amusing PL_SQL with Oracle8i and OWA4.0 web server.I want to
    use owa_text.vc_arr to pass the multple line texts in my form.
    If the text length is less than 4000 characters, everything works
    fine.However when the texts are longer than 4000 characters but
    less than the max length 32767 characters, I got this error
    message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define
    datatype.
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    Helena, I think you might get a better response either from the SQL-PL/SQL forum, or perhaps the Portal Applications forum - both of these tend to have folks very familiar with PL/SQL and the OWA packages.
    This forum is on Web services based on SOAP, WSDL and UDDI. These can be PL/SQL based but typically don't use the mod_psql or OWA web solution.
    As a pointer, I suspect you may already be familiar with, but just in case, you can always take a look at chapter 3 of the OAS documentation, "Developer's Guide: PL/SQL and ODBC Applications" where they go through a number of examples using parameters. See:
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql.pdf
    Hope this or folks from the other list can help.
    Mike.

  • Writing to db more than 4000 characters

    Hi, i want to store a text with more than 4000 characters in an oracle database.
    i can't use varchar2(4000)
    what should i use?
    blob?
    clob?

    there is some kind of a problem here
    a want to store a text with 29212 characters, but there is an error message saying, data size is greater than the maximum value of this type...
    this is an sqlexception

  • Why can't  owa_text.vc_arr  handle the string with more than 4000 characters?

    I am using PL_SQL with Oracle8i and OAS 4.0 web server.I want to
    use owa_text.vc_arr to pass the inputs in serval text areas in the form on a web application.
    If the input string length is less than 4000 characters, everything works fine.However when the strings are longer than 4000 characters but less than the max length 32767 characters, I got this error message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define datatype.
    In the Oracle Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer. It means that owa_text.vc_arr can handle multiple strings and each string can have up to 32767 single byte characters, is it right?
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form on the web:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    The maximum size of a VARCHAR2 field in Oracle 8i is 4000 bytes.
    you'll ned to use a LOB type (or LONG if you prefer the old way)

  • How to insert more than 4000 bytes in BLOB column

    Hi all,
    My oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0.
    I have checked in google and in this forum also, but did not find the answer.
    When inserting into less than 4000 bytes, it is inserting without any issues. If i am inserting more than that, it is throwing
    error like this ORA-01460: unimplemented or unreasonable conversion requested.
    Can anybody guide me how to do this or link.
    Thanks in advance.
    Thanks,
    Pal

    user546710 wrote:
    Hi,
    Thank you very much for your reply.
    Before, I have not worked with BLOB column, so I don't know much about its using. Currently, I am using direct
    insert statement only. Its a normal stored procedure written in a package. I am calling this SP with other columns and
    with this BLOB column. I am able to insert into table, if the inserted file is less than 4000 bytes. If it is more than that,
    I am getting that problem.
    Thanks,
    VenuSQL variables can only hold 4000 bytes.
    PL/SQL can hold up to 32767
    I am getting that problem. 100% lacking in actionable detail
    post code & COMPLETE error message & code

  • FUNCTION returning more than 4000 characters

    I am calling the below function from a view, and function is failing because it returning more than 4000chars.
    An I know when the return type is varchar2 it cannot return more than 4000 chars.
    It's working fine when I use CLOB for the return type. Is there any other better option to handle this err.
    CREATE OR REPLACE FUNCTION FN_CONCATENATE_COMMENTS (
    P_CASENO IN PATIENT_DET.CASE_NO%TYPE,
    P_POLICY IN PATIENT_DET.POLICYNO%TYPE
    RETURN VARCHAR2
    AS
    V_TEMP VARCHAR2(300);
    V_COMMENT VARCHAR2(30000);
    CURSOR FETCHCOMMENT IS
    SELECT TO_CHAR (C.CREATED_TS,'mm/dd/yyyy hh:mi:ss AM - ')|| C.DOC_COMMENT_DESC DOC_COMMENT_DESC
    FROM TREATEMENT_DET C
    WHERE C.CASE_CD = P_CASENO AND C.POLICY_N0 = P_POLICY
    ORDER BY C.CREATED_TS ;
    BEGIN
    OPEN FETCHCOMMENT;
    LOOP
    FETCH FETCHCOMMENT INTO V_TEMP;
    EXIT WHEN FETCHCOMMENT%NOTFOUND;
    V_COMMENT := V_COMMENT ||' '|| TRIM(V_TEMP) ||' ';
    END LOOP;
    CLOSE FETCHCOMMENT;
    RETURN V_COMMENT;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('SYSTEM ERROR PLEASE CONTACT DBA ' || SQLERRM);
    END FN_CONCATENATE_COMMENTS;

    HI
    Welcome to the forum!
    try this please.
    -- IT IS NOT TESTED --
    CREATE OR REPLACE FUNCTION FN_CONCATENATE_COMMENTS (
    P_CASENO IN PATIENT_DET.CASE_NO%TYPE,
    P_POLICY IN PATIENT_DET.POLICYNO%TYPE
    RETURN VARCHAR2
    AS
    V_TEMP VARCHAR2(300);
    V_COMMENT CLOB;
    CURSOR FETCHCOMMENT IS
    SELECT TO_CHAR (C.CREATED_TS,'mm/dd/yyyy hh:mi:ss AM - ')|| C.DOC_COMMENT_DESC DOC_COMMENT_DESC
    FROM TREATEMENT_DET C
    WHERE C.CASE_CD = P_CASENO AND C.POLICY_N0 = P_POLICY
    ORDER BY C.CREATED_TS ;
    BEGIN
    OPEN FETCHCOMMENT;
    LOOP
    FETCH FETCHCOMMENT INTO V_TEMP;
    EXIT WHEN FETCHCOMMENT%NOTFOUND;
    V_COMMENT := V_COMMENT ||' '|| TRIM(V_TEMP) ||' ';
    END LOOP;
    CLOSE FETCHCOMMENT;
    RETURN DBMS_LOB.SUBSTR(V_COMMENT ,32000,1);
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('SYSTEM ERROR PLEASE CONTACT DBA ' || SQLERRM);
    END FN_CONCATENATE_COMMENTS;Edited by: Mahir M. Quluzade on Apr 22, 2011 1:45 PM
    Edited by: Mahir M. Quluzade on Apr 22, 2011 1:46 PM

  • Need ouput more than 4000 characters

    Hi , how to create a script that fetches more than 4000 charaters in the ouput

    declare your pl/sql variable as varchar2(32767) which is the maximum and then you can select that amount.Not so fast Blu ;)
    SQL>  create or replace function f
    return varchar2
    as
    begin
    return lpad ('x', 32767, 'x');
    end f;
    Function created.
    SQL>  exec dbms_output.put_line(length(f))
    32767
    PL/SQL procedure successfully completed.
    SQL>  select length (f) from dual
    select length (f) from dual
    Error at line 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "MICHAEL.F", line 5To SELECT more than 4000 chars you'll always need a CLOB ..

  • How to insert more than 12 items using BDC for MB1C

    Hi,
    When we use LSMW for data transfer of MB1C transaction, more than 12 items can be  inserted in a document.
    But using BDC only 12 and below is possible, if the flat file system has more that 12 item, then the document is not created.
    How to insert more than 12 item in a document.
    Regards

    Hi Gow,
    I have uploaded the MB1C through a BDC and it is working fine for n no of items.
    Here is the code. May be this will be of your help.
    *& Report  ZMB1C
    report ZMB1C
           no standard page heading line-size 255.
    type-pools : slis.
    tables : t100.
    data: begin of record,
            MATNR(018),
            ERFMG(017),
            EXBWR(016),
          end of record.
    data : itab like table of record with header line.
    data : w_bdcdata type bdcdata.
    data : t_bdcdata type standard table of bdcdata initial size 1.
    data : messtab type standard table of bdcmsgcoll with header line.
    data : mstring(300).
    data : vf_index type i,
           no_lines type i,
           count type i value 0.
    data : v_bldat(20),
           v_budat(20).
    *Excel Sheet Data Upload Details
    data : vf_start_col type i value '1',      "start column
           vf_start_row type i value '2',      "start row
           vf_end_col   type i value '100',    "maximum column
           vf_end_row   type i value '10000'.  "maximum row
    */ Internal Table For Excel Data
    data : it_excel type  kcde_cells occurs 0 with header line.
    */ Field symbol
    field-symbols : <fs>.
    data : begin of it_messtab occurs 0,
           plant(10) type c,
           status(10) type c,
           message(90) type c,
           end of it_messtab.
    *Data for ALV display
    data : wa_fcat type slis_fieldcat_alv,
           colcnt type i.
    data : it_fieldcat type slis_t_fieldcat_alv,
           i_events type slis_t_event.
    data : l_title type sychar70.
    data : l_repid like sy-repid.
    * Selction Screen
    selection-screen begin of block b1 with frame title text-000.
    parameters : p_file like ibipparms-path obligatory,
                 p_mode like ctu_params-dismode default 'A'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-001.
    parameters : p_bldat like MKPF-BLDAT obligatory,
                 p_budat like MKPF-BUDAT obligatory,
                 p_bwart like RM07M-BWARTWA obligatory,
                 p_werks like RM07M-WERKS obligatory,
                 p_lgort like RM07M-LGORT obligatory.
    selection-screen end of block b2.
    * At Selction Screen
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ''
        IMPORTING
          file_name     = p_file.
    *Start of Selection Event
    start-of-selection.
      call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = vf_start_col
          i_begin_row             = vf_start_row
          i_end_col               = vf_end_col
          i_end_row               = vf_end_row
        TABLES
          intern                  = it_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
    * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      if it_excel[] is initial.
        MESSAGE I000(ZCL_TCSABAP).
      else.
        sort it_excel by row col.
        loop at it_excel.
          move : it_excel-col to vf_index.
          assign component vf_index of structure itab to <fs>.
          move : it_excel-value to <fs>.
          at end of row.
            append itab.
            clear itab.
          endat.
        endloop.
      endif.
      if not itab[] is initial.
        DESCRIBE TABLE itab LINES no_lines.
        clear messtab.
        refresh messtab.
        CONCATENATE p_bldat+6(2) '.' p_bldat+4(2) '.' p_bldat(4) into v_bldat.
        CONCATENATE p_budat+6(2) '.' p_budat+4(2) '.' p_budat(4) into v_budat.
        perform map_rec.
        call transaction 'MB1C' using t_bdcdata mode p_mode update 'A'
        messages into messtab .
        clear t_bdcdata.
        refresh t_bdcdata.
        loop at messtab where msgtyp = 'E' or msgtyp = 'S' .
          select single * from t100 where sprsl = messtab-msgspra
                                    and   arbgb = messtab-msgid
                                    and   msgnr = messtab-msgnr.
          if sy-subrc = 0.
            mstring = t100-text.
            if mstring cs '&1'.
              replace '&1' with messtab-msgv1 into mstring.
              replace '&2' with messtab-msgv2 into mstring.
              replace '&3' with messtab-msgv3 into mstring.
              replace '&4' with messtab-msgv4 into mstring.
            else.
              replace '&' with messtab-msgv1 into mstring.
              replace '&' with messtab-msgv2 into mstring.
              replace '&' with messtab-msgv3 into mstring.
              replace '&' with messtab-msgv4 into mstring.
            endif.
            condense mstring.
            it_messtab-message = mstring(300).
            it_messtab-plant = p_werks.
            if messtab-msgtyp = 'E'.
              it_messtab-status = 'Error'.
            else.
              it_messtab-status = 'Success'.
            endif.
            append it_messtab.
            clear it_messtab.
          endif.
        endloop. "messtab
        if not it_messtab[] is initial.
          perform buildcatalog.
          perform display.
        endif.
      endif.
    *&      Form  Map_Rec
    *       text
    form  map_rec.
      perform bdc_dynpro      using 'SAPMM07M' '0400'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RM07M-WVERS3'.
      perform bdc_field       using 'BDC_OKCODE'
                                    'NPE'.
      perform bdc_field       using 'MKPF-BLDAT'
                                    v_bldat.
      perform bdc_field       using 'MKPF-BUDAT'
                                    v_budat.
      perform bdc_field       using 'RM07M-BWARTWA'
                                    p_bwart.
      perform bdc_field       using 'RM07M-WERKS'
                                    p_werks.
      perform bdc_field       using 'RM07M-LGORT'
                                    p_lgort.
      perform bdc_field       using 'XFULL'
      perform bdc_field       using 'RM07M-XNAPR'
                                    'X'.
      perform bdc_field       using 'RM07M-WVERS2'
      perform bdc_field       using 'RM07M-WVERS3'
                                    'X'.
      loop at itab.
        count = count + 1.
        perform bdc_dynpro      using 'SAPMM07M' '0410'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'MSEG-EXBWR'.
        if count <> no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=NPE'.
        elseif count = no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
        endif.
        perform bdc_field       using 'MSEG-MATNR'
                                      itab-MATNR.
        perform bdc_field       using 'MSEG-ERFMG'
                                      itab-ERFMG.
        perform bdc_field       using 'MSEG-EXBWR'
                                      itab-EXBWR.
      endloop. "itab
    endform. "Map_Rec
    **      Form  BDC_DYNPRO
    form bdc_dynpro using program dynpro.
      clear w_bdcdata.
      w_bdcdata-program  = program.
      w_bdcdata-dynpro   = dynpro.
      w_bdcdata-dynbegin = 'X'.
      append w_bdcdata to t_bdcdata.
    endform.                    "bdc_dynpro
    **      Form  BDC_FIELD
    form bdc_field using fnam fval.
      if fval <> space.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      else.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      endif.
    endform.                    "bdc_field
    *       FORM buildcatalog                                             *
    form buildcatalog.
      clear wa_fcat.
      clear it_fieldcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'PLANT'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'PLANT'.
      wa_fcat-key          = 'X'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'STATUS'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'STATUS'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'MESSAGE'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'Message'.
      wa_fcat-outputlen  = '90'.
      append wa_fcat to it_fieldcat.
    endform.                    "buildcatalog
    *       FORM display                                                  *
    form display.
      l_title = text-002.
      l_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = l_repid
          i_grid_title       = l_title
          it_fieldcat        = it_fieldcat
          it_events          = i_events[]
        TABLES
          t_outtab           = it_messtab
        EXCEPTIONS
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    "display
    Regards,
    Amit

  • Error when inserting more than 500 characters

    Hello all,
    I am not sure if I should be posting here or in the Flex
    Forum, so I apologize ahead of time if I am in the wrong place.
    I am Using a Flex frontend and a ColdFusion backend to edit
    data in a simple Access Database (for testing). I have a ColdFusion
    CFC on the backend that handles everything just fine until I enter
    in more than 500 characters (Actually 510) into my text area and
    then I get the error "Unable to invoke CFC - Error Executing
    Database Query.". Now you might be saying that either the database
    field is not set to handle that many characters or the CFC is
    restricting more than 500 characters, but they are not. The
    database field is set to "memo" and the maxlength in the CFC is set
    to 5000. I am wondering if has something to do with Access
    databases I do not know because I don't use them that often.
    I have tested this over and over and it only throws the error
    if I exceed 510 characters in the Flex TextArea.
    Any thoughts are appreciated.
    The CFC code is below I didn't add the MXML because I figured
    there was nothing special about the TextArea block:

    Very strange as to why this worked but just in case someone
    else has the same problem here is how I got it to work.
    I just changed this line:
    rss_copy = <cfqueryparam value="#arguments.rss_copy_edit#"
    cfsqltype="cf_sql_varchar" maxlength="5000">
    to this:
    rss_copy = '#arguments.rss_copy_edit#"'
    and it worked just fine.

  • How to store more than 4000 characters in a table

    I have a requirement to store 4000+ character string in the table. CLOB and BLOB does not allow me as it has limitations of 4000 characters.
    Any suggestions please.

    declare
    l clob;
    begin
    l:= '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111';
    update table_name
    set column_name = l;
    commit;
    end;
    This works fine.
    We are using Pentaho to insert records so using pl/sql is not appropriate.

  • Reading contents of a BLOB datatype having more than 4000 characters.

    Hi,
    I am unable to read contents of a column having BLOB datatype.I tried using ult_raw.cast_varchar2(Col_name) procedure,but since varchar2 has a size limit of 4000 bytes,complete contents are not visible.
    Pl. suggest some way to view the contents.
    Regards,
    Saket Bansal

    In the link that you mentioned a procedure is used that gets the length first then loops through if length is greater than 32760.
    I mean to say can user get the output in a single SQL query e.g.
    select utl_raw.cast_to_varchar2(column_name) from table_name;something like this for bytes greater than 4000 bytes.
    ----- Read your reply a bit late thanks.
    Edited by: Avi on Mar 2, 2009 1:21 AM

Maybe you are looking for

  • Problem with import tag in xsl files and include in xsd files

    Hello, I've been developing an application using JBoss as server. Then, i created an especific path for xsd and another path for xsl files. In both cases, i created a main file that include (xsd) or import (xsl) the other files. My problem is that i

  • Inatall Problems

    I paid for PSE 11 Upgrade and downl;oaded the files. During the install I got error notices about a corupted Data 1.cab file (Error 1335) and Error 2350 - Server Error. I think I have those correctd and I want to download the program again. How do I

  • Handling 2 iPhones 3GS on a single iMac24 a family matter!

    I just bought an iPhone for my wife and it is still in the box. I feel confronted and unsecure with the question *how can I synchronize 2 iPhones* on one iMac without crashing information on my iPhone. Sharing contacts and iCal items and mail is not

  • Internet setup using modem cable

    Hi Please help trying to setup internet via cable using assistant but option is gryed out, please guys new to this thanks

  • WebService SOAP vs J2EE

    Hi, late but hopefully not to late i do my first steps into the world of webservices. Since we use JDEV 9.0.4 in prodution i started with this version of JDEV. There it is possible to generate two kind of Webservices, soap and j2ee. In version 10.1.3