Buffer overflow in sql plus...

Hi,
i am getting an error 'ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes' while using DBMS_OUTPUT function in a loop in pl/sql block in sql plus environment. please help me in this regard that how can i over come this error.
thanks,

i got the sulotion!
it was really simple by setting the environment before running that code.
Dbms_Output.Enable (1000000);
although it is not permanent sulotion for the problem but at least one can get the much more output by increasing the limit of buffer size.
best regards,

Similar Messages

  • Overflow SQL*Plus buffer.

    Hi,
    I try to insert default data into a LONG field in a 8i DB by using SQL*Plus; however, I get the following error til I reduce the amount of data to certain size. What I understand is that a LONG field can hold up to 2GB of data, so I believe my problem is overflowing the SQL*Plus's buffer. Is there a way to increase SQL*Plus buffer size?
    The error is:
    INSERT INTO thetable VALUES (1,'<?xml
    version="1.0" encoding="ISO-8859-1"?>
    ERROR at line 1:
    ORA-01704: string literal too long
    Thanks in advance for any help!
    kli

    i got the sulotion!
    it was really simple by setting the environment before running that code.
    Dbms_Output.Enable (1000000);
    although it is not permanent sulotion for the problem but at least one can get the much more output by increasing the limit of buffer size.
    best regards,

  • SQL/Plus screen buffer width

    How do I set the screen buffer width in SQL/Plus other than going to Options->Environment->Screen Buffer->Buffer Width? I want to be able to change this programatically within a script but I can't figure it out.

    I don't think you can. It's part of the Windows user interface not part of the SQL*Plus parameter set. If it doesn't appear in a SHOW ALL listing then I doubt you change change it in a script.
    Richard

  • Short dump in SAP R/3: SQL statement buffer overflow?

    Hello,
    I hope someone can help us with the following problem:
    A short dump in SAP R/3 (DBIF_RSQL_INVALID_RSQL, CX_SY_OPEN_SQL_DB)
    occurred during a delta load, which worked fine for several month.
    The custom code crashes at a FETCH NEXT CURSOR statement.
    I assume, it might be a SQL statement buffer overflow in SAP R/3?
    The problem can be reproduced by RSA3, and is therefore not time-dependent.
    The problem did not occur before or on the quality assurance system.
    Cursor code:
          Read all entries since last transfer (delta mechanism)
            OPEN CURSOR WITH HOLD s_cursor FOR
              SELECT * FROM ekko
                WHERE ebeln IN t_selopt_ekko.
    t_selopt_ekko has up to 60.000 data sets, which worked fine in the past.
    It is very likely that the amount of data during the first crash did not exceed this.
    SQL-Trace of RSA3 call:
    It seems that 25150 data set can be processed via fetch before the short dump occurs
    After that object SNAP is written:
    "...DBIF_RSQL_INVALID_RSQL...dynpen00 + 0xab0 at dymain.c:1645 dw.sapP82_D82
    Thdyn...Report für den Extraktoraufruf...I_T_FIELDS...Table IT_43[16x60]TH058FUNCTION=
    RSA3_GET_DATA_SIMPLEDATA=S_S_IF_SIMPLE-T_FIELDSTH100...shmRefCount  = 1...
    ...> 1st level extension part <...isUsed       = 1...isCtfyAble   = 1...> Shareable Table Header Data
    <...tabi         = Not allo......S_CURSORL...SAPLRSA3...LRSA3U06...SAPLRSA3...
    During dump creation the following occurs:
    "...SAPLSPIAGENTCW...CX_DYNAMIC_CHECK=...CRSFH...BALMSGHNDL...
    DBIF_RSQL_INVALID_RSQL...DBIF_RSQL_INVALID_RSQL...DB_ERR_RSQL_00013...
    INCL_ABAP_ERROR...DBIF_INCL_INTERNAL_ERROR...INCL_INTERNAL_ERROR...
    GENERAL_EXC_WITHOUT_RAISING...INCL_SEND_TO_ABAP...INCL_SEARCH_HINTS...
    INCL_SEND_TO_SAP...GENERAL_EXC_WITHOUT_RAISING...GENERAL_ENVIRONMENT...
    GENERAL_TRANSACTION...GENERAL_INFO...GENERAL_INFO_INTERNAL...
    DBIF_INCL_INTERNAL_CALL_CODE..."
    Basis says, that the Oracle data base works fine. The problem seems to be a SAP R/3 buffer.
    Does anyone had a similar problem or knows where such a buffer might be or how it can be enlarged?
    Best regards
    Thomas
    P.S.
    Found a thread that contains part of the dump message "dynpen00 + 0xab0 at dymain.c:1645":
    Thread: dump giving by std prg contains -> seems not to be helpful
    Found a similar thread:
    Thread: Short dump in RSA3 --Z Data Source -> table space or somting else?
    Edited by: Thomas Köpp on Apr 1, 2009 11:39 AM

    Hi Thomas,
          Its due to different field length.
    Just check it out in code after FETCH NEXT CURSOR what internal table you have mention.
    that internal table shoul deffined by taking refrence of ekko, because your code is
    OPEN CURSOR WITH HOLD s_cursor FOR
    SELECT * FROM ekko
    WHERE ebeln IN t_selopt_ekko.
    hope you got solution.
    Regards,

  • SQL PLUS Buffer

    Hi All,
    I need help to display the database buffer in sql plus..........
    and how can we access the buffer to get the detail in the buffer
    thanks

    You can't see the content of the blocks currently cached.
    You can read from V$BH the statistics on the blocks stored in the cache.
    doc
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com]

  • SQL *Plus input buffer

    I have a large script that works fine on my oracle server. When I bring it to my clients, it gets truncated after around 60 lines. I know how to increase the output buffer (EXEC DBS_Output.Enable(10000) for 10000 lines) but I can't seem to find the equivalent for the input buffer. Please help.

    Are you using SQL Plus client, then you need to change the buffer size on the menu of the SQL Plus window.

  • Execute (or re-execute) commands in the SQL*Plus buffer

    I feel confused about sql plus / command. by defination, it Execute (or re-execute) commands in the SQL*Plus buffer. how do I know whether it execete or re-execute a command?
    for example, I run a select statement, seems I have to type / to get result. when I run a create table statement, it seems run twice with / and I got table exists error.
    Could someone clearify when should / be used and when not to use it.

    jz2 wrote:
    I feel confused about sql plus / command. by defination, it Execute (or re-execute) commands in the SQL*Plus buffer. how do I know whether it execete or re-execute a command?
    for example, I run a select statement, seems I have to type / to get result. when I run a create table statement, it seems run twice with / and I got table exists error.
    Could someone clearify when should / be used and when not to use it.I guess you are looking at things in the other way round. The / does what it says, it executes the command in the buffer. Don't think it "reexecutes". It simply executes the command. Be it already run or for the first time. For example,
    Running the code for 1st time.
    SQL> begin
      2  dbms_output.put_line('hi');
      3  end;
      4  .
    SQL> set serveroutput on
    SQL> /
    hi
    PL/SQL procedure successfully completed.
    Running again....
    SQL> l
      1  begin
      2  dbms_output.put_line('hi');
      3* end;
    SQL> /
    hi
    PL/SQL procedure successfully completed.
    SQL>So / simply executes. Now when you should use it and when not, that depends upon the kind of command you are trying to execute. Like you mentioned, for a select, it works by again giving the output. But for a DDL, its not the / which gives error but its the very nature of DDL that once issued, its committed so surely enough , next execution would throw an error only.
    HTH
    Aman....

  • Spool file error - Buffer Overflow

    I've a sql script that is running from a.sql file. The script fetches almost 9 million data as a result of the query. Main problem is related to spool file generation. It is saying buffer overflow. But, when i write that query from sql prompts it is running within 2 mins and completes the task within 15 mins.
    I've written -
    set serveroutput on size ######
    But, still it is not working. Total application is freeze whenever i want to run it. Tell me any suggestion if u have.
    Satyaki.

    i guess what you are more concerned with is the output produced by your query (the spool file).
    you need not to see what is displayed on the screen all you need is open up the spool file to
    check for those data in there.
    to suppress the output from the screen and still generates spool file. use the SET TERMOUT option.
    e.g.
    -- code for a producing a sample spool file
    spool r:\sample_spool.txt;
    select * from emp;
    spool off;
    at the SQL*Plus command line:
    SQL> @r:\sample_spool.sql;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> -- the above example displays the output on the screen
    SQL> -- now we want to turn it off by using the SET TERMOUT option
    SQL> SQL> set termout off;
    SQL> @r:\sample_spool.sql;
    SQL>
    after executing the script sample_spool.sql it does not display output from the screen which
    we want to avoid the buffer overflow error. and still produce the spool file:
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO                                  
          7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20                                  
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20                                  
          7839 KING       PRESIDENT            17-NOV-81       5000                    10                                  
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30                                  
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10                                  
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20                                  
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30                                  
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30                                  
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30                                  
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20                                  
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30                                  
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20                                  
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30                                  
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10                                  
    14 rows selected.

  • Buffer overflow in dbms_output.put_line

    If I code like this, an error happens. Do you know how can I
    resolve this problem?
    for i in 1..500
    loop
    dbms_output.put_line('Hello World');
    end loop;
    ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
    Thx

    If you are running the PL/SQL block within SQL*Plus, use the SIZE
    option to the SET SERVEROUTPUT command:
    set serveroutput on size 7000
    show serveroutput
    begin
    for i in 1..500
    loop
    dbms_output.put_line('Hello World');
    end loop;
    end;
    -- CJ

  • Spool size restriction on SQL*Plus

    Hi,
    I am trying to spool the data from a table to a text file. As the maximum buffer size for spool command is 1000000 in SQL*Plus I am getting BUFFER OVER FLOW error. I know the text file can be created using UTL_file package. Is there any other easy method to capture the data to text file like Spool.
    I need to capture nearly 10000 lines (each can have 500 characters).
    Thanks,
    Vengad

    You 'set termout off' before you execute your script for spooling. The buffer overflow error shows up if you want see the results on screen...
    By setting 'termout off' the results would not come on the screen.

  • PLSQL: String Buffer Overflow

    When I create a sql region or a plsql returning sql, I get an error: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". My query is pretty long. If I reduce the length of the query, it works fine without errors. I tried to run the same query in the sql workshop. There also I get the same error. Can I increase the buffer for the string? Is there anyway to tackle this situation?

    Hi Scott
    I found my mistake.
    Many thanks for your reply, yes you are correct it is the SQL*Plus prompt of Oracle Apex. I have tried the operation on SQL*Plus as well, I get the same error. I am trying to implement a formula which looks something like this: (Calculates the Balance of a Mortgage)
    A=L*(1-(1+r)^p-n) / 1-(1+r)^-n
    L is the Loan i.e. L = $270,000
    r is the interest rate in decimal format and per month so, 8% is r = 0.08/12
    p is number of payments already made, say 6 months p=6
    n total number of payments to be made say 360 months
    so my statement becomes like this:
    -- A=L*(1-(1+r)^p-n) / 1-(1+r)^-n
    select 270000 * 1 - power((1+(0.08/12)), 6-360) / 1 - power((1+(0.08/12)),-360) from dual
    which does return the correct value of:
    269999.813394013370288801946710628610631
    the balance of the loan after 6 payments
    I think my problem was "operator precedence" , sorry!
    But I think I must have hit a hard limit as the following does return a value.
    SQL> select power(-0.002, -20) from dual
    9.5367431640625000000000000000000000E+53
    but
    SQL> select power(-0.002, -200) from dual
    ORA-01426: numeric overflow
    Maybe too small to fit to an Oracle Number data type!?
    Many Thanks
    Kubilay

  • SQL*Plus - how to suppress the SQL in a spool file

    This is my SQL*Plus script. I thought I had solved the problem, but it is back now and I don't know what I am missing. But I don't want the query at the top of the file.
    SET SERVEROUTPUT ON
    SET MARKUP HTML ON -SILENT
    SET ECHO OFF
    SET PAGESIZE 33
    SET TERMOUT OFF
    Spool C:\DuaneWilson.xls
    SELECT *
    FROM RPT_DS1_CNT_CAT_vw
    WHERE ROWNUM <=100
    ORDER BY CVBI_KEY;
    SET MARKUP HTML OFF
    SET ECHO ON
    SET PAGESIZE 20
    SET TERMOUT ON
    SET SERVEROUTPUT OFF

    It turns out when I run the script with the @ or Start with the file name, there is no SQL put out to the file. But when I just copy the text out of the file and run it at the prompt, the SQL appears in the output file. In reference to the -SILENT, I put that in after the MARKUP statement and got an error. Maybe I don't know where that goes. And I am not sure why there is a difference if it is run as a script or just pasted to the buffer. At least it should be the same in the output file, I would think.

  • A question about the impact of SQL*PLUS SERVEROUTPUT option on v$sql

    Hello everybody,
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0  Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    OS : Fedora Core 17 (X86_64) Kernel 3.6.6-1.fc17.x86_64I would like to ask a question about the SQL*Plus SET SERVEROUTPUT ON/OFF option and its impact on queries on views such as v$sql and v$session. Here is the problem
    Actually I define three variables in SQL*Plus in order to store sid, serial# and prev_sql_id columns from v$session in order to be able to use them later, several times in different other queries, while I'm still working in the current session.
    So, here is how I proceed
    SET SERVEROUTPUT ON;  -- I often activate this option as the first line of almost all of my SQL-PL/SQL script files
    SET SQLBLANKLINES ON;
    VARIABLE mysid NUMBER
    VARIABLE myserial# NUMBER;
    VARIABLE saved_sql_id VARCHAR2(13);
    -- So first I store sid and serial# for the current session
    BEGIN
        SELECT sid, serial# INTO :mysid, :myserial#
        FROM v$session
        WHERE audsid = SYS_CONTEXT('UserEnv', 'SessionId');
    END;
    PL/SQL procedure successfully completed.
    -- Just check to see the result
    SQL> SELECT :mysid, :myserial# FROM DUAL;
        :MYSID :MYSERIAL#
           129   1067
    SQL> Now, let's say that I want to run the following query as the last SQL statement run within my current session
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;According to Oracle® Database Reference 11g Release 2 (11.2) description for v$session
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3016.htm#REFRN30223]
    the column prev_sql_id includes the sql_id of the last sql statement executed for the given sid and serial# which in the case of my example, it will be the above mentioned SELECT query on the employees table. As a result, right after the SELECT statement on the employees table I run the following
    BEGIN
        SELECT prev_sql_id INTO :saved_sql_id
        FROM v$session
        WHERE sid = :mysid AND serial# = :myserial#;
    END;
    PL/SQL procedure successfully completed.
    SQL> SELECT :saved_sql_id FROM DUAL;
    :SAVED_SQL_ID
    9babjv8yq8ru3
    SQL> Having the value of sql_id, I'm supposed to find all information about cursor(s) for my SELECT statement and also its sql_text value in v$sql. Yet here is what I get when I query v$sql upon the stored sql_id
    SELECT child_number, sql_id, sql_text
    FROM v$sql
    WHERE sql_id = :saved_sql_id;
    CHILD_NUMBER   SQL_ID          SQL_TEXT
    0              9babjv8yq8ru3    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;Therefore instead of
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;for the value of sql_text I get the following value
    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES);Which is not of course what I was expecting to find in v$sql for the given sql_id.
    After a bit googling I found the following thread on the OTN forum where it had been suggested (well I think maybe not exactly for the same problem) to turn off SERVEROUTPUT.
    Problem with dbms_xplan.display_cursor
    This was precisely what I did
    SET SERVEROUTPUT OFFafter that I repeated the whole procedure and this time everything worked pretty well as expected. I checked SQL*Plus documentation for SERVEROUTPUT
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Could anyone kindly make some clarification?
    thanks in advance,
    Regards,
    Dariyoosh

    >
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Hi Dariyoosh,
    SET SERVEROUTPUT ON has the effect of executing dbms_output.get_lines after each and every statement. Not only related to system view.
    Here below what Tom Kyte is explaining in this page:
    Now, sqlplus sees this functionality and says "hey, would not it be nice for me to dump this buffer to screen for the user?". So, they added the SQLPlus command "set serveroutput on" which does two things
    1) it tells SQLPLUS you would like it <b>to execute dbms_output.get_lines after each and every statement</b>. You would like it to do this network rounding after each call. You would like this extra overhead to take place (think of an install script with hundreds/thousands of statements to be executed -- perhaps, just perhaps you don't want this extra call after every call)
    2) SQLPLUS automatically calls the dbms_output API "enable" to turn on the buffering that happens in the package.Regards.
    Al

  • Unable to compile the java class in the SQL PLUS

    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;

    860411 wrote:
    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    I believe the error message is clear and self-explanatory.
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;
    The last two lines above should be
    /Srini

  • Character set Conversion Buffer Overflow Error

    Hi,
    I have got an issue while loading data from a flat file to a staging table. i.e., Character set Conversion Buffer Overflow. Suppose there are 10,000 records in a flat file, after running control file only 100+ records are loading to the staging table. Remaining are errored out. I think there is no issue with control file because when I load data from different flat file containing same no. of records as the previous flat file, it is loading all the records. what could be the reason and solution for this issue.
    Can anyone please suggest me how to resolve this issue.

    DBNS_OUTPUT is a poor choice for debugging. It has very limited used. And as you've discovered, merely debugging code can now result in new exceptions in the code.
    The proper approach would be to create your own debug procedure (or package). Have your code call this instead of DBMS_OUTPUT.
    In your debug procedure, you can decide what you want to do with that debug data for that specific program in the current environment and circumstances.
    The program that runs could be a DBMS_JOB in which case DBMS_OUTPUT is useless. The program can be called several layers deep from other PL/SQL code.. and you want to know just who is calling your code. Etc.
    Having your own debug procedure allows you to:
    - create an autonomous transaction and log the debug data to a log table
    - write it to a DBMS_PIPE for interactive debugging
    - write it to DBMS_OUTPUT
    - record the PL/SQL call stack to determine who is calling who
    - record the current session's environment (e.g. session_context)
    - record the current session's statistics, opens cursors, current SQL, etc. (courtesy of the V$ views)
    etc. etc.
    In other words, your debug procedure gives you the flexibility to decide on HOW to handle the debugging.
    And when you code goes into production, your debug procedure ships with, containing a simple NULL command.. Which means that at any time the DBA can (when the need arise), add his/her debug methods into it in order to trace a production problem.
    Using DBMS_OUTPUT is a very poor, and often just wrong, choice.
    It is fine for writing a quick test. But when you are developing production code and using DBMS_OUTPUT, you must ask yourself whether you have made the right choice.
    And this is not just about wrapping DBMS_OUTPUT. But also wrapping other system calls like RAISE_APPLICATION_ERROR and so on.

Maybe you are looking for