Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Oracle problem : CLOB to LONG ???

  • 16-07-2004 05:28PM
    #1
    Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭


    Can anyone tell me how to convert a CLOB to a LONG in Oracle?

    I have data which needs to be read from a LONG field. I can't convert this to a CLOB because the client app uses C# with the OleDb data provider, which doesn't support CLOBs.

    However, I have data which I want to put into this table which *is* stored in CLOBs.

    Although Oracle claims that it implicitly converts from CLOB to LONG, it apparently does so via VARCHAR2, because everything is getting truncated at 4,000 characters.

    So....anyone any ideas? How do I do what effectively should just be a INSERT INTO SELECT FROM, where I'm reading CLOB and writing LONG?

    Any help appreciated. Cheers.

    jc


Comments

  • Registered Users, Registered Users 2 Posts: 640 ✭✭✭Kernel32


    The DBMS_LOB package can be used to read clob's and move to a long field. You would have to do it in a PL/SQL package or procedure though, shouldn't be too difficult. If your using C# then why not use the Oracle native data providers supplied free by Microsoft and Oracle? Data Direct also has one that costs some money but is supposed to be better, they talk natively to Oracle I believe, even bypassing the OCI layer, they will be more functionaly and faster than using oledb.


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Originally posted by Kernel32
    The DBMS_LOB package can be used to read clob's and move to a long field. You would have to do it in a PL/SQL package or procedure though, shouldn't be too difficult.

    Cool. I'll have a look at that. Thanks.
    If your using C# then why not use the Oracle native data providers supplied free by Microsoft and Oracle?

    If I was starting the program from scratch...I'd do exactly that. But I'm not, and I can't really justify the time it would take.

    Ta for the help tho.

    jc


Advertisement