Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Oracle problem : CLOB to LONG ???

  • 16-07-2004 5: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