Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Netherlanths
    Posts
    2

    Unanswered: update a long without ORA-00932

    I want to execute a statement like the following:

    UPDATE TABLE
    SET LONGF=REPLACE(LONGF,LOWER('&1'),LOWER('&2'))
    WHERE [clause]

    This returns:
    ERROR at line 2:
    ORA-00932: inconsistent datatypes
    on LONGF (a long field). Can anybody tell me how to solve this problem?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: update a long without ORA-00932

    You can't do much with LONGs - in fact, they are more or less obsolete, and new databases should not use LONG (use CLOB if VARCHAR2 isn't big enough).
    If the value is under 32K chars you can use PL/SQL:

    DECLARE
    v_longf LONG;
    BEGIN
    SELECT longf INTO v_longf FROM table WHERE...;
    v_longf := REPLACE( v_longf, ... );
    UPDATE table SET longf = v_longf WHERE ...;
    END;
    /

  3. #3
    Join Date
    Nov 2002
    Location
    Netherlanths
    Posts
    2
    It works. Thanks a lot, now I can implement it in the refresh of our database.

    Note: the usage of a long was not our choice, it's PeopleSoft :-(

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •