?
Solved

How  to use Radio Button in PL/SQL?

Posted on 2001-06-21
6
Medium Priority
?
4,255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 

Expert Comment

by:rgajria
ID: 6213570
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 200 total points
ID: 6213578
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
ID: 6213599
''''||:JOB_TYPE||'''' - here all the quote are single quotes like ' not double quotes like ".

Regards,
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:nisha080597
ID: 6214078
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
ID: 6214502
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
ID: 6214708
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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ā€¦
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

765 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