Avatar billede fredand Forsker
16. april 2010 - 16:39 Der er 3 kommentarer og
1 løsning

How to update a CLOB?

Hello!

I got a database with a clob.

The database is initated with oracale "load data" and LOBFILE('PATH_TO_A_FILE').

I now need to update a certaion row in this table with a new CLOB.

I got some foregin keys to this row so I can not delete an reinsert it.

Is this possible to update the clob in some way?

I tried like:
UPDATE the_table set clob_column LOBFILE('PATH_TO_A_FILE') where id = 1;

But it does not work.
Any ideas is most welcome.

Best regards
Fredrik
Avatar billede arne_v Ekspert
16. april 2010 - 16:47 #1
I would do it in Java instead of SQL.

:-)

Some googling points to:

UPDATE the_table SET clob_column = BFILENAME('dirnam', 'filenam') WHERE id = 1;
Avatar billede fredand Forsker
16. april 2010 - 22:12 #2
Hello Arne!

This looks very very interesting!
I just can not wait until monday so I can try it out at work!!

I will get back as soon as possible!

Bets regards
Fredrik
Avatar billede fredand Forsker
20. april 2010 - 19:47 #3
Hello Arne!

I actually did not get it to work.

I do not know if it has to do with that I use toad. I heard that it might work with dbvisualizer.

How ever I solved it in this way:

turn off constraints
truncate the table
initiate the complete table
turn on the constraints

But please give me a "svar" since your comment was most helpful!

Best regards
Fredrik
Avatar billede fredand Forsker
09. juli 2010 - 20:37 #4
Closing this one!
Hope it is ok with you Arne!
/Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester