Subject Re: [IBO] Master detail problem when lenght of the link field is more than 25 chars
Author Hans Hoogstraat
I found no problems creating a M/D relations ship on a M/D link of varchar
(50) or longer
using TIBOQueries. Not that I would recommend using it that way :)

To show this, do you want me to Email you the source code of my test example
too?

Best regards
Hans

----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, August 04, 2004 4:06 AM
Subject: Re: [IBO] Master detail problem when lenght of the link field is
more than 25 chars


| At 06:49 PM 3/08/2004 +0000, you wrote:
| >CREATE TABLE dep (
| > id_dep INTEGER NOT NULL,
| > name VARCHAR(50) NOT NULL,
| > CONSTRAINT dep_pk PRIMARY KEY (id_dep)
| >);
| >
| >COMMIT;
| >
| >CREATE TABLE person (
| > id_person INTEGER NOT NULL,
| > name VARCHAR(50) NOT NULL,
| > id_dep_123456789_123456789 INTEGER NOT NULL,
| > CONSTRAINT person_pk PRIMARY KEY (id_person)
| >);
| >
| >qryDep - master
| >qryPerson - detail
| >Master Links:
| >person.id_dep_123456789_123456789=dep.id_dep
| >
| >When I open qryPerson I get this error:
| >FieldName: MLNK_ID_DEP_123456789_123456789_0 not found
| >
| >I think the problem lies in the way IBO names the parameter for the
| >detail:
| >MLNK_ID_DEP_123456789_123456789_0 = 33 chars
| >If the detail has the link field named:
| >id_dep_123456789_12345678 then it works.
| >So if the link field from detail has the length <= 25 it's ok.
|
| Yes, with IBO you need to regard it as a problem if you have column
| identifiers longer than 24 characters. Firebird identifiers simply can
not
| exceed 31 characters in length. IBO needs to "borrow" between 5 and 7
| characters for handling master-detail.
|
|
| >Question: Can I tell IBO how to name the master detail parameter from
| >the Master Links?
|
| That's exactly what MasterLinks does but it needs the prefix and, in some
| conditions, the suffix, to determine the origin of results returned in the
| XSQLDA.
|
| But with native IBO you are not restricted to using the same name as
column
| name for parameters. It's only a limitation with the TDataset
| master-detail linking. If you prefer the benefits of MasterLinks, use
| shorter names for your parameters and write a bit of extra assignment code
| in your BeforePost handlers.
|
| If you want to force IBO to use your long identifiers as parameter names,
| you should use the MasterParamLinks technique instead of MasterLinks.
|
|
| >Test case uploaded: Problem-MasterDetail.zip
|
| I do understand why you consider it's a problem for you.
|
| >ps: I really have fields that are more than 25 in length.
|
| That statement seems to have confused some people. I think you mean to say
| that you have identifiers that are more than 25 in length.
|
| Helen
|
|
|
|
|
___________________________________________________________________________
| IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
| without the need for BDE, ODBC or any other layer.
|
___________________________________________________________________________
| http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
| keyword-searchable FAQ, community code contributions and more !
| Yahoo! Groups Links
|
|
|
|
|