Type long columns

I can't do "insert as select" statement on tables with long type column.

you will need to create some conversion codes to have the long converted into varchar2 datatype.
  CREATE OR REPLACE Function convert_long_to_char( pTableName in varchar2,
                                                   pColumnName in varchar2,
                                                   pRowId in rowid ) return varchar2 As
    vCursor    integer default dbms_sql.open_cursor;
    vN         number;
    vLongVal  varchar2(4000);
    vLongLen  number;
    vBuflen    number := 4000;
    vCurPos    number := 0;
  begin
    dbms_sql.parse( vCursor,'select ' || pColumnName || ' from ' || pTableName ||
                                                          ' where rowid = :x',
                    dbms_sql.native );
    dbms_sql.bind_variable( vCursor, ':x', pRowId );
    dbms_sql.define_column_long(vCursor, 1);
    vN := dbms_sql.execute(vCursor);
    if (dbms_sql.fetch_rows(vCursor)>0) then
      dbms_sql.column_value_long(vCursor, 1, vBuflen, vCurpos ,
                                 vLongVal, vLongLen );
    end if;
    dbms_sql.close_cursor(vCursor);
    return vLongVal;
  end convert_long_to_char;
  SQL> describe tmp1;
   Name                                      Null?    Type
   P_CODE                                             LONG
  SQL> select p_code from tmp1;
  P_CODE
  1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ 0987654321 QAZWSXEDCRFVTGBYHNUJMIKOLP 0192
  SQL> describe tmp2;
   Name                                      Null?    Type
   P_CODE                                             LONG
  SQL> select p_code from tmp2;
  no rows selected
  SQL> insert into tmp2
    2  select p_code from tmp1;
  select p_code from tmp1
  ERROR at line 2:
  ORA-00997: illegal use of LONG datatype
  SQL> insert into tmp2
    2  select convert_long_to_char('tmp1','p_code',rowid) p_code from tmp1;
  1 row created.
  SQL> commit;

