[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How i can store blob field in oracle10g

Posted on 2009-02-10
3
Medium Priority
?
646 Views
Last Modified: 2012-06-21
frist of all i ma not well speakinging english.
my problem is :
how i can store file with size for example 10mb or more in blob field or clob field
i am useing oracle10g ang delphi7
my table name is ingshow
fields are :
imgname varchar2(30)
sora blob
i want to store file with size 10 mb in field sora and how i can displyon delphi form
and when i run the program i recieve this error:0x77492b2f write of address0x00030ffc

acess violation at
plz help me
thxxxxxxxxxx alot

procedure TForm1.BitBtn1Click(Sender: TObject);
Var
FileStream : TFileStream ;
buffer : String;
FileSize : integer;
begin
FileStream := TFileStream.Create('d:\set.txt',fmOpenReadwrite) ;
FileSize := (FileStream.size );
Setlength(Buffer,FileSize);
FileStream.read(pointer(Buffer)^,FileSize);
memo1.text := Buffer;
 with query1 do
  begin
  close;
  sql.Clear;
  sql.Add('insert into imgshow values('+quotedstr(edit1.Text)+',');
  sql.Add(''+quotedstr(memo1.Lines.Text)+')');
  execsql;
 end;
FileStream.Free ;
end;

Open in new window

blobproblem.jpg
0
Comment
Question by:elmmahdi
1 Comment
 
LVL 7

Accepted Solution

by:
tankergoblin earned 500 total points
ID: 23619825
try
say in your oracle database you have IMAGE coloum with BLOB data type and MEMO varchar(50)
then do this
 sql.add(insert into imgshow (IMAGE,MEMO) values(EMPTY_BLOB()),:Memo);
 sql.add(returning IMAGE into :image);
 sql.ParamByName('image').AsParamType := ptInput;
 sql.ParamByName('image').AsBlobLocator.Asstring := quotedstr(edit1.Text);
 sql.ParamByName('Memo').AsString := quotedstr(memo1.Lines.Text);
 execsql;
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Simple Linear Regression
Introduction to Processes

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question