inserting in 2 datablocks [message #121637] |
Tue, 31 May 2005 05:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
jonmich005
Messages: 53 Registered: April 2005
|
Member |
|
|
Hello
I have 2 datablocks, one with intervals and one with actions.
My datablock interval exists out of an id and a name. It has 20 reocrds.
Now my other datablock exists out of tl_grid_int_1 to tl_grid_int_20.
When I click on a button, I can insert a record in my datablock interval. I know how to do this but I can insert them in the middle of all my other items. So every item after my inserted record has to move one place to th right.
Now my question is how can I also do this for my other datablock.
I have the following code:
while act<100 loop
update lds_tl_grid
set tl_grid_int_2 = (select tl_grid_int_1 from lds_tl_grid where tl_grid_veh_id = :global.vehicle and tl_grid_scen = :global.scenario and tl_grid_id = act)
where tl_grid_veh_id = :global.vehicle
and tl_grid_scen = :global.scenario
and tl_grid_id = act;
commit;
execute_query;
act:=act+1;
end loop;
The tl_grid_int_2 has tobe replaced by something like tl_grid_int_||int_id, but this doesn't work.
Is this not possible in a select-statement?
What else can I do?
Greetings Jonas
|
|
|
|
Re: inserting in 2 datablocks [message #121807 is a reply to message #121781] |
Wed, 01 June 2005 02:54 ![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) |
jonmich005
Messages: 53 Registered: April 2005
|
Member |
|
|
I'm sory, I was forgotten that I already put this thread here.
And if I want to work with an array, how does this work???
I need to use the define array staement but how can I do this?
Greetings
|
|
|
|
|
|
|
Re: inserting in 2 datablocks [message #121819 is a reply to message #121816] |
Wed, 01 June 2005 03:52 ![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/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
In your initial post you have the statement:
update lds_tl_grid
set tl_grid_int_2 = (select tl_grid_int_1
from lds_tl_grid
where tl_grid_veh_id = :global.vehicle
and tl_grid_scen = :global.scenario
and tl_grid_id = act)
where tl_grid_veh_id = :global.vehicle
and tl_grid_scen = :global.scenario
and tl_grid_id = act; and you said Quote: | The tl_grid_int_2 has tobe replaced by something like tl_grid_int_||int_id, but this doesn't work.
| so make the 'stmt' line look like
stmt :=
'update lds_tl_grid' ||
' set tl_grid_int_' || int_id ||' = (select tl_grid_int_1' ||
' from lds_tl_grid' ||
' where tl_grid_veh_id = <:global.vehicle>' ||
' and tl_grid_scen = <:global.scenario>' ||
' and tl_grid_id = act)' ||
' where tl_grid_veh_id = <:global.vehicle>' ||
' and tl_grid_scen = <:global.scenario>' ||
' and tl_grid_id = act';
you will have to build dbms_sql.bind_array statements to handle each of the global that are enclosed by '<>'.
David
[Updated on: Wed, 01 June 2005 03:53] Report message to a moderator
|
|
|
|
|
|
Re: inserting in 2 datablocks [message #121948 is a reply to message #121826] |
Wed, 01 June 2005 19:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Why don't you just base your second block on the intervals. Then when you double-click a particular field you can fire the when-mouse-double-click trigger and, if the last entry is empty, move the previous to the next until you free up the field in which you double clicked?
David
|
|
|