Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Fieldtype "text" in DataModeler - TBlob

 Post Reply Post Reply
Author
Odermatt Thomas View Drop Down
New Member
New Member
Avatar

Joined: 18 Jul 2012
Posts: 6
Post Options Post Options   Quote Odermatt Thomas Quote  Post ReplyReply Direct Link To This Post Topic: Fieldtype "text" in DataModeler - TBlob
    Posted: 08 Mar 2013 at 4:46am
Hello

We're using the Data Modeler to export the Aurelius-files. We're running on SQL Server 2008 (as well as on 2005).
If the "datatype" in the Data Modeler is set to "Text", the data modeler export it as a TBlob:

property BearbeitungText: TBlob read FBearbeitungText write FBearbeitungText;


I think, the MSSQL fieldtype "text" isn't a blob.

Therefore code like...
MyDataset.FieldByName( 'BearbeitungText' ).AsString:= 'Hello world' //MyDataset is an aurelius-dataset

... isn't working (anymore).

An typecast-exception ("image isn't compatible with text") occures.
Am I missing the point?

Thanks
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2367
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2013 at 6:47am
This is by design, TEXT is a memo field, which is a type of BLOB field (sub type text). The TBlob type can handle both binary and text blobs, actually there is even an AsString property which you can use this way:

BearbeitungText.AsString := 'Hello world';

Also, TAureliusDataset handles TBlob properties smoothly, I have re-run the tests here, and FieldByName('').AsString just works with properties of type TBlob. So my guess is that the problem must be somewhere else - I'm not saying the problem can't be in Aurelius, but it's not in the code you mention. Can you provide more info, the line where the error occurs, etc.? I'm not sure this error is happening in Aurelius, I think it's happening at server level, or database-access component level.

Back to Top
Odermatt Thomas View Drop Down
New Member
New Member
Avatar

Joined: 18 Jul 2012
Posts: 6
Post Options Post Options   Quote Odermatt Thomas Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2013 at 11:01am
I've created a test project. You can download here:
https://www.aduna.ch/test06.zip

I'm still getting following error message when i connect to a mssql database (2008 r2) over sqlncli11:
image isn't compatible with text
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2367
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2013 at 2:56pm
Hi Thomas, actually you are right, I apologize. Data Modeler should generate the property as string so Aurelius can tell it's a Text/CBLOB field, not a binary blob. We will fix this in Data Modeler export. In the meanwhile, the only workaround you have is replace the TBLOB by string and set the size in Column attribute as greater than 65535.
Back to Top
Odermatt Thomas View Drop Down
New Member
New Member
Avatar

Joined: 18 Jul 2012
Posts: 6
Post Options Post Options   Quote Odermatt Thomas Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2013 at 4:26pm
Hi Wagner. When will you release a new version of the data modeler? Could we get a pre-release? Our data model contains many blob fields.
Back to Top
Odermatt Thomas View Drop Down
New Member
New Member
Avatar

Joined: 18 Jul 2012
Posts: 6
Post Options Post Options   Quote Odermatt Thomas Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mar 2013 at 5:07pm
I tested your workaround. How can we load these strings lazy/on demand?
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2367
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 2013 at 7:10am
In this case, you can't.
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2367
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 28 Sep 2015 at 10:42pm
Just a note, for the record, that this has been fixed and improved in both Aurelius and Data Modeler. Aurelius now supports a [DBTypeMemo] attribute to indicate a TBLob property is text, not binary.  And Data Modeler exports that attribute accordingly when the database type is text blob (CLOB, TEXT, MEMO, etc.)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down