id's [message #119218] |
Wed, 11 May 2005 05:16 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
jonmich005
Messages: 53 Registered: April 2005
|
Member |
|
|
I have a form with 20 fields. if every field is empty and you push a button there zill be an id showed on the form namely one.
But if there is filled in already an id, the next field will get id 2 and so on.
This is ok if I change the item that relates to the id, but if I don't change it and I click on the button, It also raises with 1.
This is my problem, how can I fix this?
Here is my code:
:global.i:=0;
select count(tl_int_id)
into :global.i
from interval
where tl_int_veh_id = :global.vehicle;
if not :global.i =0 then
select max(tl_int_id)+1
into :tl_int_id
from interval
where tl_int_veh_id = :global.vehicle;
insert into interval values(:interval.tl_int_veh_id,:global.scenario,:tl_int_id,:tl_int);
else
:tl_int_id :=1;
insert into interval values(:interval.tl_int_veh_id,:global.scenario,1,:tl_int);
end if;
standard.commit;
|
|
|
Re: id's [message #119349 is a reply to message #119218] |
Thu, 12 May 2005 02:35 ![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 |
|
|
The values ":global.vehicle" and ":interval.tl_int_veh_id" need to be associated somehow.
You are getting your 'count' via :global.vehicle, but you are inserting a record using :interval.tl_int_veh_id
Try counting using :interval.tl_int_veh_id
David
|
|
|