Converting BFILE to BLOB [message #44646] |
Sun, 28 December 2003 01:24  |
Sreenivas
Messages: 15 Registered: January 2000
|
Junior Member |
|
|
Dear All,
I need to print the logo ( image) in my crystal report.
This should be parameterized.
For that I think I need to store it in database as BLOB.
I wrote the following code to convert the BFILE to BLOB and updated in the BLOB field of the table.
( of course I have hard coded some of the things. )
create directory fly_away as 'C:GEBEXE' ;
insert into image1 values( 2, EMPTY_CLOB(),EMPTY_BLOB(),BFILENAME('FLY_AWAY','fly_away.jpg')) ;
CREATE OR REPLACE PROCEDURE CONVERT_TO_BLOB IS
l_lobd BLOB;
l_fl_bfile BFILE := BFILENAME('FLY_AWAY','fly_away.jpg');
-- l_nm_amt INTEGER := 4000;
BEGIN
SELECT blob_col INTO l_lobd FROM image1 WHERE key = 2 FOR UPDATE;
dbms_lob.fileopen(l_fl_bfile, dbms_lob.file_readonly);
DBMS_OUTPUT.PUT_LINE('First ') ;
dbms_lob.loadfromfile(l_lobd, l_fl_bfile,DBMS_LOB.GETLENGTH(l_fl_bfile));
DBMS_OUTPUT.PUT_LINE(' Second') ;
UPDATE image1
SET blob_col = l_lobd
WHERE key = 2 ;
DBMS_OUTPUT.PUT_LINE(' Status:'||sqlcode) ;
COMMIT;
dbms_lob.fileclose(l_fl_bfile);
DBMS_OUTPUT.PUT_LINE(' Third') ;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error is :'|| sqlerrm) ;
dbms_lob.fileclose(l_fl_bfile);
END;
/
The procedure executes without any error and comes out with success status.
But when I access the BLOB field from the crystal report.
it gives the following error message
"Failed to open a row set"
" Source: Provider "
" Description : Unspecified error "
" Native error "
I couldn't get whether the conversion is incorrect or the fetching in crystal report is incorrect
Please help me reg the above problem.
Yours anticipatedly,
Sreenivas
|
|
|
|
Re: Converting BFILE to BLOB [message #45529 is a reply to message #44646] |
Mon, 22 March 2004 02:42   |
Manas
Messages: 5 Registered: March 2002
|
Junior Member |
|
|
Dear Sreenivas,
I am getting similar type of error.....
"Failed to open a row set"
" Source: ADODB.Properties "
" Description : item cannot be found in the collection corresponding to the requested name or ordinal "
" Native error: -2146825023 "
Can you help me in this regard
Manas
|
|
|
|