Function to covert LONG to CLOB

Can you please tell me the name of the function through which I can change the LONG datatype to CLOB.

There is a function called to_lob(). You can use it only inside a subquery of an INSERT statement.
Try doing something like this..
1. Create an equivalent table except that instead of LONG use a CLOB datatype.
2. Insert into that table using something like...
INSERT INTO table_name SELECT a, b, to_LOB(long_column), c FROM original_table;
3. DROP ur table and rename the other table.
Or you can do some other trickery.
Regards,
Naveen

Similar Messages

  • Using long vs. clob datatype with Oracle 8.1.7 and interMedia

    I am trying to determine the best datatype to use for a column I
    wish to search using the interMedia contains() function. I am
    developing a 100% java application using Oracle 8.1.7 on Linux.
    I'd prefer to use the standard JDBC API's for PreparedStatement,
    and not have to use Oracle extensions if possible. I've
    discovered that there are limitations in the support for LOB's
    in Oracle's 100% java driver. The PreparedStatement methods
    like setAsciiStream() and setCharacterStream() are documented to
    have flaws that may result in the corruption of data. I have
    also noticed that socket exceptions sometimes occur when a large
    amount of data is transferred. If I use the long datatype for
    my table column, the setCharacterStream() method seems to
    transfer the data correctly. When I try to search this column
    using the interMedia contains() function, I get strange
    results. If I run my search on Oracle 8.1.6 for Windows, the
    results seem to be correct. If I run the same search on Oracle
    8.1.7 for Linux, the results are usually incorrect. The same
    searches seem to work correctly on both boxes when I change the
    column type from long to clob. Using the clob type may not be
    an option for me since the standard JDBC API's to transfer data
    into internal clob fields are broken, and I may need to stick
    with standard JDBC API's. My customer wishes to purchase a
    version of Oracle for Linux that will allow us to implement the
    search capability he requires. Any guidance would be greatly
    appreciated.

    I've finally solved it!
    I downloaded the following jre from blackdown:
    jre118_v3-glibc-2.1.3-DYNMOTIF.tar.bz2
    It's the only one that seems to work (and god, have I tried them all!)
    I've no idea what the DYNMOTIF means (apart from being something to do with Motif - but you don't have to be a linux guru to work that out ;)) - but, hell, it works.
    And after sitting in front of this machine for 3 days trying to deal with Oracle's, frankly PATHETIC install, that's so full of holes and bugs, that's all I care about..
    The one bundled with Oracle 8.1.7 doesn't work with Linux redhat 6.2EE.
    Don't oracle test their software?
    Anyway I'm happy now, and I'm leaving this in case anybody else has the same problem.
    Thanks for everyone's help.

  • Function keys no longer working with a new keyboard...

    I got a new keyboard and my function keys no longer work with it.  I am used to have them used in the standard format, i.e. F10-F12 control the voume, etc.  I have the "Use all f1,f2, etc." button clicked.  I have also tried restarting my computer.  Any thoughts?

    Try doing a SMC reset and PRAM reset.
    SMC RESET
    Shut down the computer.
    Unplug the computer's power cord and all peripherals.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Attach the computers power cable.
    Press the power button to turn on the computer.
    PRAM RESET
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • How to copy a table with LONG and CLOB datatype over a dblink?

    Hi All,
    I need to copy a table from an external database into a local one. Note that this table has both LONG and CLOB datatypes included.
    I have taken 2 approaches to do this:
    1. Use the CREATE TABLE AS....
    SQL> create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db;
    create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. After reading some threads I tried to use the COPY command:
    SQL> COPY FROM xxxx/pass@ext_db TO xxxx/pass@target_db REPLACE XXXX_INDV_DOCS USING SELECT * FROM XXXX_INDV_DOCS;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    CPY-0012: Datatype cannot be copied
    If my understanding is correct the 1st statement fails because there is a LONG datatype in XXXX_INDV_DOCS table and 2nd one fails because there is a CLOB datatype.
    Is there a way to copy the entire table (all columns including both LONG and CLOB) over a dblink?
    Would greatelly appriciate any workaround or ideas!
    Regards,
    Pawel.

    Hi Nicolas,
    There is a reason I am not using export/import:
    - I would like to have a one-script solution for this problem (meaning execute one script on one machine)
    - I am not able to make an SSH connection from the target DB to the local one (although the otherway it works fine) which means I cannot copy the dump file from target server to local one.
    - with export/import I need to have an SSH connection on the target DB in order to issue the exp command...
    Therefore, I am looking for a solution (or a workaround) which will work over a DBLINK.
    Regards,
    Pawel.

  • Literal too long when inserting 4000 chars to long or clob

    How to avoid getting the 'literal too long' error when inserting a string >4000 chars to a long or clob field?

    A string literal can only be 4000 characters. To insert into a LOB, you need to use the dbms_lob package.
    Justin

  • Function convertion from blob to clob

    Plesae need help,to make function convert from blob to clob
    i have function but not work when coulmn of blob is vey large
    =========================================================================================
    CREATE OR REPLACE PACKAGE BODY "SHB_PACKAGE"
    AS
    FUNCTION blob2clob (l_blob BLOB)
    RETURN CLOB
    IS
    l_clob CLOB;
    l_src_offset NUMBER;
    l_dest_offset NUMBER;
    l_blob_csid NUMBER := DBMS_LOB.default_csid;
    v_lang_context NUMBER := DBMS_LOB.default_lang_ctx;
    l_warning NUMBER;
    l_amount NUMBER := dbms_lob.lobmaxsize;
    BEGIN
    IF l_blob is null
    THEN
    return null;
    ELSE
    DBMS_LOB.createtemporary (l_clob, TRUE);
    l_src_offset := 1;
    l_dest_offset := 1;
    l_amount := NVL(DBMS_LOB.getlength (l_blob),0);
    DBMS_LOB.converttoclob (l_clob,
    l_blob,
    l_amount,
    l_src_offset,
    l_dest_offset,
    0,
    v_lang_context,
    l_warning
    RETURN l_clob;
    END IF;
    END;
    END SHB_package;

    thanks,function is working fine
    issue duo to i used under informatice and bug in informatica
    Edited by: user8929623 on Jan 17, 2010 1:39 AM

  • REPLACE function on a long data type

    How can I use the replace function on a long data type?
    I am getting ORA-00932: inconsistent datatypes: expected CHAR got LONG

    Thanks so much dainge! Your example helped me to do it. I guess the trick is to put the long datatype into the declared variable first. This is what worked (of course commit after):
    declare
    l long;
    begin
    select rppl_sql_statement into l
    from rppl
    where rppl_slct = 12128;
    l := replace(l,'ROPPL96','ROPPL97');
    update rppl
    set rppl_sql_statement = l
    where rppl_slct = 12128;
    end;

  • ABAP Function to read long texts in HR Infotypes

    Is there any standard ABAP function to read long texts in HR infotypes like ABAP function to read comments entered in infotype 19

    HI ,
    try this code
    tables pcl1.
    include rpc1tx00.  " This include is explained on web page above
    start-of-selection. 
    perform fill_key.  perform get_data.end-of-selection.
    form fill_key. 
      tx-key-pernr = p_pernr.
      tx-key-infty = p_infty.
      tx-key-subty = p_subty.
      tx-key-objps = p_objps. 
      tx-key-sprps = p_sprps.
      tx-key-endda = p_endda. 
    tx-key-begda = p_begda.
    tx-key-seqnr = p_seqnr.
    "OR
      SELECT * INTO CORRESPONDING FIELDS OF wa_p0219
       FROM pa0219
       WHERE pernr = p_pernr
         AND subty =  p_subtyp
         AND endda = '99991231'.
      ENDSELECT.
    MOVE-CORRESPONDING gs_p0219 TO tx-key.
        MOVE '0219' TO tx-key-infty.
         IF wa_p0219-itxex = 'X'.
           MOVE-CORRESPONDING wa_p0219 TO tx-key.
         endif.
    endif
    endform.                    " fill_key
    form get_data. 
          import ptext from database pcl1(tx) id tx-key.
           loop at ptext.            "ptext is defined in above include  
                   write: / ptext-line. 
          endloop.
    endform.  " get_data
    Prabhudas

  • Seems the gyroscope function is no longer working on my iPhone 5c. Suggestions?

    Seems the gyroscope function is no longer working on my iPhone 5c. Suggestions?

    Thank you so much for this reply.  I had already seen this reboot suggestion and actually tried it.  During the night I realized that I had phrased the question wrong because I really had the issue of getting my iPhone to change to LANDSCAPE mode. For some reason I asked for help on the gyroscope Thinking that the gyroscope controlled this feature.  I found that I had accidentally turned on the "orientation lock"  and by bringing up the control panel from the bottom of the screen I was able to find this lock button and correct the problem.    The truth is ---- the iPhone scree is so small that I was not able to see this little lock symbol at all.   I found this symbol on my iPad and transferred the knowledge to my iPhone.  Everything is working fine now And I thank you very much for taking the time to write to me.  SuzanneVA

  • I have been using Photoshop Elements 11 photo merge function.  However, the Photomerge panorama function is no longer accessible - it is visible but greyed out on the "enhance" menu.  I have tried to reinstall software, but no change.

    I have been using Photoshop Elements 11 photo merge function.  However, the Photomerge panorama function is no longer accessible - it is visible but greyed out on the "enhance" menu.  I have tried to reinstall software, but no change.

    Click on Expert and the Enhance>Photomerge>Photomerge Panorama should be available

  • Procedure to convert from long to clob

    please need to procedure migrate data from long to clob,with variables
    V_SRC_TABLE (LONG) to V_TRAGT_TABLE (CLOB)
    SOURCE AND TARGET TABLE HAVE TWO COLUMNS
    SOURCE_TABLE
    VARACHAR2
    LONG
    TARGET_TABLE
    VARACHAR2
    CLOB

    Hi,
    assuming you want to convert data always from source_table to target_table knowing the column names, let's say:
    SQL> CREATE TABLE source_table(col1 VARCHAR2(10), col2 LONG);
    Table created.
    SQL> CREATE TABLE target_table(col1 VARCHAR2(10), col2 CLOB);
    Table created.You can just copy the data using SQL:
    INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table;Or, as a procedure:
    CREATE OR REPLACE PROCEDURE migrate_to_clob IS
    BEGIN
      EXECUTE IMMEDIATE 'INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table';
    END;Hope it helps.

  • HELP! - Converting LONG to CLOB in  PL/SQL

    can i pass in a LONG as a parameter to a stored procedure and in
    the stored procedure convert or assign it to a CLOB column? i
    have tried passing in a CLOB as an input parameter using OO4O
    without any success. i am using the oracle oledb provider
    currently but may convert it over to using OO4O if i have to. i
    know i can pass in a LONG via ADO as an adLongVarChar datatype,
    but i am not sure what to do with the LONG inside the stored
    procedure. if anyone knows how to get a LONG into a CLOB could
    you please post some very basic sample PL/SQL code.
    if there is an easier way please let me know!
    the reason i am using CLOB's is because i need more than one
    LONG in certain tables, and you can only have 1 LONG per table.
    thanks

    i should have mentioned i am using oracle 8.1.7.2.1 and when i
    try to use TO_LOB() i get "Identifier TO_LOB must be declared."
    so i am assuming this is an oracle 9 function. is this correct?

  • Long and  clob datatype

    Hello Gurus
    we are working on oracle 8.1.4.0.in our database i have a table that contain a long column and a clob cloumn. i need backup of this table so that i can create the same table with data in other schema. Is there any recommmanded way. Can use copy or i need to use an export backup .
    thanks

    If possible, try to upgrade your long columns to lob. Working with long columns will severely limit the possibilities of adopting new features. It would have been easier to use the
    ALTER TABLE MOVE ... command.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • String literal too long for CLOB

    Q1. I would like to insert text of 10000 chars into a column with data type CLOB via an ASP program connecting to Oracle9i. Which data type is most appropriate to input 10000 chars into a column?
    Q2. I would like to insert text UNICODE Traditional Chinese into a column with data type NCLOB, data is stored but when it is retrieved via Internet Explorer, strang chars are displayed instead of Traditional Chinese. Can any one tell me how you could store Chinese Chars, retrieve and display Chinese Chars properly in Internet Exlplorer via ASP program?

    10,000 characters is too long for a varchar2 column, but CLOB's will let you store a couple of Gb.
    When you're dealing with inserting and retrieving Traditional Chinese characters, you need to ensure that the NLS settings on your client and on your database are such that the character sets on both machines actually support the characters in question. I'm guessing that your client machine isn't configured to support those characters. If you go to http://tahiti.oracle.com and search for NLS, you'll get a boat-load of documents about how to approach this sort of problem If you haven't reviewed these yet, I'd strongly suggest doing so.
    Justin

  • Function to retrieve long text in FI document for payment file

    Hi
    Is there a function i could use to retrieve the long text in the invoice document for the payment reference field in the payment file?
    Would appreciate your urgetn advice.
    Thanks.

    Possiblity could be that you have passed the wrong object name id or any parameters.
    See below the similar code.
    If you want to know the correct tdobject and correct tdname combinations go to table STXH and under name give the document number ie 1900000000 ie docno then you will come to know the correct tdname and object and tdid from which you can use the read_text function module
    DATA : tdobject TYPE thead-tdobject,
               tdname   TYPE thead-tdname,
               tdid     TYPE thead-tdid,
               tdspras  TYPE thead-tdspras.
      DATA : lines    TYPE STANDARD TABLE OF tline INITIAL SIZE 0,
             wa_lines TYPE tline.
    CONCATENATE bkpf-bukrs bkpf-belnr bkpf-gjahr INTO tdname.
      tdobject = 'BELEG'.
      tdid     = '0005'.
      tdspras  = sy-langu.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
    *     CLIENT                        = SY-MANDT
          id                            = tdid
          language                      = tdspras
          name                          = tdname
          object                        = tdobject
    *     ARCHIVE_HANDLE                = 0
    *     LOCAL_CAT                     = ' '
    *   IMPORTING
    *     HEADER                        =
        TABLES
          lines                         = lines
        EXCEPTIONS
          id                            = 1
          language                      = 2
          name                          = 3
          not_found                     = 4
          object                        = 5
          reference_check               = 6
          wrong_access_to_archive       = 7
          OTHERS                        = 8.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ELSE.
         READ TABLE lines INTO wa_lines INDEX 1.
         IF sy-subrc = 0.
           write at 51(10) wa_lines-tdline.
         ENDIF.
       ENDIF.
    Regards
    Gopi

Maybe you are looking for

  • Restoring ipod mini after updating

    i downloaded the ipod updater last night and the computer did not give me the option to retore, only to update. so it went through the process, but i really want to restore it to the original settings and can't figure out how to do it after it's alre

  • Lines in photo

    Fine lines are showing up in my photos when printed from lightroom 4, but not from other programs.  Is there a reason for this? 

  • Help with making a CD

    How do I copy my photos to a CD?  I am a user of Photoshop Elements 11.

  • High CPU Usage / Dropped Packets - Switch Blade WS-CBS3120X-S

    Hi all, I have a couple of Switches Blade 3120, working as active-standby model (HSRP) on a new site deployment. There are other 20 sites more or less, working on the same model, without issues. But in this one, we are seeing a high cpu usage. The tr

  • Two selects for one table

    Greetings from a Creator newbie! I'm developing an application where I need to show a table with data from two subsequent queries - the underlying MySQL database is unable to do subselects, so I've to use a temporary table. Simply binding a rowset to