Home » Developer & Programmer » Forms » how to get it........
how to get it........ [message #227837] Thu, 29 March 2007 13:07 Go to next message
rajat_chaudhary
Messages: 141
Registered: November 2006
Location: india
Senior Member

hi everyone,
suppose there are two tables say
employees(employee_id,hire_date,salary,department_id) and departments(department_id,department_name)

actually i want to retrieve the data of """ employee_id,hire_date,salary,department_name,department_id """ on the basis salary .....

in forms6i ,i have a text item of salary and the moment when i click a button or to execute the query ,data will be retrieved on the basis of salary ,,, the related data would be shown in the text/display items..........

ex---
suppose ther are 3 employees getting salary 5,000 so when i enter the salary 5000 and execute/press a button , the information of that employee_ids,corresopnding department_id from where they are belonging ,....... and all the data in the presented fields ( as metioned columns) will be displayed..
please send an attached module of this solution.....

thanks very much in advance.......
Re: how to get it........ [message #227843 is a reply to message #227837] Thu, 29 March 2007 13:29 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
I don't do forms, but isn't your question, actually about a join of two tables, and an extra clause in where condition like
and salary= x (where x is the value you pass from the front end)
something like:
select 
 employee_id,hire_date,salary,department_name,department_id 

 from 
 employee, departments
where
employee.department_id=department.department_id
and employee.salary=:x 

so basically join the two tables on the matching keys and then add an extra clause in the where clause as above and attach this query to the when button pressed or whatever the action is and check...
just my 2 cents.
Re: how to get it........ [message #227847 is a reply to message #227843] Thu, 29 March 2007 13:56 Go to previous messageGo to next message
rajat_chaudhary
Messages: 141
Registered: November 2006
Location: india
Senior Member

i also know this solution in sql
but how to get it in pl/sql and implement this code in forms6i...........


think and then answer please.......
Re: how to get it........ [message #227862 is a reply to message #227837] Thu, 29 March 2007 19:20 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Base your block on the table 'employees' and in the 'Post-Query' trigger get the information from the 'departments' table.

If you want to search by information on the 'departments' table and do it in the SAME form and SAME canvas then you need to rethink your design. In that case look at the following master-detail links.

Master-Detail entries
Simple
http://www.orafaq.com/forum/m/218834/67467/#msg_218834
Query
http://www.orafaq.com/forum/m/201562/67467/?srch=master+detail+david+query#msg_201562

David
Previous Topic: how ca i save?????
Next Topic: problem with sequence generation
Goto Forum:
  


Current Time: Tue Dec 03 05:44:55 CST 2024