how to base a block on left join [message #542139] |
Sun, 05 February 2012 04:33 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/2f322cf4fd8901dfa183778de7e42b66?s=64&d=mm&r=g) |
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 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 #542285 is a reply to message #542251] |
Mon, 06 February 2012 06:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](//www.gravatar.com/avatar/2f322cf4fd8901dfa183778de7e42b66?s=64&d=mm&r=g) |
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
|
|
|