#1 2012-06-22 14:00:18

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

Wrong datatype CBLOB

When creating a table with Oracle, it tries to create fields with datatype  CBLOB .. this should be CLOB

Offline

#2 2012-06-22 17:22:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Wrong datatype CBLOB

I've fixed issue about creating unexisting NCLOB instead of CLOB/NCLOB.
See http://synopse.info/fossil/info/bc38c995e8

Do not forget that if you want to create NVARCHAR2 fields, you shall specify the column width using "index ..." in the record declaration, as such:


type
  TSQLRecordPeopleExt = class(TSQLRecordExternal)
  private
    fData: TSQLRawBlob;
    fFirstName: RawUTF8;
    fLastName: RawUTF8;
    fYearOfBirth: integer;
    fYearOfDeath: word;
    fLastChange: TModTime;
    fCreatedAt: TCreateTime;
  published
    property FirstName: RawUTF8 index 40 read fFirstName write fFirstName;
    property LastName: RawUTF8 index 40 read fLastName write fLastName;
    property Data: TSQLRawBlob read fData write fData;
    property YearOfBirth: integer read fYearOfBirth write fYearOfBirth;
    property YearOfDeath: word read fYearOfDeath write fYearOfDeath;
    property LastChange: TModTime read fLastChange write fLastChange;
    property CreatedAt: TCreateTime read fCreatedAt write fCreatedAt;
  end;

A plain RawUTF8 will define a NCLOB, able to handle any size of text, but is probably oversized, and you will loose performance.
See the documentation about external tables - search for TSQLRecordExternal in the SAD document.

Still need testing about external database ORM.
A service or a virtual table calling tuned SQL does make sense to me in such cases, even more with existing applications.
But this "external ORM" feature shall be enhanced.

Feel free to report any problem or code fixes needed!

Thanks for the feedback.

Offline

Board footer

Powered by FluxBB