• Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

SQL COUNT Function

October 21, 2012 by techhoneyadmin

SQL COUNT FunctionSQL COUNT Function is used to return number of rows fetched by a query. Oracle COUNT Function can be used to count number of rows that matches criteria set in SQL WHERE Clause.Oracle COUNT Function can be used as SQL SELECT COUNT, SQL COUNT DISTINCT, SQL COUNT Group By Statements.


SQL COUNT Function Syntax

SELECT COUNT(expression)
FROM table_name
WHERE conditions;

SQL COUNT Function Examples

Suppose we have a table named “Employee” with the data as shown below.

Employee_ID Employee_Name Salary Department Commission
101 Emp A 10000 Sales 10
102 Emp B 20000 IT 20
103 Emp C 28000 Marketing 15
104 Emp D 30000 Support
105 Emp E 32000 Sales 10

Oracle COUNT Function application in different scenarios.


SQL COUNT Function – SQL SELECT COUNT (SQL COUNT Rows) Example

SQL COUNT Function can be used on single column of table as SQL SELECT COUNT Statement.

For example, SQL SELECT COUNT query below will count number of employees from ’employee’ table.

SELECT COUNT(employee_name)
FROM employee;

SQL SELECT COUNT query above returns ‘5’ as there are 5 employees in ’employee’ table.


SQL COUNT Function –  SQL WHERE Clause Example

Oracle COUNT Function can be used with SQL WHERE Clause.

For example, suppose we wish to view number of employees getting salary more than ‘21000’.

Oracle COUNT Function query below will fetch the number of employees having salary more than ‘21000’.

SELECT COUNT(*)
FROM employee
WHERE salary > 21000;

Oracle COUNT Function query above returns count of employees earning more than ‘21000’, which in our case is 3.


SQL COUNT Function – SQL COUNT DISTINCT Example

SQL COUNT DISTINCT query is use to view count of unique result.

For this we have to combine the Oracle COUNT Function with the SQL DISTINCT Clause.

For example, SQL COUNT DISTINCT query below will return the number of unique departments.

SELECT COUNT(DISTINCT(department))
FROM employee;

SQL COUNT DISTINCT query above returns ‘4’ as number of unique departments is ‘4’.

The department ‘Sales’ occurs twice in employee table and hence been counted only once.


SQL COUNT(*) Function – SQL COUNT GROUP BY Example

SQL COUNT Group By query is used to count records group wise.

For this we have to combine Oracle COUNT Function with the SQL GROUP BY Clause.

For example, the SQL COUNT Group By query below will return the department name and number of employees in each department.

SELECT department
       ,COUNT(*)
FROM employee
GROUP BY department;

SQL COUNT Group By query above returns the following data:

DEPARTMENT COUNT(*)
Sales 2
IT 1
Marketing 1
Support 1

Filed Under: function Tagged With: COUNTPLSQL, how to count number of rows in oracle sql, oracle sql count function syntax and example, oracle sql plsql count function

Message Styled Text in OA Framework

October 21, 2012 by techhoneyadmin

In Oracle Apps Framework the messageStyledText item style is a combination of the styledText and inlineMessage controls. It is used to display a prompt and a value against that prompt. For example you want to display the percentage of tasks done, then you need the name of the tasks to come as labels and the percentage of the tasks completed will be fetched from the View Object.

Task1: 90%
Task2: 50%
Here in the above example Task1 and Task2 are the labels that you give to the messageStyledText and the figures 91 and 50 are the values fetched by the View Attributes of the View Object attached with the messageStyledText to display the value.

Corresponding web bean: OAMessageStyledTextBean

Import Path: import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;

Filed Under: Items Tagged With: Message Styled Text in OA Framework, Message Styled Text in OAF, OA Framework Message Styled Text, OAF Message Styled Text, OAMessageStyledTextBean, What is Message Styled Text in OAF

Message Text Input In OAF

October 21, 2012 by techhoneyadmin

The messageTextInput in Oracle Application Framework provides an item which acts as a text box so that a user can enter the values into it and can save the same once the entered values passes the BC4J validation if any. It is a combination of the textInput and inlineMessage controls.

You can also write a prompt for the text box to specify the purpose of the text box in the label field provided by the Oracle Apps Framework.

Corresponding web bean: OAMessageTextInputBean

Import Path: import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;

Filed Under: Items Tagged With: Message Text Input in OA Framework, Message Text Input in OAF, OA Framework Message Text Input, OAF Message Text Input, OAMessageTextInputBean, What is Message Text Input in OAF

Raw Text Bean In OA Framework

October 21, 2012 by techhoneyadmin

The rawText item style supports output of unescaped text. Use of this class means assuming full responsibility for generating proper HTML. Clients should strongly consider using elements in the HTML namespace instead of this class. In particular, this class does not attempt to encode or escape characters for NLS or HTML compliance.

Corresponding web bean: OARawTextBean

Import Path: import oracle.apps.fnd.framework.webui.beans.OARawTextBean;

Filed Under: Items Tagged With: OA Framework Raw Text Bean, OAF Raw Text Bean, OARawTextBean, Raw Text Bean in OA Framework, Raw Text Bean in OAF, What is Raw Text Bean in OAF

Reset Button In OA Framework

October 21, 2012 by techhoneyadmin

Suppose you want to create a button which will clear all the contents that a user has filled in the form in one shot, in these cases you can use the ResetButton provided by Oracle Application Framework. In the push of the ResetButton all the contents placed in all the items of that OAF Page will be cleared and become blank. In simple words the ResetButton is used to reset the contents of the whole OAF Page.

Corresponding web bean: OAResetButtonBean

Import Path: import oracle.apps.fnd.framework.webui.beans.form.OAResetButtonBean;

Filed Under: Items Tagged With: OA Framework Reset Button, OAF Reset Button, OAResetButtonBean, Reset Button in OA Framework, Reset Button in OAF, What is Reset Button in OAF

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 71
  • Page 72
  • Page 73
  • Page 74
  • Page 75
  • Page 76
  • Go to Next Page »

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in