We help IT Professionals succeed at work.

Data Type is not supported

SVPIT
SVPIT asked
on
Medium Priority
852 Views
Last Modified: 2013-11-10
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

Comment
Watch Question

Geert GOracle dba
CERTIFIED EXPERT
Top Expert 2009

Commented:
i would recommend get some better components ... www.devart.com -> Odac

and now for your problem:
you are using savetofile instead of loadfromfile ...
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';
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';

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks for your help
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.