Solved

How  to use Radio Button in PL/SQL?

Posted on 2001-06-21
6
3,931 Views
Last Modified: 2010-08-05
Hi Experts

I am quiet new to PL/SQL (Forms and Reports 6i)
I had created 3 Radio Button

1  RadioButton='Clerk'
2  RadioButton='Salesman'
3  RadioButton='manager'

what i need is whenever i select Radiobutton 1,2 or 3
i need to display all the records from emp  only the particular job=Radiobutton, this table is based on Oracle emp.

1 I prefer good working sample based on emp table

2 Anybody having any other good sample code also welcome


Thanks in Advance
H




   


0
Comment
Question by:nisha080597
  • 4
6 Comments
 

Expert Comment

by:rgajria
Comment Utility
Hi Nisha,
Give the value of the radio button as 'C' for Clerk, 'S' for Salesman.Write a trigger on When_radio_changed.

  If :Job = 'C' then
   Set_block_property('emp',default_where,'JOB = ''CLERK''');
   execute_query;
  ElsIf :Job = 'S' then
    Set_block_property('emp',default_where,'JOB = ''SALESMAN''');
    execute_query;
  ElsIf :Job = 'M' then
    Set_block_property('emp',default_where,'JOB = ''MANAGER''');
    execute_query;
  End if;

This can be done in other ways too.

0
 
LVL 2

Accepted Solution

by:
renuraj earned 50 total points
Comment Utility
Create a database block on emp

Create one non-basetable item as record group with no if item displayed set to 1,and required no of radio buttons with values
ANALYST
CLERK
MANAGER
PRESIDENT
SALESMAN

In the when-radio-changed trigger enter the following code:

set_block_property('EMP',DEFAULT_WHERE,'JOB='||''''||:JOB_TYPE||'''');
execute_query;

Initial value for the record group should be any of the values for job.

'job_type' is the record group name with radio buttons having value as different types of jobs.

The same above code can be written in WHEN-NEW-FORM-INSTANCE also, if required.

Regards,
0
 
LVL 2

Expert Comment

by:renuraj
Comment Utility
''''||:JOB_TYPE||'''' - here all the quote are single quotes like ' not double quotes like ".

Regards,
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:nisha080597
Comment Utility
Hi Experts i need more  explanation regarding my above question i tried it is not working ?

 Thanks
H
0
 
LVL 2

Expert Comment

by:renuraj
Comment Utility
Hi,

If u need further clarification, check the form with name rg.fmb in yahoo mail with subject 'check this'  username is tryntry2000
password tryntry2001

If u further need any clarification, feel free to ask.

Regards,
0
 
LVL 2

Expert Comment

by:renuraj
Comment Utility
1. create a data block based on emp table.(or whichever table)
2. Create record group in the same block
   set properties as below
   name - JOB_SET
   Initial Value - PRESIDENT (It could be set to anything)
   Number of Items Displayed - 1
   Database Item - No
3. Create 5 radio buttons under radio group JOB_SET
   Set the radio button properties as below
   Radio button 1 - label - PRESIDENT
   Radio button 1 - Radio Button Value - PRESIDENT  
   Radio button 2 - label - ANALYST
   Radio button 2 - Radio Button Value - ANALYST
   Radio button 3 - label - CLERK
   Radio button 3 - Radio Button Value - CLERK
   Radio button 4 - label - MANAGER
   Radio button 4 - Radio Button Value - MANAGER
   Radio button 5 - label - SALESMAN
   Radio button 5 - Radio Button Value - SALESMAN

4. In WHEN-RADIO-CHANGED trigger of JOB_SET radio group
   and also in the WHEN-NEW-FORM-INSTANCE trigger at Form Level
   write the code as given below:

set_block_property('EMP',DEFAULT_WHERE,'JOB='||''''||:JOB_SET||'''');
execute_query;

5. Everytime you change the job by clicking on radio button
   only particular records will be displayed.

Try this..
Regards,

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now