Home » SQL & PL/SQL » SQL & PL/SQL » i want to upload a file in database using plsql (10g)
i want to upload a file in database using plsql [message #644267] Mon, 02 November 2015 05:24 Go to next message
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 #644268 is a reply to message #644267] Mon, 02 November 2015 05:33 Go to previous messageGo to next message
John Watson
Messages: 8919
Registered: January 2010
Location: Global Village
Senior Member
In your previous 4 questions, you have not said "thank you" to the people who tried to assist you. This does suggest that you do not appreciate assistance. Any comment?

Furthermore, before you post any code please read How to use [code] tags and make your code easier to read
Re: i want to upload a file in database using plsql [message #644270 is a reply to message #644267] Mon, 02 November 2015 06:49 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
sudheerips wrote on Mon, 02 November 2015 05:24
i created a directory


PLS-00372: In a procedure, RETURN statement cannot contain an
expression


Error message looks pretty self-explanatory. Did you even bother to read it and try to solve it yourself?

And I agree with John. Your posting history on this forum is not helping your reputation. You have abandoned every thread you started. That is very unprofessional.
Re: i want to upload a file in database using plsql [message #644275 is a reply to message #644270] Mon, 02 November 2015 08:34 Go to previous messageGo to next message
sudheerips
Messages: 7
Registered: September 2015
Location: visakhapatnam
Junior Member
thank u very much
Re: i want to upload a file in database using plsql [message #644276 is a reply to message #644268] Mon, 02 November 2015 08:35 Go to previous messageGo to next message
sudheerips
Messages: 7
Registered: September 2015
Location: visakhapatnam
Junior Member
i am sorry thank you john
Re: i want to upload a file in database using plsql [message #644280 is a reply to message #644276] Mon, 02 November 2015 08:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68617
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It'd be better if you review your previous topic and post the relevant feedback: how it helps, how you resolved the issue, what was the solution and so on. Your late thanks here is useless and irrelevant.

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 Go to previous message
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?

Previous Topic: a column may not be outer-joined to a subquery
Next Topic: Test query for SORT (merged)
Goto Forum:
  


Current Time: Tue Mar 19 01:08:46 CDT 2024