Home » Developer & Programmer » Forms » Storing images into database using Oracle Forms (Oracle Forms6i)
Storing images into database using Oracle Forms [message #395258] Tue, 31 March 2009 23:18 Go to next message
pradauman
Messages: 13
Registered: March 2009
Location: kolkata
Junior Member
Dear All,
i have a problem during storing images into the database using Oracle Forms6i giving error ora-6502.
My Table Structure is
Studentid varchar2(12),
StudentPhoto Blob

i want to save photo of student in any format of Image. but that is not possible through forms; only .jpg format support.
i m able to show the image on forms but not able to save image..
I use the following code if any ractifiaction please update me.

"Declare
mFileName Varchar2(2000);
mPos Integer;
Begin

If :picture.SL_NO is not null Then
mFileName := GET_FILE_NAME(File_Filter=>:picture.IMAGE_TYPE||' Files (*.'||:picture.IMAGE_TYPE||')|*.'||:picture.IMAGE_TYPE||'|');
if mFileName is Null then
Msgbox1('Please select an Image File','NOTE');
Message('Please select an Image File',no_acknowledge);
else
mFileName :=ltrim(rtrim(mFileName));
mPos:=Length(MFileName);
For I in 1..Length(MFileName)
Loop
if substr(mFIleName,i,1)='\' then
mPos :=i;
End If;
End Loop;

READ_IMAGE_FILE(mFileName,:picture.IMAGE_TYPE,'picture.PICS');
End If;
Else
Msgbox1('Please select Student from the list','Note');
Message('Please select Student from the list',no_acknowledge);
End If;
commit_form;
end;

"
Re: Storing images into database using Oracle Forms [message #395577 is a reply to message #395258] Wed, 01 April 2009 22:48 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please use 'code' tags around your code in future.

Your question is a common one. Please search this forum for your keywords 'GET_FILE_NAME', 'READ_IMAGE_FILE', and 'blob image'.

David
Previous Topic: Multi Record block with some single record item
Next Topic: Merge Cell in excel is not working
Goto Forum:
  


Current Time: Sun Feb 09 11:22:46 CST 2025