Home » Developer & Programmer » Forms » How to insert data to other table which is not on the same block please?
How to insert data to other table which is not on the same block please? [message #214424] Tue, 16 January 2007 07:23 Go to next message
Smith_X
Messages: 56
Registered: January 2007
Member
Hello,

Short Question.
I want to update data in another table which it's not in the same block that I working on. Are there any way to do that?

The Whole Story.
In example, I have twos data block and two forms to make a purchase order document. (Purchase Order (PO) is a master-detail and has a relation with POI table.)

Next, when user create a new po, I want my system to populate the log in my log table. Well, how I could do that, please?

As far as I try to think.. I should make a new block "LOG" which it is handle for the LOG table. Then, when I try to save a PO. I have to create a Pre-Insert trigger in my detail block to do something like following...

1. Go_block(LOG)
2. create all data that I would like to save in LOG Table
3. Go_block(PRI)

Do I understand correct please?

One more question, should this logic work with my inventory movement table, please?? I need to keep track for every in-out raw material and inventory unit, too.

Regards,
Smith Smile

[Updated on: Tue, 16 January 2007 07:39]

Report message to a moderator

Re: How to insert data to other table which is not on the same block please? [message #214459 is a reply to message #214424] Tue, 16 January 2007 09:03 Go to previous messageGo to next message
Smith_X
Messages: 56
Registered: January 2007
Member
another problem..

If what I want to do is.. inventory movement which the data located in detail block in a turbular style. I'm really have no idea how to pass the data to update in inventory movement table.

please advice me.
Re: How to insert data to other table which is not on the same block please? [message #214523 is a reply to message #214459] Tue, 16 January 2007 19:36 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
To populate a log table use direct 'insert' statements in a database trigger associated with the table in question.

David
Re: How to insert data to other table which is not on the same block please? [message #214525 is a reply to message #214459] Tue, 16 January 2007 19:40 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Concerning master detail forms, do one of the following: search this forum for 'master detail', do a basic 'dept' and 'emp' form using the standard example data from oracle (create dept block using wizard, create emp block using wizard, then create 'relations' between the two blocks using the wizard), or go to the Oracle Forms web site and download and review their master detail examples (look in 'demos').

David
Re: How to insert data to other table which is not on the same block please? [message #214531 is a reply to message #214525] Tue, 16 January 2007 20:38 Go to previous messageGo to next message
Smith_X
Messages: 56
Registered: January 2007
Member
Thanks very much for your reply David.

I will try to apply your tip for my first question today.

For the second question, I'm sorry that I do not explain more detail enough. The problem that I face in second question is much like to first question. The example is.. I have Goods Received Document which use when supplier transfer an inventories to company. next, I use Goods Received Form to track inventories that company received. The problem is that when company received the inventories I want to update data in database another three tables

1. Table Inventory Movement
2. Table Inventory Balance for associated Branch
3. Table Balance of Master Inventory

The first table design to keep records in-out of inventory by transactions. The second inventory keep update the balance of inventory in each branch. (Each received documents will affect not more than one branch.) Finally, the master inventory is a table that like table number 2 but update the whole number of inventory in company. The data in third table will use to represent for very top view of the whole inventory in company.

I need to update so many table to prevent the long time calculation when I would like to prepare the inventory on-hand report.

Next, the inventory that I received are shown in "detail" of Goods Received Document. Can I use the same method that Dave reply in the first question please? Just only insert??? Do I need any other specific command please?

[Updated on: Tue, 16 January 2007 20:43]

Report message to a moderator

Re: How to insert data to other table which is not on the same block please? [message #214542 is a reply to message #214531] Tue, 16 January 2007 23:22 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The name is David.

Yes you can use the same technique but with an update trigger on the table. There is also a delete trigger available. Get a copy of the "Server SQL Reference Manual" for your version of the database from the Oracle web site, then look at the 'create trigger' section.

David
Previous Topic: if down arrow key is pressed, detail block window is displayed
Next Topic: regarding master-detail relationship
Goto Forum:
  


Current Time: Fri Sep 20 14:34:20 CDT 2024