Home » Developer & Programmer » Forms » Update Another Table (10g)
Update Another Table [message #646113] Sat, 19 December 2015 12:37 Go to next message
Mukul Ahmed
Messages: 16
Registered: December 2015
Location: Bangladesh
Junior Member
Please, I want to update another table from one table. as like, when I input a room_id in reservation table (:reservation.room_id), then with relation room_id, room table (:room.room_status) will be automatically changed to booked from available. I use checkbox. Failed. Please give me a solution..
Re: Update Another Table [message #646120 is a reply to message #646113] Sun, 20 December 2015 04:54 Go to previous messageGo to next message
Littlefoot
Messages: 21575
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It appears that this form contains (at least) two block. Are they database or control blocks? If the former, you can change the status directly in a form (:room.room_status := 'booked'). If the later, you'll need the UPDATE statement with the appropriate WHERE clause.

What do you use a checkbox for? You enter ROOM_ID. ROOM_STATUS is changed from "available" to "booked". So, what does the checkbox do?
Re: Update Another Table [message #646129 is a reply to message #646120] Sun, 20 December 2015 09:35 Go to previous messageGo to next message
Mukul Ahmed
Messages: 16
Registered: December 2015
Location: Bangladesh
Junior Member
I have given checkbox value 'Available' and 'Booked'. I have used when_checkbox_changed trigger. when I will click to change checkbox, the :room.room_status will be changed to 'Booked' from 'available'. Its my thinking. But, how can I implement it? Or any other solutions?
Re: Update Another Table [message #646151 is a reply to message #646129] Sun, 20 December 2015 11:44 Go to previous messageGo to next message
Littlefoot
Messages: 21575
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
I have used when_checkbox_changed trigger

So share your code with us!

Did you properly set checkbox item's checked and unchecked values (in item's Property Palette window)?
Re: Update Another Table [message #646155 is a reply to message #646151] Sun, 20 December 2015 12:43 Go to previous message
Mukul Ahmed
Messages: 16
Registered: December 2015
Location: Bangladesh
Junior Member
I have a column 'status' in room table. at first, All the room_id status set to available. I wanted to do, when I input a room_id in reservation table, the status of that room will be changed to booked in room table. for this, in reservation block i take a column 'status'. when-valid-item trigger applied, so that when i input a room_id, its status will be shown in reservation.status. I convert the status text item to checkbox. then used when-checkbox-changed trigger

--when-checkbox-changed
begin
if :reservation.(checkbox_name) = 'Booked' then
:room.status :='Booked';
else
:room.status := 'Available';
end if;
end;
It works, if I also convert the :room.status column to checkbox and number of item displayed = 1
Any Other solution please?

[Updated on: Sun, 20 December 2015 12:50]

Report message to a moderator

Previous Topic: Shortcut
Next Topic: Please provide WEBUTIL_106.zip and jacob_18.zip files
Goto Forum:
  


Current Time: Thu Jul 09 13:44:34 CDT 2020