Update LONG datatype columns

Can anyone point me to a description on how I can update a column of datatype LONG.
I will be using a stored procedure/cursor and need to be able to append a string variable to the end of a LONG datatype column that will have other text.
Thanks in advance,
Miller

The use of LONG has several limitations. Please refer to the SQL Reference for details.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/toc.htm
From the documentation:
You can reference LONG columns in SQL statements in these places:
n SELECT lists
n SET clauses of UPDATE statements
n VALUES clauses of INSERT statements
The use of LONG values is subject to some restrictions:
n A table cannot contain more than one LONG column.
n You cannot create an object type with a LONG attribute.
n LONG columns cannot appear in integrity constraints (except for NULL and NOT
NULL constraints).
n LONG columns cannot be indexed.
n A stored function cannot return a LONG value.
n Within a single SQL statement, all LONG columns, updated tables, and locked
tables must be located on the same database.
LONG columns cannot appear in certain parts of SQL statements:
n WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or
with the DISTINCT operator in SELECT statements
n The UNIQUE operator of a SELECT statement
n The column list of a CREATE CLUSTER statement
n The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
n SQL functions (such as SUBSTR or INSTR)
n Expressions or conditions
n SELECT lists of queries containing GROUP BY clauses
n SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or
MINUS set operators
Note: Oracle Corporation strongly recommends that you convert
LONG columns to LOB columns. LOB columns are subject to far
fewer restrictions than LONG columns. See "TO_LOB" on page 4-111
for more information.

