Need to execute Long Insert (6000 characters)statement using dbms_sql.parse

I built an insert statement which is more than 6000 (six thousand) characters stored into two varchar2 variables. I need to execute the statement using dbms_sql.parse.
I tryed using dbms_sql.varchar2s variable and having no success.
Any ideas or examples?
Thanks
JK

6000 chars shouldn't be a problem.
What do you mean with no success?Did you get any error?
Any ideas or examples?See this thread
Re: execute immediate with a string longer than 32767

Similar Messages

  • Browser needs BASIC FIXES LONG OVERDUE: Bookmark Thumbnails / State Persistenc​e

    I am running the latest developer OS 2.0 and the thumbnails still keep refreshing or either show up blank. Thumbnails often times look blank, blurry or ugly, all the time.
    PRIORITY #1: When I save a bookmark, the snapshot/thumbnail should be saved permanently. Why do they keep refreshing at random times?   
    PRIORITY #2: The list view format of the bookmarks should be saved when I exit the app. The bookmarks screen always defaults to the thumbnail view. It looks ugly, I can't stand looking at it.
    PRIORITY #3: Why not use Square shaped thumbnails, so the same thumbnails appear in both landscape and portrait?
    RIM, Please fix these basic issues! It is really annoying, irritating and aggravating. 
    Anyone else annoyed by the issues in the browser? 

    swyost wrote:
    This is a classic example of what is a priority to one person is not to someone else.  I prefer the fact the the icons refresh.  They are the equivalent of live tiles and I prefer to know the status of the page.  As for the inability to save the bookmarks format/order, you do know you are using a developer's build not meant for consumers?  They have made it available, but have made all of the usual disclaimers. 
    The issue also exists in 1.x. Only some end users features like Video Store and Email are not available on the dev build. Everything else it's the same. State isn't saved as of latest 7111 build.

  • Help needed, can no longer insert Battery3 as a Multi, Core Audio Error.

    Hi all,
    Well I have been using a few different Motu interfaces as of late, the Ultralite, Traveler and now the 828 MK2. Each device has had no troubles with hBattery as a muti untill now the 828.
    I have loaded all sorts of other mutli devices but for some reason battery is a no go, I get a core audio error of -1 ?
    Now I have yet to install a different driver set since it was my understanding all Motu drivers are the same and the Audio interface driver page shows the 828 so I figured all was well.
    Any one have any ideas as to what I can do? This one has me stumped.
    Thanks in advance!

    I have the exact same issue, battery 3 won't load as a multi. it's authorized and works as a stereo audio unit, but when i try to load the multi, i also get error code -1. btw, this happened today - yesterday the multi worked. i already trashed the logic and battery prefs, no go.

  • Need to Pad char columns in select statements using JDBC

    When issuing:
    select * from tab1 where col1='ABC'
    return o raws, if col1 is of type char(4).
    Need to pad with spaces for RTRIM().
    There is dicussion on Metalink. Is this fixed? An idea. Thanks

    You probably mean:
    PreparedStatement ps = conn.prepareStatement("select * from tab1 where col1=?")
    ps.setString(1,"ABC");
    ps.executeQuery();
    Replace getString() with:
    ((oracle.jdbc.driver.OraclePreparedStatement)ps).setFixedCHAR(1,"ABC");
    This should make the SELECT work.
    null

  • Inserting the characters.

    I want to insert 6000 characters in one column.which data type we can use for creating a column in a table?.
    Total characters length is 6000 per row and how we can test before implement it?.
    pls suggest
    Edited by: user549774 on Jun 30, 2010 4:20 AM

    Use LOB column to store the data. Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
    Read the below documentation for more details
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#CNCPT012

  • Execute the SSIS packages (2008 version) using SQL job 2008

    We need to execute the SSIS packages (2008 version) using SQL job Please help with details information how to execute it.
    1.Protection level of the SSIS packages.
    2.Configuration File (Curently using XML file)
    3.Please provide details how to create Credential (Windows User etc)  Do we need to create windows cred explicitly to run the Job etc..
    4.Please provide details for creating Proxy.
    5.How can we configure the xml file since the xml is reading from local box but when the package is moved from developement box to production box
    then the local drive might not be mapped with Production box .
    6.Roles that need to be tagged for the Proxy/Credential.
    7.Which is the best and safest way to execute ssis packages either msdb deployment or filesystem deployment and other necessary details.

    Hi,
    If you want to Execute your SSIS package using SQL job then best solution is to first deploy your Package
    either using msdb deployment or filesystem deployment.The simplest approach to deployment is probably to deploy to the file system.
    So, here is the deployment steps;
    There are four steps in the package deployment process:
        The first optional step is optional and involves creating package
    configurations that update properties of package elements at run time. The configurations are automatically included when you deploy the packages.
        The second step is to build the Integration Services project to create a package deployment utility. The deployment utility for the project contains the packages that you want to deploy
        The third step is to copy the deployment folder that was created when you built the Integration Services project to the target computer.
        The fourth step is to run, on the target computer, the Package Installation Wizard to install the packages to the file system or to an instance of SQL Server.
    you can use below link also;
    http://bharath-msbi.blogspot.in/2012/04/step-by-step-ssis-package-deployment.html
    After that you need to Schedule package using SQL Agent then  Have a look at the following link. It explains how to create an SQL job that can execute an SSIS package on a scheduled basis.
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    Deployment in msdb deployment or filesystem deployment has there own merits and demerits.
    For security point of view msdb deployment is good.
     it provides Benefits from database security, roles and Agent interaction
    Protection Level;
    In SQL Server Data Tools (SSDT), open the Integration Services project that contains the package.
    Open the package in the SSIS designer.
    If the Properties window does not show the properties of the package, click the design surface.
    In the Properties window, in the Security group, select the appropriate value for the
    ProtectionLevel property.
    If you select a protection level that requires a password, enter the password as the value of the
    PackagePassword property.
    On the File menu, select Save Selected Items to save the modified package.
    SSIS Provide different Protection levels;
        DontSaveSensitive
        EncryptSensitiveWithUserKey
        EncryptSensitiveWithPassword
        EncryptAllWithPassword
        EncryptAllWithUserKey
        ServerStorage
    For better undertsnading you can use below link;
    http://www.mssqltips.com/sqlservertip/2091/securing-your-ssis-packages-using-package-protection-level/
    Thanks

  • How to execute these insert statements as a batch?

    Hello,
    I have these three insert sql statements which execute individually. I want to execute them as a batch:
    sql = "Insert into FirstTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    sql = "Insert into SecondTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    sql = "Insert into ThirdTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement = connection.prepareStatement(sql);
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    insertStatement.executeUpdate();
    I tried the following method, but something is wrong. Can somebody help with executing these inserts as a batch?
    stmt = connection.createStatement(); // connection pool
    sql = "Insert into FirstTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    sql = "Insert into SecondTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    sql = "Insert into ThirdTable (MessageId, MsgDate, MsgTitle) values (?, ?, ?)";
    insertStatement.setInt(1, jmsgid);
    insertStatement.setString(2, jlogdate);
    insertStatement.setString(3, jmsgtitle);
    stmt.addBatch(sql);
    stmt.executeBatch();
    Thank you,
    Logan

    Errr I can't for the life of me understand why you thought that would work. I am bit concerned about how you assembled this code... did you copy and paste and hope for the best?
    It should be.....
    1) Get a preparedStatement using your sql. Do this step once.
    2) For each query you want to batch.... set each of the parameters and call addBatch. Call all this on the prepared statement.
    3) Then call executeBatch on the prepared statement.
    You do not need the other vanilla statement for anything.
    One important thing to note. When you batch parameters for batch prepared statement execution you can only (hopefully obviously) batch for the same SQL query. You can't do one insert and another update in the same query. It has to be all the same query.. just different parameters. This won't effect what you are doing in the above but sometimes it confuses people and they get into trouble later so I thought I would mention it now.

  • Execute multiple insertions?

    Hello everyone,
    i am using mysql database and what i need to do is this:
    i have a simple text file with many insertions in sql. Is there a way to execute the insertions without having to read each statement from the file and execute it using stmt.executeUpdate()?
    (Mysql does not have stored procedures)
    Thanks

    I guess i have to do that, but then another problem pops up. This is a sample code:
    Connection C1 = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root");
    C1.setAutoCommit(false);
    Statement stmt1 = C1.createStatement();
    stmt1.addBatch("INSERT INTO try1(data) VALUES(5);");
    stmt1.addBatch("INSERT INTO try2(id, data) VALUES(1,2);");
    stmt1.executeBatch();
    C1.commit();
    setAutoCommit throws exception and when i remove this code line, no exception is thrown but also no insertion is made.When i use executeUpdate() instead it works. What am i doing wrong? I am quite new to jdbc, so please help!
    Thanks

  • Error while executing query longer thank 32K using dbms_sql

    Hi,
    I'm using oracle database version is 10.2.0.4.0
    I've a query of size 41K.
    I can't run it with execute immediate, so when I'm running it with dbms_sql I'm getting error -
    ORA-06502: PL/SQL: numeric or value error.
    But when I'm running it in my pl/sql developer it is running fine.
    Code snippet is below
    -- Created on 24/05/2010 by TSHARMA
    declare
    -- Local variables here
    cursor_name INTEGER;
    i integer;
    tc clob;
    begin
    -- Test statements here
    select col1 into tc from temp where a1 = 't1'; --getting the long query from a temp table
    tc := 'create table temp1 as ' || tc;
    cursor_name := dbms_sql.open_cursor;
    DBMS_SQL.PARSE(cursor_name, tc, DBMS_SQL.NATIVE);
    i := DBMS_SQL.EXECUTE(cursor_name);
    DBMS_SQL.CLOSE_CURSOR(cursor_name);
    end;
    -------------------------------

    Hi,
    DBMS_SQL.PARSE is overloaded to accept a VARCHAR2A as the statement parameter. This is a table of VARCHAR2(32767) which can be built up using your long query. I've written the following to handle long CLOB's. Just call the execute_sql procedure passing in the long sql:
    PROCEDURE execute_sql (p_sql IN CLOB) IS
       l_sql_table DBMS_SQL.VARCHAR2a;
       l_ds_cursor PLS_INTEGER;
       l_ret_val   PLS_INTEGER;
    BEGIN
       l_sql_table := populate_sql_table(p_sql => p_sql);
       l_ds_cursor := DBMS_SQL.OPEN_CURSOR;
       DBMS_SQL.PARSE(l_ds_cursor, l_sql_table, l_sql_table.FIRST, l_sql_table.LAST, FALSE, DBMS_SQL.NATIVE);
       l_ret_val := DBMS_SQL.EXECUTE(l_ds_cursor);
       DBMS_SQL.CLOSE_CURSOR(l_ds_cursor);
    END execute_sql;
    FUNCTION populate_sql_table (p_sql IN CLOB) RETURN DBMS_SQL.VARCHAR2a IS
       l_buffer_length CONSTANT PLS_INTEGER := 32767;
       l_lob_length PLS_INTEGER;
       l_offset PLS_INTEGER := 1;
       l_amount PLS_INTEGER := l_buffer_length;
       l_sql_table DBMS_SQL.VARCHAR2a;
    BEGIN
       l_sql_table.DELETE;
       l_lob_length := DBMS_LOB.GETLENGTH(p_sql);
       LOOP
          IF l_buffer_length > l_lob_length THEN
             l_amount := l_lob_length;
          END IF;
          l_sql_table(NVL(l_sql_table.LAST, 0) + 1) := DBMS_LOB.SUBSTR(p_sql, l_amount, l_offset);
          l_offset := l_offset + l_buffer_length;
          l_lob_length := l_lob_length - l_amount;
          IF l_lob_length <= 0 THEN
             EXIT;
          END IF;
       END LOOP;
       RETURN(l_sql_table);
    END populate_sql_table;Hope that helps

  • Insert french characters into the database

    Hi,
    My user requirement is to insert french characters into the db. However he has set as per my suggestion of altering session alter session set nls_language='french' he can't insert french characters. Is this using alter session helps to retrieve only the outputs in french language or to insert too?
    Please help.
    Version : oracle 8i
    nls_parameters at database level:
    SQL> select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET US7ASCII
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    PARAMETER VALUE
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_NCHAR_CHARACTERSET US7ASCII
    NLS_RDBMS_VERSION 8.1.7.0.0

    Your database character set is US7ASCII : you can only insert ASCII characters which is OK for most French characters but not all. This cannot work for:
    àéèùçChanging NLS_LANGUAGE won't help. You need to change database character set to WE8MSWIN1252 for example. This should be easy in your case because US7ASCII is a binary subset of many others characters set. Please read http://docs.oracle.com/cd/A87860_01/doc/server.817/a76966/ch3.htm#47136

  • Issue of inserting greek characters into Oracle database using ICAN505

    Hi All,
    We are currently facing an issue of inserting greek characters into Oracle database using ICAN505.
    We receive a file containing greek characters.The values from the file should be inserted into the database.We are reading the file using file OTD with default encoding.
    The file can contain english characters too other than greek characters.
    The database NLS_CHARACTERSET is AL32UTF8.
    When I insert using an insert statement directly ,the values get inserted properly into the DB table.
    Inserting the same values using code results in improper characters getting inserted into the table in the database.
    Please help....
    Thanks in advance !!

    Globalization forum?
    Globalization Support
    It works for SQL Developer, which does not depend on NLS_LANG, so I suspect a problem with your NLS settings.

  • How do I insert Greek characters from the character viewer in Lion?

    In Lion, the Character Viewer shows many more options for different characters than SL.  Of course, it displays Latin, but, as I scientist I often need to insert Greek characters, but I cannot find Greek characters in the Character Viewer.  I don't otherwise need to select Greek as a language.  Inserting Greek characters from some applications like MS Word still works.
    And ... while I'm here ... what happened to the "insert" button?  -j

    Click the gear icon to edit your list:
    Select Customize List:
    and check "Greek"

  • Insert chinese characters in oracle81 database(with code here)

    Hi all,
    I have problem on insert chinese characters in oracle8i database(with code below). But no problem when display chinese characters in HTML( not include in the follow program)
    Can anyone help me?????
    In unix:
    Database setting:
    charset: ZHT16BIG5
    version:8.1.7
    In NT 4.0 with SP5:
    web/app server setting
    webserver: iWs4.0.1
    appserver: iAs6.0
    Java 1.2.2 with download classes12.zip/nls_charset12.zip
    JDBC thin driver
    code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    import java.lang.*;
    import java.lang.reflect.*;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.math.*;
    import oracle.sql.*;
    public class updatedata extends HttpServlet
    Connection dbCon = null;
    ResultSet rs = null;
    DataSource ds1 = null;
    String input_data = "";
    public void doGet(HttpServletRequest req, HttpServletResponse res)
         throws ServletException,IOException{
         input_data = req.getParameter("chinese_input");
    res.setContentType("text/html; charset=BIG5");
    PrintWriter out = res.getWriter();
    // draw a table
    ConnDB(out);
    DrawTable(out);
    public void JDBC(PrintWriter out) throws NamingException {
    InitialContext ctx = null;
    String dsName1 = null;
    Connection conn = null;
         dsName1 = "jdbc/project";
         try {
    ctx = new InitialContext();
    ds1 = (DataSource)ctx.lookup(dsName1);
         }catch (NamingException e) {
         out.println("exception in servlet in JDBC : " + e.toString());
    /** big5 to unicode conversion **/
    private String b2u(String str2convert)
         throws IOException {
         StringBuffer buffer = new StringBuffer();
         byte[] targetBytes = str2convert.getBytes();
         ByteArrayInputStream stream = new ByteArrayInputStream(targetBytes);
         InputStreamReader isr=new InputStreamReader(stream, "BIG5");
         Reader in = new BufferedReader(isr);
         int chInt;
         while ( (chInt = in.read()) > -1 ) {
              buffer.append((char)chInt);
         in.close();
         return buffer.toString();
    private void DrawTable(PrintWriter out){
    try{
         try{
         // update data
         String u="update test_chinese set chinese_script=? where prod_cd=?";
         String sProd = "T1";
         PreparedStatement ps = dbCon.prepareStatement(u);
         ps.setString(1, input_data);
         ps.setString(2, sProd);
         ps.executeUpdate();
         dbCon.commit();
         catch(SQLException e){
              out.println("exception in insert: " + e.toString());
    out.println("<html>");
    out.println("<body>");
    out.println("update success!!!!");
         out.println("</body>");
    out.println("</html>");
         catch(Exception e){
         out.println("exception in servlet in statement: " + e.toString());
    private Connection ConnDB(PrintWriter out){
         try{
         try{
              JDBC(out);
         catch (Exception e) {
              out.println("Database connect failed (init)");
              out.println(e.toString());
              return null;
         dbCon = ds1.getConnection();
         catch(Exception e){
         out.println("exception in servlet in connection: " + e.toString());
    return dbCon;
    public void destroy() {
    //Close database connection
    try {
    dbCon.close();
    catch (Exception e) {
    System.out.println("Error closing database (destroy)");
    System.out.println(e.toString());

    Hi, Jenny,
    When you said unable to insert to database, do you mean you get all ? marks in the database or garbage characters in the database?
    ? marks mean there are some byte chop off, and garbage characters mean the bytes are ok, just encoding problem.
    --Lichu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • "entry in field bank account number is longer than 10 characters"

    Hello Sap Experts,
    The user is getting an error on saving the bank infotype. (0009). The user is trying to create a IT0009 for an international assignee.The error is "entry in field bank account number is longer than 10 characters.
    The default characters allowed maximum specified in the technical field is 18 characters. The abaper also checked and confirmed that it is specified as 18 characters.
    This is only for a single employee.
    Please provide your suggestions.
    Thanks
    Jyothsna

    Jyothsna,
    You need to extend Bank Account number length....even though 18 will be the max length..by default assignment of length will be different from country to country. So you need to extend the length of Bank a/c number in trasaction OY17.....select the country and change the bank a/c number length to 18 and Checking rule to 5 max value length.
    Mohan

  • How to insert chinese characters in a table use FDK?

    Hello~~
    I am expecting to insert chinese characters in an XML file's table.
    I'm using FDK7.2,  if i use:
    F_ApiAddText(docId, &tRange.beg, "asdf");
    The English letters "asdf" can be insert correctly in the right place,
    But,  if insert chinese characters like this:
    F_ApiAddText(docId, &tRange.beg, "人们");
    No characters insert.
    How can i solve this problem?
    Please advise
    Thanks
    zhaopeng

    Zhaopeng,
    Which encoding are you using for the Chinese characters? FrameMaker 7.2 does not support Unicode or UTF-8. I have not done this before, but I guess you need to supply the characters in Big5 resp. GBK encoding, see
    http://help.adobe.com/en_US/FrameMaker/8.0/chinese_korean.pdf
    [Ignore the 8.0 in the URL, the document talks about FrameMaker 7]
    You also may have to make sure the paragraph format at your text location uses a Chinese font before inserting characters.
    - Michael

Maybe you are looking for

  • Trouble-shooting no sound through the right side of Apple earphones with remote...

    Hope this story of trouble-shooting this problem helps someone in the future. For some strange reason, when I listened to a podcast using the Music app through the Apple earphones with remote on my iPhone 4, the right side has no sound.  However, whe

  • Email notification or remedy ticket creation if BI services fails

    Hi All, we are using OBIEE 10.1.3.4.X version as our production instance. we want to set up email notification for a group if any of the BI services fails ( presentation services, Javahost service, Scheduler service etc ). We have 2 unix servers wher

  • How Far Does Lid open Macbook Retina 15

    Hi there Well my 3 year old son decided to jump on my 15" retina Pro and I think that he may have broken the stops that limit how far you screen can open I could be paranoid but can anyone confirm if this is the case ? My screen goes so far back  I j

  • How to resize a rectangle with an image?

    Hey, I am working on a MacBook, for me this combination would be "CMD" + "ALT" + "SHIFT" to resize the Rectangle AND the Image placed inside. How is this possible with Indesign script? I'm working with Javascript. Thanks really much in advance!! Best

  • Trivia for Siri

    Hi there, Siri is a very useful assistant, when you drive a lot in a car. Would be very nice if she could entertain the user a little bit more, like playing answering games (trivia etc).. Are there any extensions?