Skip to main content

Posts

Showing posts from 2013

Find the default date format for your current session

For input and output of dates, every Oracle Database instance has a default date  format model  (also called a  mask ) that is set by the NLS_DATE_FORMAT  initialization parameter . (Initialization parameters determine the default settings for Oracle Database instances. Users who have appropriate permissions can change some of these parameters on a per-database, per-instance, or per-session basis.) When you first query the data stored in a table column with a DATE datatype, Oracle Database displays it with a format mask of either DD-MON-YYYY or DD-MON-RR, depending on which is set as the default.

Relationship cardinality

Can be of three types: one-to-many, one- to-one, or many-to-many. One-to-many (1:M).  The most common type of relationship cardinality is a 1:M relationship. Consider the relationship between the  EMPLOYEE  and  DEPARTMENT  tables shown in Figure 1. The common column is DEPARTMENT_ID (which is the primary key in the  DEPARTMENT  table and the foreign key in the  EMPLOYEE  table). One individual DEPARTMENT_ID can relate to many rows in the  EMPLOYEE  table. This represents the business rule that one department can relate to one or many employees (or even no employees) and that an employee is associated with only one department (or, in some cases, no department). This business rule can be restated as follows:  Each employee in a department may be in one and only one department, and that department must exist in the department table. One-to-one (1:1).  A 1:1 relationship between the  DEPARTMENT  table and t...

Oracle Reports - Changing the current mode (Confine or Flex)

To set or override Confine mode:  In the Paper Layout view, click  Confine On or Confine Off  in the toolbar to toggle the mode: On: child objects cannot be moved outside their enclosing parent objects. Off: child objects can be moved outside their enclosing parent objects. To set or override Flex mode:  In the Paper Layout view, click  Flex On or  Flex Off in the toolbar to toggle the mode: On: parent borders "stretch" when child objects are moved against them. The child object maintains the same distance from the side it moves against. Off: parent borders remain fixed when child objects are moved against them.

Difference Between CASE and DECODE?

– CASE is a expression – DECODE is a function - CASE expression is ANSI SQL Statement - DECODE is specific to Oracle Syntax - CASE syntax contains WHEN and THEN  - DECODE will not have this - CASE allow expressions or Scalar Sub query Expressions inside the CASE statement - DECODE won't allow expressions inside the DECODE function

INDEX Definition

In Oracle, an  INDEX  is a database object intended to improve the performance of  SELECT  queries. Indexes are created on table columns, and the index stores all the values of the column under index segments. If the  SELECT  query uses an indexed column in any of the  WHERE  conditions, the query uses the index segment instead of performing a full table scan. This results in enhanced query performance.

The Oracle Server

The Oracle Server consists of an Oracle instance and an Oracle database. Oracle instance : Is a means to access an Oracle database. Its Always opens one and only one database. An Oracle instance is the combination of the background processes and memory structures. The instance must be started to access the data in the database. Every time an instance is started, a system global area (SGA) is allocated and Oracle background processes are started.The SGA is a memory area used to store database information that is shared by database processes. Oracle database : An Oracle database is a collection of data that is treated as a unit. The general purpose of a database is to store and retrieve related information. The database has a logical structure and a physical structure. The physical structure of the database is the set of operating system files in the database.

Capabilities of SQL SELECT Statements

A SELECT statement retrieves information from the database. You can do the following: Projection: You can use the projection capability in SQL to choose the columns in a table that you want returned by your query. You can choose as few or as many columns of the table as you require. Selection: You can use the selection capability in SQL to choose the rows in a table that you want returned by a query. You can use various criteria to restrict the rows that you see. Joining: You can use the join capability in SQL to bring together data that is stored in different tables by creating a link between them. Here Link is nothing but joining tables.

SQL Statements

Data retrieval SELECT Data manipulation language (DML) INSERT UPDATE DELETE MERGE Data definition language (DDL) CREATE ALTER DROP RENAME TRUNCATE Transaction control COMMIT ROLLBACK SAVEPOINT Data control language (DCL) GRANT REVOKE

Communicating with a RDBMS Using SQL

What is SQL? SQL Stands for Structured Query Language. I t is the  international  standard language for relational database management systems. It is useful for  accessing and manipulating data in a databases.  To access the database, you execute a structured query language (SQL) statement, which is the American National Standards Institute (ANSI) standard language for operating relational databases.

Definition of a Relational Database?

A relational database is a collection of relations or two-dimensional tables. For example, you might want to store information about all the employees in your company. In a relational database, you create several tables to store different pieces of information about your employees, such as an employee table, a department table, and a salary table.

Oracle Forms Developer - Code Location

This column has focused on where and how to define code in Oracle Database, but the same rules and logic apply to the Oracle Developer environment. I suggest these guidelines: If your program could be useful on both the server side and the client side, move it to the server, because it can be invoked from both sides there. If the program is used only in and relevant to client-side modules (it may, for example, manipulate the contents of a field in a form) and you think or know that it will be useful in more than one module, put it into a shared library. If your client program is very specific to a current form or report, define it within that module.

Understanding the User Requirements to Create Better Reports

In the first stage of the development, you determine what the user needs and expects. While it may be tempting to skip this stage and start building right away, it is not a good idea to do so. Without a clear understanding of the users and their reporting needs, it is virtually impossible to create effective enterprise reports. To define user requirements: 1) Gather relevant policies, business rules, and existing documentation 2) Observe users and their daily job activities 3) Interview a wide variety of users Helpful questions to help you determine the user requirements: 1) What data will people want, and in what priority? 2) How is the data stored? 3) Is there a corporate standard that must be met? If so, define standard templates. 4) Will users want Web reports, paper reports, or both? 5) For Web reports, will the reports be static or dynamic? 6) Will users want charts in the report? If so, what data will be used in the graph? 7) Will users want to drill down on da...

Selecting from the DUAL Table

DUAL is a table automatically created by Oracle along with the data dictionary. DUAL is in the schema of the user SYS, but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value ’X’. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once. Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table