Similar Messages

  • Oracle Personal Edition, data corruption in Long datatype column

    Oracle Personal Edition, data corruption in Long datatype column
    DATA Corruption in Oracle 8i Personal edition
    I am using a Long data type column to store a big text. In oracle Enterprise edition the data stored correctly. But in the Oracle Personal Edition, the Long data type column data corrupted. Some letters in the text are replaced by special character chr(0).
    The following data has been taken from a column (Which is of data type LONG).
    1. In the first one column name Template_ID stored correctly but in the second one T is missing. Some special characters has stored in that place. (Difference is in 6th Line)
    CREATED_DATE####09-21-2001 16:02:00$$LANGUAGE_ID####99$$LOWER_LIMIT####$$MEASURE
    ID####810200082001000004$$MODIFIEDDATE####09-21-2001 16:02:00$$SERVICE_RECEIVED####I$$SERVICE_RECORD####PO:F$$STEP_CODE####8$$STEP_RESULT####Failed$$STEP_ROW_
    ID####2$$TEMPLATE_ID####M116XX$$TEXT####$$UNIQUE_ID####810200082001$$UPPER_LIMIT
    CREATED_DATE####09-21-2001 16:02:00$$LANGUAGE_ID####99$$LOWER_LIMIT####$$MEASURE
    ID####810200082001000004$$MODIFIEDDATE####09-21-2001 16:02:00$$SERVICE_RECEIVED####I$$SERVICE_RECORD####PO:F$$STEP_CODE####8$$STEP_RESULT####Failed$$STEP_ROW_
    ID####2$$TEMPLA E_ID####M116XX$$TEXT####$$UNIQUE_ID####810200082001$$UPPER_LIMIT
    2. In the first one column name Template_ID stored correctly but in the second one E is missing. Some special characters has stored in that place. (Difference is in 6th Line)
    CREATED_DATE####09-21-2001 16:01:19$$LANGUAGE_ID####99$$LOWER_LIMIT####$$MEASURE
    ID####810200082001000002$$MODIFIEDDATE####09-21-2001 16:01:19$$SERVICE_RECEIVED####U$$SERVICE_RECORD####P:F$$STEP_CODE####7$$STEP_RESULT####Failed$$STEP_ROW_I
    D####2$$TEMPLATE_ID####78580A$$TEXT####$$UNIQUE_ID####810200082001$$UPPER_LIMIT#
    CREATED_DATE####09-21-2001 16:01:19$$LANGUAGE_ID####99$$LOWER_LIMIT####$$MEASURE
    ID####810200082001000002$$MODIFIEDDATE####09-21-2001 16:01:19$$SERVICE_RECEIVED####U$$SERVICE_RECORD####P:F$$STEP_CODE####7$$STEP_RESULT####Failed$$STEP_ROW_I
    D####2$$TEMPLAT ID####78580A$$TEXT####$$UNIQUEID####810200082001$$UPPER_LIMIT#

    See if this helps you any:
    Re: Google Maps

  • How to select data(first 10 charcters) from a LONG datatype column.?

    Hi,
    I am getting below error wile i am trying to select forst 10 charcter from a log datatype column. May be I am using it in a wrong way using SUBSTR function.
    I dont know whether SUBSTR works for LONG columns or not as it's char function.
    I am not able to find any inbuild conversion function which will work like TO_CHAR.Please revert.
    My steps:-
    =================================================
    SQL> create table long_varchartest(
    2 nirav long, sangram varchar2(30));
    Table created.
    SQL> insert into long_varchartest values('ns89027','sd22712');
    1 row created.
    SQL> insert into long_varchartest values('Nirav Shah', 'Sangram Dash');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from long_varchartest;
    NIRAV SANGRAM
    ns89027 sd22712
    Nirav Shah Sangram Dash
    SQL> insert into long_varchartest(sangram)
    2 select nirav from long_varchartest;
    select nirav from long_varchartest
    ERROR at line 2:
    ORA-00997: illegal use of LONG datatype

    declare
    l_text varchar2(4000) ;
    begin
      select nirav into l_text from  long_varchartest where sangram = 'sd22712';
      dbms_output.put_line(substr(l_text,1,10)); 
    end ;you could also follow this link [http://www.oracle.com/technology/oramag/code/tips2003/052503.html]

  • Probelm regarding insert into long datatype column

    hi all ,
    in one of my table one column's datatype is long and i want to insert a value into this column but getting following error
    ora-1461 :- can bind a LONG value only for insert into a long column
    please help me
    any help appriciated

    Show us the code...?
    Looks like you are trying to insert into the wrong column.

  • Using UPPER function with LONG datatype column

    Hi,
    Can anyone tell that how can I use UPPER function on a column which has data type as-- LONG?
    For ex--
    SELECT * FROM TABLE WHERE UPPER(LONG_COL) LIKE 'MYTEXT%';
    thanks,
    Abhijeet
    Edited by: @bhijeet ☻☻☻ on Nov 18, 2009 5:20 AM

    @bhijeet ☻☻☻ wrote:
    Yes I know that that's why I am asking about an alternate solution for it. Could you please let me know if you have any solution to do it?
    Thanks,
    AbhijeetI think you'll have to write a function to do this for you. You can use DBMS_SQL to break a LONG into pieces and work with 32K segments. I am not sure how to put the converted data back into the LOB at that point, though DBMS_SQL might provide a way to do this.

  • HS generic and long datatypes in Oracle 8i

    I have a problem importing LONG datatype columns
    from Hyperion Pillar to Oracle (version 8.1.6.0.0) using
    the (Hyperion supplied) ODBC driver and generic HS.
    The error message I get is
    ORA-03001: unimplemented feature
    ORA-02063: preceding line from PILLAR.WORLD
    From the message it seems clear that Oracle cannot
    deal with longs using generic connectivity (at least
    in v. 8.1.6).
    My questions:
    1) Is there a workaround ?
    2) Does this work in 9i ?
    Notes:
    1) The problem is not with the ODBC driver, as I
    can see the long datatype columns using another
    tool which connects to Pillar via ODBC.
    2) HS has been set up correctly because all datatypes
    other than long can be viewed in Oracle without any
    problems.
    3) Operating System: Windows NT 4.00.1381
    Any help would be much appreciated!
    Kailash.

    Thanks for the reply.
    Pillar LONGS (or MEMO, as they are referred to in Pillar)
    map to ODBC SQL_LONGVARCHAR. So it appears that the
    mapping is OK, and that SELECTing from these columns
    should be possible via generic connectivity.
    Any other ideas on what may be wrong? Any help is
    much appreciated.
    Thanks,
    Kailash.

  • VERY URGENT: problem in sql query with long datatype in weblogic

    I have a problem while tryind to retrieve a column value with a long datatype using servlet and oci driver and the server is weblogic5.1 .I have used prepared statement the problem comes in the
    preparedStatement.executeQuery().
    The sql Query is simple query and runs well in all cases and fails only when the long datatype column is included in the query.
    The exception that comes on the weblogic server is that :
    AN UNEXPECTED EXCEPTION DETECTED IN THE NATIVE CODE OUTSIDE THE VM.

    Did you try changing the driver then?
    Please use Oracle's thin driver instead of the oci driver.
    There are many advantages of using the type 4 driver. the first and foremost being that it does not require oracle client side software on your machine. Therefore no enteries to be made in tnsnames.ora
    The thin driver is available in a jar called classes112.zip the class which implements the thin driver is oracle.jdbc.driver.OracleDriver
    the connection string is
    jdbc:oracle:thin:@<machine name>:1521:<sid>
    please try out with the thin driver and let me know.
    regards,
    Abhishek.

  • Creating tables with a long datatype

    I'm trying to create a table which is a copy of a table (and its contents) which has a long datatype column.
    I've got an error on the usual
    create table temp_XXXXX as select * from temp;
    statement.
    Any ideas please

    Can't be done using the CTAS syntax (see the SQL language reference for more details).
    To move LONG/LONG RAW data from one table to another will require some programming. If the LONG data is <32k you could do it in PL/SQL, otherwise you will need to do it in some other language/interface (maybe java?).

  • PHP selecting LONG datatype returns erroneous data

    I have a simple PHP script that queries an 8.1.6 database table with a couple of LONG datatype columns. The resulting output has a bunch of NULL characters and at the end of the column and duplicate data from the previous row. This only happens with this database instance. I run a similar query against a 9.2 database with LOB columns and the data returns correctly.
    $begin = "2004-01-15";
    $end = "2004-01-31";
    $begin = strtotime($begin." 00:00:00");
    $end = strtotime($end." 23:59:59");
    $connection = OCIPLogon($oracleUser, $oraclePasswd, $oracleServer);
    $query = "SELECT create_date, longcol1, longcol2 from table where create_date >= ".$begin." and create_date <= ".$end." order by create_date ";
    $stmt = OCIParse($connection, $query);
    OCIExecute($stmt, OCI_DEFAULT);
    while (OCIFetch($stmt, OCI_ASSOC+OCI_RETURN_LOBS)) {
         $ncols = OCINumCols($stmt);
         for ( $i = 1; $i <= $ncols; $i++ ) {
              $result = ociresult($stmt, $i);
              if (is_object($result)) { echo "LOADING\n"; $result = $result->load(); }
              echo ocicolumnname($stmt, $i)." (".ocicolumntype($stmt, $i).") => ".trim($result)."\n";
         echo "\n";
    output is:
    CREATE_DATE (NUMBER) => 1074186503
    LONGCOL1 (LONG) => This is my first row/column with a long statement in it. 1234567890 bla bla bla bla bla bla bla bla ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
    LONGCOL2 (LONG) => This is my first row second column with a long statement in it. 1234567890 bla bla bla bla bla bla bla bla ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
    CREATE_DATE (NUMBER) => 1074184298
    LONGCOL1 (LONG) => This is my second row first column with a long statement in it. 567890 bla bla bla bla bla bla bla bla ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
    LONGCOL2 (LONG) => This is my second row second column with a long statement in it. 4567890 bla bla bla bla bla bla bla bla ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
    The actual data in the two rows is:
    First record:
    CREATE_DATE => 1074186503
    LONGCOL1 => This is my first row/column with a long statement in it. 1234567890 bla bla bla bla bla bla bla bla
    LONGCOL2 => This is my first row second column with a long statement in it. 1234567890 bla bla bla bla bla bla bla bla
    Second record:
    CREATE_DATE => 1074184298
    LONGCOL1 => This is my second row first column with a long statement in it.
    LONGCOL2 => This is my second row second column with a long statement in it.
    I am running PHP 4.3.6 on Linux. The database is Oracle 8.1.6.3.0.
    Any idea what is causing this?

    Get the latest version of oci8 and re-try. It has been extensively changed since your version. Try pulling the latest PHP from http://snaps.php.net
    Try only querying one LONG at a time (just to test whether it works). I recall LONGS needing special treatment in C code.
    When was the to_lob() function introduced in Oracle?:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions185.htm#SQLRF06134
    Maybe you can convert to a LOB?
    -- cj

  • Updating a LONG RAW column

    I have a table with a column of type LONG RAW that can take binary content of arbitrary length (up to 2 GB). I try to copy content from one row to another using the following SQL:
    UPDATE TEAM_ADM.Content SET (Content, ContentType) =
    (SELECT Content, ContentType FROM Content WHERE ContentId = in_SourceContentID)
    WHERE ContentID = in_TargetContentID;
    Content.Content is the column in question.
    Oracle returns with error ORA-00997:
    ORA-00997 illegal use of LONG datatype
    Cause: A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause.
    Action: Remove the LONG value from the function or clause.
    Question: How can I copy a LONG RAW column from one row to another?
    Regards,
    Kjell Tangen

    Hello,
    It seems that the Long datatypes in Oracle have a lot of restrictions. According to
    this blog:LONG and LONG RAW columns cannot be used in distributed SQL statements.
    In that case, you should update the long raw column on the Oracle side. You can try to use openquery as Rick post above to send the SQL statment to Oracle and execute.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How to Update a clob column..it gives error string literal too long

    I am trying to update a clob column of a table but it gives error string literal too long plz tell me what's the issue
    ORA-01704: string literal too long

    Peeyush wrote:
    I am trying to update a clob column of a table but it gives error string literal too long plz tell me what's the issue
    ORA-01704: string literal too longThere's a problem with my car. It won't start. Why won't it start? Please tell me!
    Oh wait, you can't, because I haven't given you nearly enough information...
    In other words, if you would like help in trying to work out where you've gone wrong, you should provide a small enough example of your code that demonstrates the error. We might then actually stand a chance of being able to help you!

  • How to get length of data on column with long datatype

    How to get length of data on column with long datatype without using pl/sql block

    ...another reason not to use LONG datatype for columns.
    Oracle advises to switch to LOB columns instead
    SQL> create table t
      2  (x long)
      3  /
    Table created.
    SQL> insert into t values (rpad ('x', 10000, 'x'))
      2  /
    1 row created.
    SQL> alter table t
      2  modify x clob
      3  /
    Table altered.
    SQL> desc t
    Name                                      Null?    Type
    X                                                  CLOB

  • Selecting From Column with Long Datatypes

    create table temp
    a long
    insert into temp values ('abc');
    commit;
    select * from temp
    where a = 'abc'
    I am getting the following error while am tring to select a = 'abc';
    ora-00997 : illegal use of LONG datatype
    How can i select values from a column with long datatypes

    insert into temp values ('abc');
    cannot (must not) work, when the column is type long (thats a numeric type!!)
    -> here you get an ora- 00911 errorcode
    that the select doesn't work then should be clear.
    mfg f.humer

  • PHP MaxDB - update on long text column

    Hi!
    I'm getting problem with update statement on long text column via PHP MaxDB.
    As far as there is no example on maxdb_stmt_send_long_data in php documentation, i'm completely stuck with this.
    My table definition:
    CREATE TABLE "ADMIN"."PRESS"
         "ID"  Integer  NOT NULL,
         "R_PUBLICATION"  Varchar (100) ASCII,
         "NUM"  Integer,
         "R_DATE"  Date,
         "R_TITLE"  Varchar (100) ASCII,
         "R_B_TEXT"  Varchar (1000) ASCII,
         "ID_TYPE"  Integer,
         "R_FILENAME"  Varchar (500) ASCII,
         "R_TEXT"  Long ASCII,
         PRIMARY KEY("ID")
    PHP code:
    $stmt = maxdb_prepare($db, "update press set r_publication=?, num=?, r_title=?, r_text=?, r_b_text=?, id_type=?, r_date=?, r_filename=? where id=?");
    maxdb_stmt_bind_param($stmt, 'sisbsissi', $r_publication, $num, $r_title, $r_text, $r_b_text, $id_type, $str_date, $r_filename, $id_f);
    maxdb_stmt_execute($stmt);
    maxdb_stmt_send_long_data ($stmt, 3, $r_text);
    maxdb_stmt_close_long_data($stmt, 3);
    maxdb_stmt_close($stmt);
    After calling the above php-script I get this warning:
    Warning: maxdb_stmt_execute(): Wrong parameter type. Expected: long.
    Has anyone an example on how to update (or insert) LONG string value via the php MaxDB extension?
    Thanks in advance.
    Operating system: CentOS 5.3 Final
    PHP: 5.2.10
    Apache: 1.3.41
    MaxDB: 7.7 Linux 32 Bit
    PHP MaxDb Extension: 7.6.00.38

    We using the procedure to insert and update. Procedure will called to update or insert only one record at a time from XX databse to YY database.
    We are not using SQL * PLUS for this operation.
    Thanks
    Ram

  • Updating and inserting on Long Raw column

    Hi All,
    My source table contains LONG RAW column in XX databse. I have to fetch the data from this table in YY Databse using DB link and insert into same structured table. The problem is, i can not access the LONG RAW data for some rows which the size exceeding above 32k.
    My requirement is, i have to fetch and insert or update the record(Source and target table structure is same and dtabase is different).
    Please suggest the best way of handle this problem.
    Please let me know if you need more information.
    Thanks
    Ram
    Edited by: ram on Oct 19, 2008 2:11 PM
    Edited by: ram on Oct 19, 2008 2:12 PM

    We using the procedure to insert and update. Procedure will called to update or insert only one record at a time from XX databse to YY database.
    We are not using SQL * PLUS for this operation.
    Thanks
    Ram

Maybe you are looking for

  • Calling an action on Click of Radio Button

    Hi, We have a form in which we need to display two radio buttons and two dropdown lists. Depending on the selection of Radio Button the drop down list should change. To get the different data in the dropdown based on the selection of radio button, wh

  • Bridge CS6 occasionally displaying wrong 'Date Created' for .NEF's

    I noticed this problem only recently, and this the third time it happens (that I know of). Sometimes my Bridge puts a wrong Date Created (not Date File Created or Date File Modified) on a NEF RAW file, whilst the next one (taken perhaps just a few se

  • Thread Pool design

    I have one service that processes messages, now I want it to run it in multi threads so it can execute faster. Now my question is how can I make thread pool- what is best design. Since I dont want to create n number of thereads to process n number of

  • Transporting Transfer rules

    Hi All Trasnfer rules are source system specific. In development say we have created them for BW-Dev to R/3 Dev. While transporting them to production. How will we change the assignment from BWDev-R/3DEv to BWprod-R/3 Prod. Thanks PB

  • ADF 10.1.3.4.0, Position Pop Up Dialog

    Hi, is it possible to set the position for a popup dialog on the screen such as the window hight and window width? I want the dialog to be rendered in the middle of the screen. Up to now it is rendered in the left corner. I dont use java script. Than