Home » Developer & Programmer » Forms » Retriving Record from Another Table (Windows XP)
Retriving Record from Another Table [message #324458] Mon, 02 June 2008 09:56 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Dear All,

i have a query.

i have the below table.

DESC master_employee;
EMP_ID NOT NULL NUMBER(10)
FIRST_NAME NOT NULL VARCHAR2(20)
MIDDLE_NAME_INIT VARCHAR2(15)
LAST_NAME VARCHAR2(20)
DEPT_ID NOT NULL NUMBER(10)
JOB_ID NOT NULL NUMBER(10)
JOB_TITLE VARCHAR2(30)
SUPERVISOR VARCHAR2(30)
WORK_LOC VARCHAR2(20)
JOINING_DATE DATE
NATIONALITY VARCHAR2(45)
MOBILE VARCHAR2(15)
TELEPHONE VARCHAR2(15)
TEL_EXT VARCHAR2(10)
EMAIL VARCHAR2(60)
HOMEPAGE VARCHAR2(60)
KSA_ADDRESS VARCHAR2(200)
ORIGIN_ADDRESS VARCHAR2(200)
EMP_PIC BLOB
STATUS VARCHAR2(10)
DEPT_NAME VARCHAR2(30)

DESC DETAILS_EMP_SALARY_BNFTS
EMP_ID NUMBER(10)
BASIC_SALARY NOT NULL VARCHAR2(20)
HOUSING VARCHAR2(20)
HOUSING_TOT VARCHAR2(20)
TRANSPORTATION VARCHAR2(20)
TRANSPORTATION_TOT VARCHAR2(20)
HOURLY_RATE VARCHAR2(20)
MEDICAL_POLICY_ID VARCHAR2(10)
MEDICAL_POLICY VARCHAR2(10)
ADULT VARCHAR2(15)
CHILD VARCHAR2(15)
CONTRACT VARCHAR2(20)
TICKET_PER_YR VARCHAR2(10)
TICKET_DESTINATION VARCHAR2(30)
NOTE VARCHAR2(100)
NO_OF_ADULT NUMBER(3)
NO_OF_CHILD NUMBER(3)

DESC MASTER_DEDUCTION
DEDUCTION_ID NOT NULL NUMBER(10)
EMP_ID NUMBER(10)
DEDUCT_DATE DATE
DEDUCT_TYPE VARCHAR2(60)
AMOUNT VARCHAR2(20)
NOTE VARCHAR2(60)


DESC MASTER_PAYROLL ;
PAYROLL_ID NUMBER(10)
PAYROLL_DATE NOT NULL DATE
EMP_ID NUMBER(10)
FIRST_NAME VARCHAR2(20)
MID_NAME_INIT VARCHAR2(20)
LAST_NAME VARCHAR2(20)
JOB_TITLE VARCHAR2(30)
WORK_LOC VARCHAR2(20)
HOURS_WORKED VARCHAR2(20)
GROSS_PAY VARCHAR2(20)
HSNG_ALLNCES VARCHAR2(20)
TRANSPORTATION_ALLNCES VARCHAR2(20)
OTHERS VARCHAR2(20)
DEDUCTION VARCHAR2(30)
NET_PAY VARCHAR2(20)
NO_OF_DAYS NUMBER(6)
PER_DAY NUMBER(6)
PER_HOUR NUMBER(6)
DEDUCT_ID NUMBER(10)
BASIC_SALARY VARCHAR2(20)
DEDUCT_AMT VARCHAR2(20)

i wanna to fetch record in master_payroll and the common field is EMP_ID when i enter the EMP_ID in master_payroll it will fetch all the the records from the above tables.

how can i retrive the data with this emp_id your help will appreciate.

Regards

Re: Retriving Record from Another Table [message #324479 is a reply to message #324458] Mon, 02 June 2008 12:42 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sounds like a classic master-detail relationship. Is it not?
Re: Retriving Record from Another Table [message #324570 is a reply to message #324479] Tue, 03 June 2008 03:28 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
It is dear....

how can i do? can you give me example.

Note; all the forms are not in one module.
Re: Retriving Record from Another Table [message #324579 is a reply to message #324570] Tue, 03 June 2008 03:43 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
all the forms are not in one module

In other words, every table has its own form? If so, you'll have to pass EMP_ID as a parameter (or a global variable) to other forms.

How to call a form? There are OPEN_FORM, NEW_FORM, CALL_FORM built-ins; check Forms Online Help System to see how each of them works.

You could set the DEFAULT_WHERE clause for a data block using the SET_BLOCK_PROPERTY built-in (you'll have to use concatenation operator) and execute query to retrieve records that belong to that EMP_ID.
Previous Topic: to change source table at runtime
Next Topic: how to suppress the the form error FRM-40654
Goto Forum:
  


Current Time: Mon Feb 03 07:03:37 CST 2025