473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I want to update a field of a table from other table on Run_time.

5
Hi and thanks to pragatiswain for reply.

i tell u about tables in the database.
TABLE NAMES are "SUB_HEAD","CATEGORY","COMPANY","BILL","BILL_DETAI L.

I've a master detail relationship b/w BILL and BILL_DETAIL FORM.

Master table is "BILL" and Child table is "BILL_DETAIL".
and also CATEGORIES and COMANY tables values are dependent on "BILL and BILL_DETAIL" table.

I want that when i enter values in master detail form and when i press save button then it
those values(of COMPANY and Categories tables), which are dependent on master detail form, should
be updated , which trigger should i use in the FORMS.

Please help me to solve out the problem.
These are the table structures:

1. SUB_HEAD Table Structure

Name Null? Type
------------------------------- -------- ----
S_HEAD_CODE NOT NULL VARCHAR2(12)
S_HEAD_NAME NOT NULL VARCHAR2(60)
M_HEAD_CODE NOT NULL VARCHAR2(12)
TAXABLE NOT NULL VARCHAR2(6)
S_HEAD_TEXT NOT NULL VARCHAR2(1000)
ADDITIONAL_ALLOCATION NUMBER(38)
INITIAL_ALLOCATION NUMBER(38)
---------------------------------------------------------------------------------------------
2. CATEGORIES Table

Name Null? Type
------------------------------- -------- --------------- ----
S_HEAD_CODE NOT NULL VARCHAR2(12)
CATEGORY_CODE NOT NULL NUMBER(38)
CATEGORY_DESC NOT NULL VARCHAR2(50)


3. COMPANY TABLE

Name Null? Type
------------------------------- -------- ----
COMP_ID NOT NULL NUMBER(38)
COMP_NAME NOT NULL VARCHAR2(40)
CONTACT_PERSON VARCHAR2(25)
COMP_ADDRESS VARCHAR2(200)
NTN VARCHAR2(15)
OWNER_CNIC VARCHAR2(15)
TOTAL_BUSINESS_PURCHASE NUMBER(38)
TOTAL_BUSINESS_REPAIR NUMBER(38)

(Note: TOTAL_BUSINESS_PURCHASE and TOTAL_BUSINESS_REPAIR field is dependent on the field of " BILL_AMOUNT" of BILL_DETAIL table)
because these fields are amount of business in rupees

4. BILL TABLE

Name Null? Type
------------------------------- -------- ----
BILL_ID NOT NULL NUMBER(38)
S_HEAD_CODE NOT NULL VARCHAR2(12)
BILL_DATE NOT NULL DATE
TOTAL_BILL NUMBER(38)
------------------------------------------------------------------------------------------------


5. Name Null? Type
------------------------------- -------- ----
BILL_ID NOT NULL NUMBER(38)
S_HEAD_CODE NOT NULL VARCHAR2(12)
SR_NO NOT NULL NUMBER(38)
BILL_AMOUNT NUMBER(38)
DESCRIPTION NOT NULL VARCHAR2(1000)
CATEGORY_CODE NUMBER(38)
COMP_ID NUMBER(38)
TAX_AMOUNT NUMBER(38)
TAX_ID NUMBER(38)

---------------------------------

Please tell me which TRIGGER should be used in ORACLE FORMS.

Thanks and Regards
Nov 22 '06 #1
1 1596
pragatiswain
96 Expert
You quoted : "Master table is "BILL" and Child table is "BILL_DETAIL".
and also CATEGORIES and COMANY tables values are dependent on "BILL and BILL_DETAIL" table."

MY QUESTION : WHICH FIELDS ARE DEPENDENT AND HOW?

I FEEL, YOUR INFORMATION IS INADEQUATE TO DO WHAT YOU EXACTLY WANT. AGAIN, YOU PROBABLY DIDN'T UNDERSTAND THAT I HAVE ALREADY PROVIDED YOU THE SOLUTION. YOU HAVE TO JUST MODIFY IT BASED ON YOUR BUSINESS LOGIC AND CREATE IT IN THE DB. IT WILL SOLVE YOUR PROBLEM.
TRIGGER IS A DATABASE OBJECT WHICH YOU HAVE TO CREATE BASED ON YOUR REQUIREMENT.

TRIGGER CREATION STRUCTURE:

CREATE OR REPLACE TRIGGER <YOU_SPECIFY_TRIGGER_NAME>
<AFTER / BEFORE> <INSERT / UPDATE>
ON <YOUR_SOURCE_TABLE_NAME>
FOR EACH ROW
BEGIN
<YOUR_CODE_LOGIC_IMPLEMENTATION>
END <YOU_SPECIFY_TRIGGER_NAME>;

NOTE : WHILE WRITING THE LOGIC, :NEW REPRESENTS THE CURRENT RECORD ON WHICH IS AFFECTED IN SOURCE TABLE AND ITS COLUMN CAN BE ACCESSED AS :NEW.<SOURCE_TABLE_COLUMN>
YOU TRY TO WRITE THE TRIGGER. IF YOU FACE ANY PROBLEM, MEMBERS HERE CAN HELP YOU OUT.
Nov 22 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
8
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
2
by: serge | last post by:
/* This is a long post. You can paste the whole message in the SQL Query Analyzer. I have a scenario where there are records with values pointing to wrong records and I need to fix them using an...
3
by: turtle | last post by:
I have Two tables (Table1 and Table2). Both tables have a common field called part number. Table 1 contains an extra field that i would like to update table 2 to match if the part number matches....
8
by: Stephen Plotnick | last post by:
I have three forms and update one table in an Access DB with sucess in one form. In the other two forms I'm trying to do an update to a different table in the Access DB. The error I'm getting...
1
by: soahil | last post by:
Hello to everybody! I want that during inserting values in the master/detail form whenever I select a Company ID and enter BILL Amount against that company and SAVE that record then It should SAVE...
0
by: JDS | last post by:
I have a table with the primary key as a uniqueidentifier / GUID and the rowguid property set (it is used for replication). When creating a data table in a dataset in VS2005 the table adapter...
4
by: hapnendad | last post by:
In the question statement below Field names are in and variables are in (). All fields referenced are in what I have named the ‘PAR’ Table. Using MS Access 2003, I am working on a project...
33
by: mjvm | last post by:
HI, I have a main table (tblStudents) that holds students where the unique field is StudentID; and a related table (tblNotes) on a one-to-many relationship, where the unique field is NotesID, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.