i want to upload a file in database using plsql [message #644267] |
Mon, 02 November 2015 05:24 |
|
sudheerips
Messages: 7 Registered: September 2015 Location: visakhapatnam
|
Junior Member |
|
|
i created a directory
create or replace procedure insert_img as
f_lob bfile;
b_lob blob;
begin
insert into image_t values ( 'MyGif1', empty_blob());
return b_lob;
f_lob := bfilename( 'MY_FILES', 'Picture 016.jpg' );
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
/
ing: Procedure created with compilation errors.
show err
rs for PROCEDURE INSERT_IMG:
/COL ERROR
---- -----------------------------------------------------------------
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00947: not enough values
PL/SQL: Statement ignored
PLS-00372: In a procedure, RETURN statement cannot contain an
expression
|
|
|
|
|
|
|
|
Re: i want to upload a file in database using plsql [message #644282 is a reply to message #644267] |
Mon, 02 November 2015 09:17 |
John Watson
Messages: 8919 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
First, if an INSERT statement does not include a list of columns to populate, the VALUES clause must must supply a value for every column. Programmers who do not use a column list in their insert statements, should be shot.
Second, what is the RETURN supposed to be doing?
|
|
|