MySQL Forums
Forum List  »  Oracle

How to convert this oracle function ?
Posted by: Gaetan Moria
Date: October 07, 2008 12:25AM

My problem i how to convert the oracle utl_file package ?

My procedure take 3 parameters : destination, filename and content.

Then the procedure create the file on the server with its content.

Is there a way too do that in mysql ?

This procedure is call by a client with odbc. Then client can create file on the server without any share folder ...


CREATE OR REPLACE PROCEDURE P_PUT_FILE (
P_DESTINATION IN VARCHAR2,
P_NOMFIC IN VARCHAR2,
P_CONTENT IN LONG)
IS
G_FPLOG UTL_FILE.file_type;
V_CONTENT VARCHAR2 (3000);
AMT INTEGER := 3000;
POS INTEGER;
BEGIN
G_FPLOG := UTL_FILE.fopen (VAL_PAR_LABAUTO ('CHEMIN_CLIENT'), P_NOMFIC, 'W', 32767);
POS := 1;

LOOP
IF POS > LENGTH (P_CONTENT) THEN
EXIT;
END IF;

V_CONTENT := SUBSTR (P_CONTENT, POS, AMT);
UTL_FILE.put (G_FPLOG, V_CONTENT);
POS := POS + AMT;
END LOOP;

UTL_FILE.fclose (G_FPLOG);
END;
/

Thanks for advance

Gaƫtan

Options: ReplyQuote


Subject
Views
Written By
Posted
How to convert this oracle function ?
4518
October 07, 2008 12:25AM


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.