• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4426
  • Last Modified:

How to use Radio Button in PL/SQL?

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
nisha080597
Asked:
nisha080597
  • 4
1 Solution
 
rgajriaCommented:
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
 
renurajCommented:
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
 
renurajCommented:
''''||:JOB_TYPE||'''' - here all the quote are single quotes like ' not double quotes like ".

Regards,
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
nisha080597Author Commented:
Hi Experts i need more  explanation regarding my above question i tried it is not working ?

 Thanks
H
0
 
renurajCommented:
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
 
renurajCommented:
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now