Board index » jbuilder » Re: master detail relationships helps

Re: master detail relationships helps


2005-12-06 09:02:28 AM
jbuilder5
tom wrote:
Quote
Hi,

I have a master-detail relationship between to tables.

table1 contains fileID, filename

table2 contains fileID, date_time, data1, data2 and data3

I was successfully created master-detail relationship between this two
tables.

Master:
select fileID,filename from test1;

details
select fileID,date_time, date,data1,data2,data3 from test2
where fileID =? order by fileID

****************

Now, I need to added two input fields: jdbTextfield1 and jdbTextFild2
jdbTextField1 = start_date,
jdbTextField2 = end_date,

so, the detail query would look something like this...

select fileID,date_time, date,data1,data2,data3 from test2
where fileID =? and date_time>= :start_date and date_time <= :end_date
order by fileID

How would I incorporate the changes using Mater-details relationship?
I know that the two type of parameters can NOT be used at the same time.
If it's not possible, are there any other ways around it.
What I can suggest is that you keep the master-detail relationship but
then use a filter to filter out the detail records that don't match the
criteria you're interested in. The technique works quite well when the
number of details is small (i.e. you're not filtering a thousand records
at a time).
Look at DataSet.addRowFilterListener() for details.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 
 

Re:Re: master detail relationships helps

Thanks for you suggestion.
I am just curious as to why parameterized marker and named parameters can
not be used at the same time?
Tom
"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
tom wrote:

>Hi,
>
>I have a master-detail relationship between to tables.
>
>table1 contains fileID, filename
>
>table2 contains fileID, date_time, data1, data2 and data3
>
>I was successfully created master-detail relationship between this two
>tables.
>
>Master:
>select fileID,filename from test1;
>
>details
>select fileID,date_time, date,data1,data2,data3 from test2
>where fileID =? order by fileID
>
>****************
>
>Now, I need to added two input fields: jdbTextfield1 and jdbTextFild2
>jdbTextField1 = start_date,
>jdbTextField2 = end_date,
>
>so, the detail query would look something like this...
>
>select fileID,date_time, date,data1,data2,data3 from test2
>where fileID =? and date_time>= :start_date and date_time <= :end_date
>order by fileID
>
>How would I incorporate the changes using Mater-details relationship?
>I know that the two type of parameters can NOT be used at the same time.
>If it's not possible, are there any other ways around it.

What I can suggest is that you keep the master-detail relationship but
then use a filter to filter out the detail records that don't match the
criteria you're interested in. The technique works quite well when the
number of details is small (i.e. you're not filtering a thousand records
at a time).

Look at DataSet.addRowFilterListener() for details.

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:Re: master detail relationships helps

tom wrote:
Quote
I am just curious as to why parameterized marker and named parameters can
not be used at the same time?
It appears simply to be a limitation in the design.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

{smallsort}