horst borscht
Member²
Hi Marco,
I had a problem with a DBlookupcombobox and QBE...
Here's a short description of the underlying tables and my application,
so hopefully you can reproduce the scenario:
tables:
create table supplier(supno number,supname varchar2(20));
insert into supplier(supno ,supname)values(1,'Company1');
insert into supplier(supno ,supname)values(2,'Company2');
create table discountgroup(discountgroupno number, supno number, discountgroupname varchar2(20));
insert into discountgroup(discountgroupno,supno,discountgroupname)values(1,1,'discountgroup1');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(2,1,'discountgroup2');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(3,2,'discountgroup3');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(4,2,'discountgroup4');
create table product(prodno number, supno number, prodname varchar2(20), discountgroupno number);
insert into product(prodno, supno, prodname, discountgroupno)values(1,1,'product1',1);
insert into product(prodno, supno, prodname, discountgroupno)values(2,1,'product2',2);
insert into product(prodno, supno, prodname, discountgroupno)values(3,2,'product3',3);
insert into product(prodno, supno, prodname, discountgroupno)values(4,2,'product4',4);
application:
4 Datasources connected to ToracleDatasets and their Queries:
DS_SUP / ODS_Sup select SUPNO,SUPNAME from supplier
DS_Prod / ODS_Prod select rowid,PRODNO,SUPNO,PRODNAME,DISCOUNTGROUPNO from PRODUCT
where supno = :supno (Master: ODS_Sup, Master/Detail Fields: SUPNO)
DS_Disc1 / ODS_Disc1 select DISCOUNTGROUPNO,SUPNO,DISCOUNTGROUPNAME from DISCOUNTGROUP
where supno = :supno (Master: ODS_Sup, Master/Detail Fields: SUPNO)
DS_Disc2 / ODS_Disc2 select DISCOUNTGROUPNO,SUPNO,DISCOUNTGROUPNAME from DISCOUNTGROUP
where supno = :supno (Master: ODS_Prod, Master/Detail Fields: SUPNO)
QBEDefinition.AllowOperators is set to FALSE for all 4 Datasets.
2 ToracleNavigators:
oraNavSup Datasource: DS_SUP,
oraNavProd Datasource: DS_Prod,
2 TDBedits:
dbedSupname Datasource: DS_SUP, Datafield: supname
dbedProdname Datasource: DS_Prod, Datafield: prodname
2 DBlookupComboboxes:
dbLookupDisc1 Datasource: DS_Prod, Listsource: DS_Disc1, Datafield: discountgroupno, Keyfield: discountgroupno, Listfield: discountgroupname,
dbLookupDisc2 Datasource: DS_Prod, Listsource: DS_Disc2, Datafield: discountgroupno, Keyfield: discountgroupno, Listfield: discountgroupname,
problem:
If i enter QBE mode for the supplier dataset and type 'Company1' into dbedSupname and then execute QBE,
dbedProdname displays the name of the first product ('product1') belonging to Company1 as expected.
But dbLookupDisc1 is empty. dbLookupDisc2 shows the correct value ('discountgroup1').
When i then navigate to the next record with oraNavProd, both dbLookups show the correct value ('discountgroup2').
When i navigate back to the first record with oraNavProd, both dbLookups also show the correct value ('discountgroup1').
So the problem occurs just once for the first record that is displayed after QBE is executed for the supplier dataset
and only with dbLookupDisc1, whose dataset(ODS_Disc1) uses ODS_Sup as the Master dataset.
In most cases i might go with the settings of dbLookupDisc2, but when i want to search for products of a certain supplier
associated to a certain discountgroup and therefore first execute QBE for the supplier dataset to pick a supplier
and subsequently enter QBE mode for the product dataset to pick a discountgroup and then execute QBE for the product dataset,
now dbLookupDisc2 is empty and dbLookupDisc1 is the one that suits my needs. Damn...
I now switch the Master property of ODS_Disc2 (which is initially ODS_Prod) in the onClick event
of oraNavProd(when button nbEnterQBE was clicked) to ODS_Sup and right back to ODS_Prod in the AfterQBE event of ODS_Prod.
Seems to work so far...but i somehow got the feeling that this is not really the elegant way to do it...
My question is: Is there is a better way to handle this? what am i missing?
Thanks in advance
Horst Borscht
I had a problem with a DBlookupcombobox and QBE...
Here's a short description of the underlying tables and my application,
so hopefully you can reproduce the scenario:
tables:
create table supplier(supno number,supname varchar2(20));
insert into supplier(supno ,supname)values(1,'Company1');
insert into supplier(supno ,supname)values(2,'Company2');
create table discountgroup(discountgroupno number, supno number, discountgroupname varchar2(20));
insert into discountgroup(discountgroupno,supno,discountgroupname)values(1,1,'discountgroup1');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(2,1,'discountgroup2');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(3,2,'discountgroup3');
insert into discountgroup(discountgroupno,supno,discountgroupname)values(4,2,'discountgroup4');
create table product(prodno number, supno number, prodname varchar2(20), discountgroupno number);
insert into product(prodno, supno, prodname, discountgroupno)values(1,1,'product1',1);
insert into product(prodno, supno, prodname, discountgroupno)values(2,1,'product2',2);
insert into product(prodno, supno, prodname, discountgroupno)values(3,2,'product3',3);
insert into product(prodno, supno, prodname, discountgroupno)values(4,2,'product4',4);
application:
4 Datasources connected to ToracleDatasets and their Queries:
DS_SUP / ODS_Sup select SUPNO,SUPNAME from supplier
DS_Prod / ODS_Prod select rowid,PRODNO,SUPNO,PRODNAME,DISCOUNTGROUPNO from PRODUCT
where supno = :supno (Master: ODS_Sup, Master/Detail Fields: SUPNO)
DS_Disc1 / ODS_Disc1 select DISCOUNTGROUPNO,SUPNO,DISCOUNTGROUPNAME from DISCOUNTGROUP
where supno = :supno (Master: ODS_Sup, Master/Detail Fields: SUPNO)
DS_Disc2 / ODS_Disc2 select DISCOUNTGROUPNO,SUPNO,DISCOUNTGROUPNAME from DISCOUNTGROUP
where supno = :supno (Master: ODS_Prod, Master/Detail Fields: SUPNO)
QBEDefinition.AllowOperators is set to FALSE for all 4 Datasets.
2 ToracleNavigators:
oraNavSup Datasource: DS_SUP,
oraNavProd Datasource: DS_Prod,
2 TDBedits:
dbedSupname Datasource: DS_SUP, Datafield: supname
dbedProdname Datasource: DS_Prod, Datafield: prodname
2 DBlookupComboboxes:
dbLookupDisc1 Datasource: DS_Prod, Listsource: DS_Disc1, Datafield: discountgroupno, Keyfield: discountgroupno, Listfield: discountgroupname,
dbLookupDisc2 Datasource: DS_Prod, Listsource: DS_Disc2, Datafield: discountgroupno, Keyfield: discountgroupno, Listfield: discountgroupname,
problem:
If i enter QBE mode for the supplier dataset and type 'Company1' into dbedSupname and then execute QBE,
dbedProdname displays the name of the first product ('product1') belonging to Company1 as expected.
But dbLookupDisc1 is empty. dbLookupDisc2 shows the correct value ('discountgroup1').
When i then navigate to the next record with oraNavProd, both dbLookups show the correct value ('discountgroup2').
When i navigate back to the first record with oraNavProd, both dbLookups also show the correct value ('discountgroup1').
So the problem occurs just once for the first record that is displayed after QBE is executed for the supplier dataset
and only with dbLookupDisc1, whose dataset(ODS_Disc1) uses ODS_Sup as the Master dataset.
In most cases i might go with the settings of dbLookupDisc2, but when i want to search for products of a certain supplier
associated to a certain discountgroup and therefore first execute QBE for the supplier dataset to pick a supplier
and subsequently enter QBE mode for the product dataset to pick a discountgroup and then execute QBE for the product dataset,
now dbLookupDisc2 is empty and dbLookupDisc1 is the one that suits my needs. Damn...
I now switch the Master property of ODS_Disc2 (which is initially ODS_Prod) in the onClick event
of oraNavProd(when button nbEnterQBE was clicked) to ODS_Sup and right back to ODS_Prod in the AfterQBE event of ODS_Prod.
Seems to work so far...but i somehow got the feeling that this is not really the elegant way to do it...
My question is: Is there is a better way to handle this? what am i missing?
Thanks in advance
Horst Borscht