Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: MongoDB & DBMemo


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Apr 21, 2016 5:52 AM Last Post By: SQL Daddy
Bob Johnson

Posts: 28
Registered: 9/11/15
MongoDB & DBMemo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2016 8:44 AM
Anyone ever experienced data getting truncated in DBMemo when clicking on another data aware control? So I enter maybe 50 characters into DBMemo then click on a DBGrid or DBComboBox and the data entered in DBMemo gets truncated to 28-30 or so characters. Max Length is set to zero and I don't see any settings in the datasource or MongoDB that would cause this. Obviously I am missing something.
Bob Johnson

Posts: 28
Registered: 9/11/15
Re: MongoDB & DBMemo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2016 8:47 PM   in response to: Bob Johnson in response to: Bob Johnson
Ok, a follow-up to this...

In my TFDMongoQuery under Fields. If I click on the field related to the dbMemo (Notes) this field shows size of the Notes field in the first record in the Collection. If I change this size parameter to say 300, it deactivates the TFDMongoQuery. Then when I click Active = true for the Query the Size value reverts to the previous value. Is there a setting somewhere that controls this? I want the size I enter to remain in effect for this field in my TFDMongoQuery. Any ideas?

Bob Johnson wrote:
Anyone ever experienced data getting truncated in DBMemo when clicking on another data aware control? So I enter maybe 50 characters into DBMemo then click on a DBGrid or DBComboBox and the data entered in DBMemo gets truncated to 28-30 or so characters. Max Length is set to zero and I don't see any settings in the datasource or MongoDB that would cause this. Obviously I am missing something.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: MongoDB & DBMemo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 29, 2016 9:15 PM   in response to: Bob Johnson in response to: Bob Johnson
Check the field data type / size, to which DBMemo is connected.
Probably it is defined as DataType= ftString / ftWideString, Size=30.

By default FireDAC analyzes first FetchOptions.RowsetSize * 2
documents and builds the common data schema for them. When
* collection is empty;
* or first analyzed documents are not representative;
then you should manually setup FieldDefs collection. For example,
I need to set size for second field (atttribute) to a greater value:
  FDMongoQuery1.FieldDefs.Update;
  FDMongoQuery1.FieldDefs[1].Size := 100;
  FDMongoQuery1.FieldDefs.Updated := True;
  FDMongoQuery1.Active := True;


--
With best regards,
Dmitry
Bob Johnson

Posts: 28
Registered: 9/11/15
Re: MongoDB & DBMemo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 1, 2016 10:13 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
This hasn'tt worked out for me so far. Most likely I'm not placing this code in the right place as it has no effect. Where should this manual FieldDef code go in a typical application?

The only way I got the field size increased was by loading dummy data in the first 2 documents and loading this field Notes with 200 characters. Then activated the Query and it evidently created new defaults from that. I would rather do it in code, but for now it is working. Thanks!

Dmitry Arefiev wrote:
Check the field data type / size, to which DBMemo is connected.
Probably it is defined as DataType= ftString / ftWideString, Size=30.

By default FireDAC analyzes first FetchOptions.RowsetSize * 2
documents and builds the common data schema for them. When
* collection is empty;
* or first analyzed documents are not representative;
then you should manually setup FieldDefs collection. For example,
I need to set size for second field (atttribute) to a greater value:
  FDMongoQuery1.FieldDefs.Update;
  FDMongoQuery1.FieldDefs[1].Size := 100;
  FDMongoQuery1.FieldDefs.Updated := True;
  FDMongoQuery1.Active := True;


--
With best regards,
Dmitry
SQL Daddy

Posts: 6
Registered: 4/8/16
Re: MongoDB & DBMemo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2016 5:52 AM   in response to: Bob Johnson in response to: Bob Johnson
Hello

I am not familiar mongo db but this problem is also accur when i am doing this, this example helpd me so i hope it will be helpful https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/.

Feel happy to discuss.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02