Solved

How  to use Radio Button in PL/SQL?

Posted on 2001-06-21
6
4,149 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 50 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Industry Leaders: 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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

738 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