procedure insertion image blob
bonjour,
J'ai une table artiste(num, nom, photo) et j'ai le code suivant dans une procédure stockée. j'essaie d'insérer la ^photo de l'artiste, sachant que le nom du fichier correspond au nom de l'artiste.jpg.
A l'exécution, j'ai le message suivant :
ORA-20009: ERREUR -22920 ORA-22920: la ligne qui contient la valeur LOB n'est pas verrouillée
Comment puis-je verrouiller la ligne ?
J'aiessayé de faire un lock table artiste in exclusive mode,
mais ça ne marche pas. Même message.
Merci pour les réponses
Code:
1 2 3 4 5 6 7 8 9
|
select nom into nomartiste from artiste where num=pnumartiste;
nomfichier := upper(nomartiste)||'.jpg';
F_photo := BFILENAME('TEMPDIR', nomfichier);
select photo into f_blobphoto from artiste where num=pnumartiste;
if (dbms_lob.fileexists(f_photo)= 1) then
dbms_lob.fileopen(F_photo);
dbms_lob.loadfromfile(f_blobphoto,F_photo,dbms_lob.getlength F_photo));
end if; |