Data Type is not supported

Hi Experts,

I'm using Delphi 6. I'm trying to insert BLOB field into table DOCUMENTS in oracle database. But I have problem with message " Data Type is not support "

And how to insert a Long Raw Field into table?

Please help me on this.

Thanks so much.
MyADoTable.Open;
   MyADoTable.Insert;
   MyADoTable.FieldByName('MIME_TYPE').AsString := 'text/plain';
   MyADoTable.FieldByName('NAME').AsString := 'C:\data.txt';
   MyADoTable.FieldByName('DAD_CHARSET').AsString := 'ascii';
   MyADoTable.FieldByName('LAST_UPDATED').AsDateTime := NOW();
   MyADoTable.FieldByName('CONTENT_TYPE').AsString  := 'BLOB' ;
   MyADoTable.FieldByName('BLOB_CONTENT').SetFieldType(ftBlob);
TBlobField(MyADoTable.FieldByName('BLOB_CONTENT')).SaveToFile('C:\data.txt');
    MyADoTable.Post;
    MyADoTable.Free;

Open in new window

SVPITAsked:
Who is Participating?
 
tankergoblinCommented:
sorry if insert u should use
parambyname
also u should return to content_type as below

insert into yourtablename (CONTENT_TYPE) value(EMPTY_BLOB);
returning CONTENT_TYPE into :CONTENT_TYPE


MyADoTable.ParamByName('CONTENT_TYPE').AsParamType  := ptInput;
MyADoTable.ParamByName('CONTENT_TYPE').AsBlobLocator.AsString  := 'BLOB';

0
 
Geert GOracle dbaCommented:
i would recommend get some better components ... www.devart.com -> Odac

and now for your problem:
you are using savetofile instead of loadfromfile ...
0
 
tankergoblinCommented:
in insert use

insert into yourtablename value(EMPTY_BLOB);
returning blob into :blob


MyADoTable.FieldByName('CONTENT_TYPE').AsParamType  := ptInput;
MyADoTable.FieldByName('CONTENT_TYPE').AsBlobLocator.AsString  := 'BLOB';
0
 
SVPITAuthor Commented:
Thanks for your help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.