Similar Messages

  • Insert data 32K into a column of type LONG using the oracle server side jdbc driver

    Hi,
    I need to insert data of more than 32k into a
    column of type LONG.
    I use the following code:
    String s = "larger then 32K";
    PreparedStatement pstmt = dbcon.prepareStatement(
    "INSERT INTO TEST (LO) VALUES (?)");
    pstmt.setCharacterStream(1, new StringReader(s), s.length());
    pstmt.executeUpdate();
    dbcon.commit();
    If I use the "standard" oracle thin client driver from classes_12.zip ("jdbc:oracle:thin:@kn7:1521:kn7a") every thing is working fine. But if I use the oracle server side jdbc driver ("jdbc:default:connection:") I get the exception java.sql.SQLException:
    Datasize larger then max. datasize for this type: oracle.jdbc.kprb.KprbDBStatement@50f4f46c
    even if the string s exceeds a length of 32767 bytes.
    I'm afraid it has something to do with the 32K limitation in PL/SQL but in fact we do not use any PL/SQL code in this case.
    What can we do? Using LOB's is not an option because we have client software written in 3rd party 4gl language that is unable to handle LOB's.
    Any idea would be appreciated.
    Thomas Stiegler
    null

    In rdbms 8.1.7 "relnotes" folder, there is a "Readme_JDBC.txt" file (on win nt) stating
    Known Problems/Limitations In This Release
    <entries 1 through 3 omiited for brevity >
    4. The Server-side Internal Driver has the following limitation:
    - Data access for LONG and LONG RAW types is limited to 32K of
    data.

  • Problem with LONG column in 8.1.7

    Hello All,
    Our db version is 8.1.7.0.0. ( Unix OS ).
    We have a table with a LONG column, which stores BINARY data(Billing Details). Is there any way to manipulate it, other than converting it to LOB column?
    I dont know where to start.Any help or hint is appreciated..
    Thanks..

    I did the following test in 10g but not with 8i:
    dev001> set serveroutput on
    dev001>
    dev001> declare
      2  v_b blob;
      3  v_c varchar2(10);
      4  begin
      5  v_b := utl_raw.cast_to_raw('OK');
      6  v_c := utl_raw.cast_to_varchar2(v_b);
      7  dbms_output.put_line(v_c);
      8  end;
      9  /
    OK
    PL/SQL procedure successfully completed.However it is not a good idea to use BLOB data type to store character data: you should use CLOB for character data and BLOB for binary data.

  • Tables in Buzzword: header appearing on all pages, text in long columns disappearing,

    Hello,
    I prefer to use tables within a Buzzword document rather than in a free standing table document.  My appolgies for the descriptions, I do not know the correct terminology for the document types so I am just making them up on the fly.
    My tables are something of a mess.  In Buzzword I can not find the menu to have the header repeated from page to page?  Any guidance would be welcome.
    In my long columns the text disappears between pages, such that the next row on the next page is not a continuation of the previous row but rather the next row?  Any thoughts?
    Thanks,
    Best,

    Hello there,
    Thank you for posting to the Buzzword forum. I'm not sure if this is what you're referring to, but when you choose Insert > Header... in Buzzword, the information you choose to display at the top of each page will automatically repeat on every page; you also have the option to insert a different header on the first page of the document. Unfortunately, if you're referring to a header within the table, there isn't currently any way to automatically repeat that information from page to page. We are aware of demand for this feature, and will continue to work on it, with the goal of eventual implementation.
    As to your other issue - the issue of disappearing text in a long column - that seems like it could use more specific attention; however, most Adobe employees are not here this week (in honor of the holiday), and so I'm afraid I must ask you to wait until next week for troubleshooting. Thank you very much for your patience! I will pass this bug along to the engineering team for inspection as soon as I can.
    Kind regards,
    Rebecca

  • Streaming data to LONG columns in Oracle 7.3.2.3.0

    I am trying to stream data to a LONG column. I'm using Oracle
    Server 7.3.2.3.0 on AIX and JDBC driver 8.0.4 on Windows NT 4
    SP5.
    I include sample tables/programs at the end, but here's the
    summary of what's happening:
    I'm creating a byte array of length 2500. If I use
    setAsciiStream I get the following exception when I execute the
    prepared statement:
    java.sql.SQLException: Data size bigger than max size for this
    type
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem
    (OraclePreparedStat
    ement.java)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setAsciiStream
    (OraclePrepa
    redStatement.java)
    at TestOracle.main(TestOracle.java:26)
    If I use setBinaryStream I get this exception:
    java.sql.SQLException: ORA-01461: can bind a LONG value only for
    insert into a LONG column
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7
    (TTC7Protocol.java)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
    (TTC7Protocol.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther
    (OracleStatement.jav
    a)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
    (OracleStatement
    .java)
    at oracle.jdbc.driver.OracleStatement.doExecute
    (OracleStatement.java)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout
    (OracleStateme
    nt.java)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate
    (OraclePrepar
    edStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.execute
    (OraclePreparedStat
    ement.java)
    at TestOracle.main(TestOracle.java:27)
    My Oracle7 manual states that LONG columns can store 2GB of text.
    I tried the above with LONG RAW columns and it worked fine.
    Can anyone explain why I get this error? I've tried it with
    different sizes and when the data is <2000 bytes it works fine
    for LONG columns.
    My table is simple:
    create table TestLongs (key INTEGER PRIMARY KEY, data LONG);
    My Java code is also very simple:
    public class TestOracle
    public static void main(String[] args)
    Connection con = null;
    PreparedStatement pstmt = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(
    "jdbc:oracle:thin:@itchy:1526:test",
    "System", "<OMITTED>");
    byte[] data = new byte[2500];
    for (int i=0; i< 2500; i++)
    data[i] = 53;
    String sql = "INSERT INTO TestLongs (key, data)
    VALUES(1, ?)";
    pstmt = con.prepareStatement(sql);
    ByteArrayInputStream bis = new ByteArrayInputStream
    (data);
    pstmt.setAsciiStream(1, bis, data.length);
    pstmt.execute();
    catch (SQLException e)
    System.err.println("An error occurred with the
    database: " + e);
    e.printStackTrace();
    catch (Exception e)
    System.err.println("Oracle JDBC driver not found." +
    e);
    e.printStackTrace();
    finally
    try
    if (pstmt != null)
    pstmt.close();
    if (con != null)
    con.close();
    catch (SQLException e)
    System.err.println("Unable to close
    statement/connection.");
    null

    Robert Greig (guest) wrote:
    : I am trying to stream data to a LONG column. I'm using Oracle
    : Server 7.3.2.3.0 on AIX and JDBC driver 8.0.4 on Windows NT 4
    : SP5.
    I tried it with the old 7.3.x JDBC driver and it works fine. I
    also noticed after further testing that it sometimes worked
    with the 8.0.4 driver. Looks like a bug in the 8.0.4 driver or
    some wacky incompatibility.
    null

  • ORA-01461: can bind a LONG value only for insert into a LONG column in 11.2

    Hello,
    We have been getting the following exception when we try to save an XML (>5k).
    SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
    This is occurring only for Oracle 11g (11.2.0.1.0)
    Our column is CLOB type, not LONG type.
    Could anyone please suggest what could be the reason and fix?
    Thanks in advance
    --Cheers
    paruvid

    Thanks for quick response!!
    Inserting throw JDBC (Spring jdbcTemplate)
    using the ojdbc6.jar as driver
    here is the stask strace
    Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO tabl1(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15,c16(CLOBCOL),c17, c18, c19) SELECT c1,c2, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? FROM table2 S JOIN table1 D ON S.c1 = D.c1 WHERE S.c2 = ? AND D.c5 = ? GROUP BY S.c1];
    SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
    ; nested exception is java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:786)
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:842)
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:846)
    at com.smartstream.cms.message.dao.SSIMessageDao.editSSIInstance(SSIMessageDao.java:522)
    ... 52 more
    Caused by: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Edited by: paruvid on Aug 9, 2011 5:07 AM
    Edited by: paruvid on Aug 9, 2011 5:17 AM
    Edited by: paruvid on Aug 9, 2011 5:23 AM

  • How can find out LONG column database?

    Hi,
    in my database ORA-1461 error occured
    01461, 00000, "can bind a LONG value only for insert into a LONG column
    how can find out LONG column in my database ?

    DESCRIBE
    The description for tables, views, types and synonyms contains the following information:
    each column's name
    whether or not null values are allowed (NULL or NOT NULL) for each column
    datatype of columns, for example, CHAR, DATE, LONG, LONGRAW, NUMBER, RAW, ROWID, VARCHAR2 (VARCHAR), or XMLType
    precision of columns (and scale, if any, for a numeric column)
    Extract of the link;
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12019.htm#SQPUG040
    Secondly with reference to the error;
    Do not try to insert LONG datatypes into other types of columns.
    Hope this helps.
    Adith

  • Please Help - SQL Report long column value required in a separate cell

    Hi.
    I need to create a SQL report with the structure like below:
    Country State City Vertical Business Details (detail desc)
    US MA Quincy Healthcare
    This is a detail desc value that needs to displayed in a different cell.
    This is a detail desc value that needs to displayed in a different cell.
    This is a detail desc value that needs to displayed in a different cell.
    This is a detail desc value that needs to displayed in a different cell.
    US MA Braintree IT
    This is a detail desc value that needs to displayed in a different cell.
    This is a detail desc value that needs to displayed in a different cell.
    This is a detail desc value that needs to displayed in a different cell.
    I came through a solution where you can hide/display the long column value in a different cell. But my requirement is that it should be displayed when the page opens and user don;t want to click on a button to see the value. This is mainly for their presentations and printing. so its very annoying for them to click on so many buttons to see the detail desc value for every record. I am new to Java script, Please help

    I'm not sure I understand your requirements--are you showing us 2 lines of data, 7 lines, or 9? Do you want the long detail description on the same row, or underneath it?
    I'm going to go on the assumption that you're showing us two rows, and that the long descriptions in this example happen to be 3-4 lines long, and that you want the long descriptions underneath the details. In which case, I suggest using "named column" templates. They're a lot easier to use than they appear when you first look at them, so bear with me.
    Under "Shared Components", select "Templates", and then click on the yellow Create> button. You're creating a report template, from scratch. On the final page of the wizard, select "Named Column (row template)" for the template type. This will create a rather generic (and useless) template, which you'll have to edit; I don't know why they chose to not send you straight into the editor. When you edit it, you'll see that the only field with a value in it is "Row Template 1", and it's set to:
    <tr><td>#1#</td><td>#2#</td><td>#3#</td><td>#4#</td><td>#5#</td></tr>For meeting your requirements with basic functionality, change it to something along the lines of:
    <tr><td>#COUNTRY#</td><td>#STATE#</td><td>#CITY#</td><td>#VERT#</td></tr>
    <tr><td colspan="4">#DETAILS#</td></tr>Then you'll probably want to put something under Column Heading Template, like:
    <tr><td>Country</td><td>State</td><td>City</td><td>Vertical Business</td></tr>
    <tr><td colspan="4">Details</td></tr>Apply whatever CSS styles you want to it, of course.
    Using the template is straightforward: if your report, chose the template, and make sure your SQL returns values using the column names you specified in your template. Otherwise, you'll see literal "#COUNTRY#" text in your report.
    You can get fancy with these, of course, such as applying different styles to alternating rows, but I'll leave this as good enough to get you started (I hope).
    -David

  • Is it possible to use LONG columns in WHERE clause or ORDER BY?

    Is it possible to use LONG columns in WHERE clause or ORDER BY?

    Hi,
    LONG data type is deprecated, maybe could you change your column type to LOB ?
    Nonetheless below is a workaround which may fit your needs if forced to use LONG.
    It uses a function which returns you a CLOB. It allows you to use the converted "LONG" column in a WHERE clause.
    Then if you want to order by you have to convert the CLOB to a VARCHAR using DBMS_LOB.SUBSTR.
    SQL> CREATE TABLE my_table (id NUMBER, description LONG);
    Table created.
    SQL> INSERT INTO my_table VALUES (1, 'FIRST LONG');
    1 row created.
    SQL> INSERT INTO my_table VALUES (2, 'ANOTHER LONG');
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> CREATE TYPE my_type_row AS OBJECT (id INTEGER, description CLOB);
      2  /
    Type created.
    SQL> CREATE TYPE my_type_table AS TABLE OF my_type_row;
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION get_my_long
      2     RETURN my_type_table
      3     PIPELINED
      4  AS
      5     v_tab   my_type_table := my_type_table ();
      6  BEGIN
      7    FOR cur IN (SELECT id, description FROM my_table)
      8  LOOP
      9        PIPE ROW (my_type_row (cur.id, cur.description));
    10  END LOOP;
    11  RETURN;
    12  END;
    13  /
    Function created.
    SQL> SELECT
      2     id,
      3     description
      4  FROM
      5     TABLE (get_my_long ())
      6  WHERE
      7     description LIKE '%LONG'
      8  ORDER BY
      9     DBMS_LOB.SUBSTR(description);
      ID DESCRIPTION
       2 ANOTHER LONG
       1 FIRST LONG
    SQL> SELECT
      2     id,
      3     description
      4  FROM
      5     TABLE (get_my_long ())
      6  WHERE
      7     description LIKE 'FI%';
      ID DESCRIPTION
       1 FIRST LONG
    SQL>Kind regards,
    Ludovic

  • LONG COLUMN을 가진 TABLE의 COPY

    제품 : SQL*PLUS
    작성날짜 : 1995-11-13
    문제 설명
    =========
    LONG COLUMN을 가진 테이블을 COPY를 해야 하는 경우 LONG COLUMN은 Subquery
    를 사용할 수 없기 때문에 다음과 같은 현상이 발생한다.
    1. "CREATE TABLE ... AS SELECT ..." 명령이나
    "INSERT INTO ... SELECT ..."
    를 사용하는 경우 ORA-0997 에러가 발생한다.
    2. SQL*Plus의 COPY 명령을 사용하는 경우 CPY0005 에러가 발생한다.
    해결 방법
    =========
    가장 쉬운 방법은 PL/SQL에서 VARCHAR2 혹은 LONG DATA TYPE을 이용하여 COPY
    한다. PL/SQL에서 VARCHAR2 및 LONG 변수는 32K까지 사용할 수 있기 때문에
    32K 이하 데이타라면 가능하고 그 이상의 데이타는 3GL을 이용한다.
    < TABLE >
    SQL> CREATE TABLE LONGTAB(NO NUMBER(2), TEXT LONG);
    < PL/SQL Script >
    DECLARE
    string varchar2(32000);
    no number(2);
    cursor c1 is
         SELECT no, text FROM longtab;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO no, string;
    exit when c1%NOTFOUND;
    INSERT INTO longtab2 VALUES (no, string);
    END LOOP;
    COMMIt;
    END;
    /

    아래 내용을 참고하세요...
    LONG COLUMN을 가진 TABLE의 COPY
    Bulletin no : 10147
    문제 설명
    =========
    LONG COLUMN을 가진 테이블을 COPY를 해야 하는 경우 LONG COLUMN은 Subquery
    를 사용할 수 없기 때문에 다음과 같은 현상이 발생한다.
    1. "CREATE TABLE ... AS SELECT ..." 명령이나
    "INSERT INTO ... SELECT ..."
    를 사용하는 경우 ORA-0997 에러가 발생한다.
    2. SQL*Plus의 COPY 명령을 사용하는 경우 CPY0005 에러가 발생한다.
    해결 방법
    =========
    가장 쉬운 방법은 PL/SQL에서 VARCHAR2 혹은 LONG DATA TYPE을 이용하여 COPY
    한다. PL/SQL에서 VARCHAR2 및 LONG 변수는 32K까지 사용할 수 있기 때문에
    32K 이하 데이타라면 가능하고 그 이상의 데이타는 3GL을 이용한다.
    < TABLE >
    SQL> CREATE TABLE LONGTAB(NO NUMBER(2), TEXT LONG);
    < PL/SQL Script >
    DECLARE
    string varchar2(32000);
    no number(2);
    cursor c1 is
    SELECT no, text FROM longtab;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO no, string;
    exit when c1%NOTFOUND;
    INSERT INTO longtab2 VALUES (no, string);
    END LOOP;
    COMMIt;
    END;
    /

  • Weird exception in 12c (ORA-01461: can bind a LONG value only for insert into a LONG column)

    I have a Windows app that accesses an Oracle 12c database via ODBC (the driver version is 12.01.00.01).
    I have a table that has a key column named REGION_ID (NVARCHAR2(9)), and about a dozen other columns, three of which are named REGION1, REGION2, and REGION3, all of type NVARCHAR2(40).
    When I try to insert a string into the REGION1 field that's greater than 9 characters (the length of REGION_ID), I get an ORA-01461 error ('Can bind a LONG value only for insert into a LONG column). If I define the length of REGION_ID to be NVARCHAR2(15), then I can add strings to the REGION1 field with a length up to 15 before I get the ORA-01461 exception again. Oddly, if I change the REGION1 column name to REGIONONE, I do not get any errors, and everything works fine. It's almost as if the column name REGION1 is being confused with REGION_ID behind the scenes.
    Any ideas? I’m using SQLBindParameter to bind the columns, and all of the calls succeed. I get the exception when I execute the insert statement. This same code worked for previous versions of Oracle (11g, 10g, and 9i). And if I use an 11g client driver against the 12c server, I do not get the exception.
    Thanks!

    Sorry, I was just now able to install the patch for bug 18232462, and it did indeed solve the issue I described above. Thanks!

  • How to select for insert a long column through database link?

    How may a long column (for example a sql server 2000 text column) be selected for insert into a clob column in table in 10g over a database link without invoking ora-00997?
    I've tried using dbms_metadata_util.long2clob without success over a database link.

    Is the remote database an Oracle database? Or are you selecting data from SQL Server 2000 over a database link via Heterogeneous Services? What is the data type of the column in the remote database (LONG? TEXT? Something else?)?
    Justin

  • UpdateCharacterStream for LONG column gives SQLException: Data size bigger than max

    I have a LONG column and when I call updateCharacterStream via the resultset I get the following error:
    SQLException: Data size bigger than max size for this type: 2391
    I am trying to update the column with a value that is 2391 in length. The column is defined as a LONG so it is plenty big enough.
    What gives?
    If I use a UTF-8 database it works OK. But if I use a db that is on the default character set I get the error. There are NO multibyte characters, I just happened to test it against my unicode db and it worked.

    This only happens with the thin driver. I am using 8i. It also works OK if the target db is in UTF8!
    D:\myjava>java OracleLongTest
    Registering the ORACLE JDBC drivers.
    Connecting to database
    Connection = oracle.jdbc.driver.OracleConnection@1616c7
    Insert via prepared statement with reader length = 2200
    Insert with prepared statement was successfull
    Updating via prepared statement with reader length = 2200
    Update with prepared statement was successfull
    ===========================================================================
    ticketDesc len = 2200 mod date = 970510081398
    Updating with reader length = 2200
    Updating C1 ts = 970510081608
    Updating the row...
    Exception 2 = java.sql.SQLException: Data size bigger than max size for this type: 2200
    java.sql.SQLException: Data size bigger than max size for this type: 2200
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:775)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:82)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:761)
    at oracle.jdbc.driver.OraclePreparedStatement.setDatum(OraclePreparedStatement.java:1464)
    at oracle.jdbc.driver.OraclePreparedStatement.setCHAR(OraclePreparedStatement.java:1397)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:1989)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2200)
    at oracle.jdbc.driver.OraclePreparedStatement.setOracleObject(OraclePreparedStatement.java:2216)
    at oracle.jdbc.driver.UpdatableResultSet.prepare_updateRow_binds(UpdatableResultSet.java:2070)
    at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1287)
    at OracleLongTest.run(OracleLongTest.java:146)
    at OracleLongTest.main(OracleLongTest.java:41)
    FINISHED!!
    StringBuffer sb = new StringBuffer("");
    for(int i = 0; i < 2200; i++)
    sb.append("X");
    Statement stmt = con.createStatement();
    try
    String insertSQL = "CREATE TABLE MYLONGTEST (C1 NUMBER(38), C2 LONG)";
    stmt.executeUpdate(insertSQL);
    catch( SQLException se) {}
    PreparedStatement insertPstmt = con.prepareStatement("INSERT INTO MYLONGTEST VALUES (?, ?)");
    PreparedStatement updatePstmt = con.prepareStatement("UPDATE MYLONGTEST SET C2 = ? WHERE C1 = ?");
    PreparedStatement selectPstmt = con.prepareStatement("SELECT C1,C2 FROM MYLONGTEST WHERE C1 = ?", 1004, 1008);
    long ts = System.currentTimeMillis();
    String value = sb.toString();
    Reader rdr = new StringReader(value);
    int len = value.length();
    try
    System.out.println("Insert via prepared statement with reader length = " + len);
    insertPstmt.setLong(1, ts);
    insertPstmt.setCharacterStream(2, rdr, len);
    insertPstmt.execute();
    System.out.println("Insert with prepared statement was successfull");
    catch( SQLException se )
    System.out.println("Caught exception = " + se.toString());
    try
    System.out.println("Updating via prepared statement with reader length = " + len);
    rdr = new StringReader(value);
    updatePstmt.setCharacterStream(1, rdr, len);
    updatePstmt.setLong(2, ts);
    int rowcount = updatePstmt.executeUpdate();
    System.out.println("Update with prepared statement was successfull");
    updatePstmt.close();
    catch( SQLException se )
    System.out.println("Caught exception = " + se.toString());
    System.out.println("===========================================================================");
    selectPstmt.setLong(1, ts);
    ResultSet rs = selectPstmt.executeQuery();
    rs.absolute(1);
    String c2 = rs.getString("C2");
    ts = rs.getLong("C1");
    System.out.println("c2 len = " + c2.length() + " mod date = " + ts);
    rs.absolute(1);
    ts = System.currentTimeMillis();
    System.out.println("Updating with reader length = " + len);
    rdr = new StringReader(value);
    rs.updateCharacterStream("C2", rdr, len);
    ts = System.currentTimeMillis();
    System.out.println("Updating C1 ts = " + ts);
    rs.updateLong("C1", ts);
    System.out.println("Updating the row...");
    rs.updateRow();
    null

  • Text search query into long column

    hi,
    I need some explanation about this situation:
    I need to perform a search into a long column containing XML file. Not all records found match my search criteria.
    If I search in a varchar column it seem to be correct, so have you any suggest for me?
    thanks in advance,
    Virginio
    null

    I'm working with Oracle8i version 8.1.7
    realese 3.
    This is an example of query that I'm using:
    select *
    from <table>
    where contains (<column>, <string>, 0) > 0
    where <column> is of type Long and <string>
    is the text to search. At the moment I don't need to apply any score filter.
    I've generated the index on this table as suggested by documentation:
    create index <index_name> on <table>(<column>) indextype is ctxsys.context;
    Thanks in advanced,
    Virginio.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Omar Alonso ([email protected]):
    Could you please post the test case? What's the db version and platform?<HR></BLOCKQUOTE>
    null

  • Newbie - My site changes to one long column after uploading to server

    I have to create a website to international students in our
    uni, but I have never done this before so I decided it would be
    better to use a template and change the text etc... The problem is:
    In the template (which came with Dreamweaver 8) there is one column
    on the left with some links, One wider column in the centre with
    space to add an image, and another column on the right, similar to
    the one on the left. So I just added some sample text and uploaded
    the site to the server to test it. Now when I load the page in my
    web browser (
    http://intstu.byethost31.com/intstu1.html)
    I get no columns but just one long column... Can anyone explain
    what I am doing wrong!
    Thanks a lot!

    > Can anyone explain what I am doing wrong!
    For one thing you are using one of the CSS layouts in DW.
    Unless you are
    very comfortable with CSS and HTML, this was a mistake. Those
    layouts are
    fiddly and flaky.
    For another, it doesn't look like you have uploaded the
    stylesheet -
    <link rel="stylesheet" href="3col_leftNav.css"
    type="text/css" />
    Did you?
    Really, I suggest you start again, and find a template more
    suited to a)
    normal use, and b) your skill level. I'd start here -
    http://dreamweaverresources.com/
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "v@ny@" <[email protected]> wrote in message
    news:ekbi9i$d6p$[email protected]..
    >I have to create a website to international students in
    our uni, but I have
    > never done this before so I decided it would be better
    to use a template
    > and
    > change the text etc... The problem is: In the template
    (which came with
    > Dreamweaver 8) there is one column on the left with some
    links, One wider
    > column in the centre with space to add an image, and
    another column on the
    > right, similar to the one on the left. So I just added
    some sample text
    > and
    > uploaded the site to the server to test it. Now when I
    load the page in my
    > web
    > browser (
    http://intstu.byethost31.com/intstu1.html)
    I get no columns but
    > just
    > one long column... Can anyone explain what I am doing
    wrong!
    > Thanks a lot!
    >
    >
    >
    >
    >

Maybe you are looking for

  • DTW BUSINESS PARTNER IMPORT

    Hi all, I've been attempting to import customers to a database and I seem to have mapped all of the fields except I can't seem to get a "state" in the mail to section of the card. I looked at the choices available when mapping in the DTW but I'm unsu

  • Change report database

    I guys: i have a problem when I am trying to change the report database. the report is currently using a oracle sql to fetch data into the report. when i try to move it to another database (test envirment) tables' schema name is changed so i basicly

  • Signature validation unknown

    After digital signing a document I get the remark in the top of the screen: "validation of document certification is unknown. the author could not be checked". I asked the company for my signature card and they checked my document with the signature.

  • Trouble with current playback time on progress bar

    First, some terminology. As Adobe Flash Player is preparing to play a video, it displays a spinning icon in the center of the video window.  I have seen web pages which refer to this as the spinning beach ball.  I will refer to this simply as the "sp

  • Why no shortcuts in the Notification center?

    Does anyone know why there's no shortcuts in the Notification center? (Bluetooth, volume, brightness ect.) Android has it on all there phones.