Additional
AnyDAC
SimpleIAX
Forums
Welcome, Guest
Please Login or Register to post messages. Lost Password?
Firebird field mapping
(1 viewing) 1 Guest
Go to bottom
TOPIC: Firebird field mapping
#20954
TiberiuMugurStoicescu
Fresh Boarder
Posts: 2
graphgraph
Karma: 0
User Offline Click here to see the profile of this user
Firebird field mapping 2012/05/02 05:50 (1 Year ago)
Hello,

I am using AnyDac 5.0.7, Firebird 2.5.1, Delphi XE, DataAbstract
Connexion strign is
Code:

AnyDAC?AuxDriver=IB;Server=192.168.1.10;Database=/programare.gdb/CRM.FDB;
  UserID=sysdba;Password=masterkey;CharSet=utf8;@Protocol=TCPIP;
  @Pooled=True;@ExtendedMetadata=True;



Field defined as:
* IS_SPECIAL DMED_BOOLEAN /* DMED_BOOLEAN = SMALLINT DEFAULT 0 CHECK ((VALUE = 0) OR (VALUE = 1) OR (VALUE IS NULL)) */,
is mapped as SMALLINT (datSmallInt) and not as BOOLEAN (datBoolean) as I expected.

* PACHET_PRET DMED_PRET /* DMED_PRET = NUMERIC(18,4) NOT NULL */,
is mapped as datCurrency and not as datDecimal as I expected.

Is there a possibility that such fields to be mapped?

Thanks,
Tiberiu Stoicescu
Logged Logged
Last Edit: 2012/05/02 06:03 By Support.
The administrator has disabled public write access.
#20959
TSupport
Moderator
Posts: 348
graphgraph
Karma: 10
User Offline Click here to see the profile of this user
Re:Firebird field mapping 2012/05/02 11:14 (1 Year ago)
Hello Tiberiu,

Thank you for the inquiry.

Yes, that's possible.

Please set up your connection string as:
Code:

AnyDAC?AuxDriver=IB;Server=192.168.1.10;Database=/programare.gdb/ CRM.FDB;UserID=sysdba;Password=masterkey;CharSet=utf8;@Protocol=TCPIP;@Pooled=True;@ExtendedMetadata=True;@FormatOptions.AssignedValues=[fvMapRules,fvMaxBcdPrecision];@FormatOptions.OwnMapRules=True;@FormatOptions.MapRules=< item NameMask = 'IS_SPECIAL' SourceDataType = dtInt16 TargetDataType = dtBoolean end>;@FormatOptions.MaxBcdPrecision=17;


This will map both columns to the required data types.

How you can extend that yourself:
1) Start ADExplorer
2) Setup a connection definition
3) At the Advanced options page set up the required options: see (more) about map rules and MaxBcdPrecision option
4) Save the connection definition
5) In ADConnectionDefs.ini locate that and copy the parameters you would like to customize and append to the connection string preceding them with "@" symbol

Please let us know if we can be of more help.
With best regards,
DA-SOFT Technologies Support Team
Logged Logged
Last Edit: 2012/05/02 11:16 By TSupport.
The administrator has disabled public write access.
#20999
TiberiuMugurStoicescu
Fresh Boarder
Posts: 2
graphgraph
Karma: 0
User Offline Click here to see the profile of this user
Re:Firebird field mapping 2012/05/09 05:50 (1 Year ago)
Thanks,

This works.

Is there a possibility that all fields that is defined with specific domain eg DBOOLEAN to be mapped as boolean?
Logged Logged
The administrator has disabled public write access.
#21005
TSupport
Moderator
Posts: 348
graphgraph
Karma: 10
User Offline Click here to see the profile of this user
Re:Firebird field mapping 2012/05/09 22:27 (1 Year ago)
Hello,

That's possible but is disabled by default.
You can manually enable this feature in the add-on source, but that will slowdown a bit opening of your datasets.
To enable this feature please:
1) open uDAAnyDACDriver
2) locate this function:
Code:

function TDAEAnyDACQuery.CreateDataset(aConnection: TDAEConnection): TDataset;
begin
  Result := TADQuery.Create(nil);
  TDAEAnyDACConnection(aConnection).SetupDataset(TADQuery(Result), False);
end;


3) replace False with True

This will enable fetching metadata prior to retrieving the data from your table. You can read more about this here (see fiMeta item description): www.da-soft.com/anydac/docu/uADStanOptio...chOptions_Items.html
With best regards,
DA-SOFT Technologies Support Team
Logged Logged
The administrator has disabled public write access.
Go to top