MySQL Forums
Forum List  »  Oracle

Procedure for insert images into a table
Posted by: John Giotas
Date: July 18, 2008 11:18AM

Hello,

I have that procedure from oracle and i want transformate it for mysql


/*
CREATE OR REPLACE PROCEDURE "INS_IMAGE" (IMAGEID2 int,DOC_ID2 INT,TYPEBLOB2 VARCHAR2,DESCR2 VARCHAR2,FILENAME2 varchar2)
AS

v_bfile BFILE;
v_blob BLOB;
BEGIN

insert into IMAGE1(IMAGEID, DOC_ID , TYPEBLOB , DESCR , FILENAME) values (IMAGEID2, DOC_ID2 , TYPEBLOB2 , DESCR2 , Empty_blob() )

RETURN FILENAME INTO v_blob;

v_bfile := BFILENAME('IMAGES', FILENAME2);
Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
Dbms_Lob.Loadfromfile(v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
Dbms_Lob.Fileclose(v_bfile);

COMMIT;
END INS_IMAGE;

*/

I need help, please.



Edited 1 time(s). Last edit at 07/18/2008 11:42AM by John Giotas.

Options: ReplyQuote


Subject
Views
Written By
Posted
Procedure for insert images into a table
6988
July 18, 2008 11:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.