Home » Developer & Programmer » Forms » how to base a block on left join (forms 6i)
how to base a block on left join [message #542139] Sun, 05 February 2012 04:33 Go to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
hi , i am trying to develop an application of cars
the car have marques example :TOYOTA,HUNDAI,CHEVROLET
each mark have families example: TOYOTA have hilux, yaris corola, CHEVROLET have opra,...etc
each family have a lot of models example: hilux have h2kn-clim,.. etc
and finally there are some options witch are generally in all cars example Radio-k7,air-conditioner ... etc
option 1..n-----------------1..n model the relation call(opt_mod)
i did develop the block of marques (master) and the block of families (detail) in a form 1
i did develop the bock of models(master) in form 2 and the is no problem
but i want to add to form 2 the block of (opt_mod) but the user did tell me that he want to to see all options with check boxes .

as a solution of this problem i want to build a block on LEFT JOIN between table :option and table :opt_mod
but i didn't now to how do that

[Updated on: Sun, 05 February 2012 04:39]

Report message to a moderator

Re: how to base a block on left join [message #542183 is a reply to message #542139] Sun, 05 February 2012 12:31 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is how I understood it: form 2 contains (at the moment) one block (MODELS table (these are Hilux, Yaris, Corolla, ...)).

You need to create another block which will display all options (OPTIONS table (radio, air conditioner, ...).

So, if you need to display ALL options, then display ALL of them; why would you need any kind of join at this stage?

You'd store checked values into a separate table:
create table model_option
  (model_id   number   constraint fk_mo_model  references model (id),
   option_id  number   constraint fk_mo_option references option (id)
  );

You'd just (possibly in a loop)
INSERT INTO model_option (:models.model_id, :options.option_id)

Another option is to pre-insert MODEL_OPTION table with all (model_id, option_id) combinations, and - upon COMMIT - delete options that were not checked.

I suppose you'll here some more ideas by other forum members.
Re: how to base a block on left join [message #542194 is a reply to message #542183] Sun, 05 February 2012 14:22 Go to previous messageGo to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
thanks for replaying
as you understood but i want do desplay all options with cheek boxes .. i use left join between table option and table
model_option like this
where option.id_option(+)=option_model.id_option
the result of that left join is a table wich contains all records of table option and all records from table option_model like this
id_option(option)|id_option(option_model)
RadioK7 | RadioK7
air-conditioner | air-conditioner
option3 | NULL
option 4 |option 4
option 5 |NULL

and i use a cheek box and i synchronise it with the column 2 id_option(option_model) ;
value when not coched -----NULL
value when coched ----- any value
value defult coched
i have bad english by i hope that you understood me
Re: how to base a block on left join [message #542251 is a reply to message #542194] Mon, 06 February 2012 02:01 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, the problem is how to mark whether certain checkboxes are checked or not?

If so, perhaps you could try with POST-QUERY trigger; for example:
if :block.id_option_option = :block.id_option_option_model then
   :block.checkbox_item := 1;    -- checked!
end if;
Re: how to base a block on left join [message #542285 is a reply to message #542251] Mon, 06 February 2012 06:31 Go to previous message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
"So, the problem is how to mark whether certain checkboxes are checked or not?"
No , this is not my problem because i did it (mark whether certain checkboxes are checked or not) by using the left join and synchronising the cheek box with the second colum (ho have some records null)
ANYWAY i solved the probleme of updating the original tables

trigger : when-cheek-box-changed
begin
insert into model_option values(option_id,model_id);
clear_block(no_validate);
execute_query;
end;


when a execute query the new record added recently into table model_option display in MY_BLOCK(ho has cheek boxes)
and his cheek box will be cheeked because he have not "NULL" in the second colum
remmeber that My cheek box is sybchronised with the colum 2
when i have NULL ----- NOT CHEEKED
When not null ----- cheeked
thanks a lot

[Updated on: Mon, 06 February 2012 06:32]

Report message to a moderator

Previous Topic: update block based "from clause query"
Next Topic: developer suite 10 g
Goto Forum:
  


Current Time: Thu Sep 12 23:36:39 CDT 2024