[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How  to use Radio Button in PL/SQL?

Posted on 2001-06-21
6
Medium Priority
?
4,357 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

656 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