PL/SQL (MOSC)

MOSC Banner

Insert a jpg file in long raw field

edited Nov 13, 2009 7:46PM in PL/SQL (MOSC) 2 commentsAnswered
 I wrote the next procedure:

create or replace
PROCEDURE INCLUI_foto IS
V_IMAGE LONG RAW;
V_ARQUIVO UTL_FILE.FILE_TYPE;
BEGIN
-- adiciona o imagen ao v_arquivo
V_ARQUIVO := UTL_FILE.FOPEN('dir1', 'FOTO1.JPG','r',32767);

-- adiciona do v_arquivo para o v_image
UTL_FILE.GET_RAW(V_ARQUIVO,V_IMAGE);

-- inserindo na tabela
INSERT INTO TESTE VALUES(1,V_IMAGE);
COMMIT;
DBMS_OUTPUT.PUT_LINE('Imagem inserida !') ;
END;

But, shows error messages ORA-29280 ou ORA-29283, when I run the procedure.

I created 2 directories: one, in my computer, and the other, in a server. The comands were:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center