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 ..

Similar Messages

  • 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
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    x
    SQL>Regards
    Peter

  • 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

  • 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_%%'%'

  • 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

  • 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;

  • 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

  • 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.

  • 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)

  • 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

  • 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

  • How to Handle the Strings more than 4000 characters in OBIEE 11g

    Hi Folks,
    I have a derived column in RPD where there are like bunch of case statements which involve the columns from 2 or more dimensions. Now I am getting an error ORA-01489: result of string concatenation is too long at OCI call OCIStmtFetch.
    How can we handle this in OBIEE? I have tried the below option that is provided in the below link but I think this work only if it is a single column but in my case it is derived column.
    Please suggest.
    Thanks,
    Bharath

    Bharath,
    Can you try using CLOB function.Check the below URL.Not sure if it helps you.
    sql - LISTAGG function: &amp;quot;result of string concatenation is too long&amp;quot; - Stack Overflow
    Thanks,
    Sasi Nagireddy.

  • Parameter longer than 4000 characters

    The java layer calls a EXEC_DDL stored proc that does a EXECUTE IMMEDIATE on the VARCHAR2 parameter string passed in. SInce the java layer is passing more than 4000 characters DDL statement we get an error about cannot bind long ..... What datatype should I use as a parameter instead of VARCHAR2 inside the EXEC_DDL stored proc. Steven Feuerstein advises against using LONG in his PL/SQL book. All the LOB types are for objects either INSIDE or OUTSIDE of the database but I just want the java code to be able to pass a DDL string greater than 4000 chars. I want to use the simplest approach.
    Thanks in anticipation

    a SUBSTR or a DBMS_LOB.SUBSTR works. This is the final working version of the EXEC_DDL proc. We used the DBMS_LOB package in case we needed to overload with other types of LOB parameters.
    procedure exec_ddl (
    pi_ddl_string IN CLOB
    ,po_status OUT PLS_INTEGER
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    -- AUTHID CURRENT_USER will be added after exception handling is packaged
    v_clob_buff VARCHAR2(500);
    BEGIN -- outer block
    EXECUTE IMMEDIATE pi_ddl_string;
    po_status := PKG_SNAPIT.pk_success;
    EXCEPTION
    WHEN OTHERS THEN
    v_clob_buff := DBMS_LOB.SUBSTR(pi_ddl_string,500,1);
    insert into exception_log values(sysdate,'COMPILE ERROR IN : ' || v_clob_buff,'pkg_dynamic_sql'
    ,'exec_ddl');
    COMMIT;
    pkg_snapit.Log_Errors ( 'Error_Stack...' || Chr(10) || DBMS_UTILITY.FORMAT_ERROR_STACK() );
    pkg_snapit.Log_Errors ( 'Error_Backtrace...' || Chr(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE() );
    po_status := SQLCODE;
    RAISE;
    END exec_ddl;
    Edited by: user4900730 on Mar 11, 2010 2:00 PM

  • Need to insert into a table 1 of the fields (CLOB)with more than 4000 chars

    Dear Gurus,
    As far I understood, I need to write a function which get as parameter the large text and using bind variables I can return a CLOB containing more than 4000 chars. I tried all I can do and feel I want to died. Please, can I get specified help in this issue?
    I APPRICIATE YOUR HELP, MARCELO.

    *** Duplicate Post ***
    Please, Marcelo, use the forum properly. Pick a single group and post there.
    Thank you.

Maybe you are looking for

  • Console's left pane (tree view) is empty!!! Anyone has same experience???

    HI, My weblogic console view's left pane (used to show the tree view) is empty. It only shows an icon (indicating something is missing). Does anyone has similar experience before and know the solution to fix this? Thank you, Terrence

  • Solaris 10 - cannot get network connection - P4P800 Deluxe motherboard

    Hello I installed Solaris 10 last week. My computer is using a P4P800 Deluxe motherboard with onboard 3Com C940 ethernet (giga). The installation went very well, however when I did "ifconfig -a" I only get the loopback Lol. I went to the Asus website

  • Getting Error in webIDE for connecting to destination NorthWind

    Hi Experts, I have added Northwind Data service as a destination in my account. But now when I am creating SAPUI5 master detail application it's not getting reflected in Service URL. I am using this post for adding destination: How to use Northwind O

  • Authorizations in Appraisals Calibration

    Hello Experts, I have a tricky question on the Objectives Setting & Appraisals module. I indeed want to give access to managers to the calibration tool (BSP application HAP_CALIBRATION). However i obviously don't want them to use this application to

  • Layer Style Window Opening But Not Visable

    I just began having problems with Photoshop today. I wanted to apply Blending Options to a layer. The Layer Style window opened but it was nowhere to be found! Because I could not access this window to either perform a task or close it, I had to Cont