PL/SQL (MOSC)

MOSC Banner

export blob as '.cer' files.

I have a table consists of say 2000 rows. Every row contains only 1 column which is of type blob. I would like to export every row as a '.cer' file.

I used this:

DECLARE

v_cert_data blob;

 l_file   UTL_FILE.FILE_TYPE;

 l_buffer  RAW(32767);

 l_amount  BINARY_INTEGER := 32767;

 l_pos    INTEGER := 1;

 l_blob   BLOB;

 l_blob_len INTEGER;

CURSOR c1 IS

          SELECT cert_data from ica.cert_data_per_user; 

BEGIN

Dbms_Lob.createtemporary(v_cert_data,TRUE,Dbms_Lob.Call);

    OPEN c1;

    LOOP

FETCH c1 INTO v_cert_data;

         EXIT WHEN c1%NOTFOUND;

 l_blob_len := DBMS_LOB.getlength(v_cert_data);

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