You are on page 1of 15

Why Learn SQL?

Oracle Applications stores data in


an Oracle relational database
(RDBMS).
SQL is the language used to
interact with an Oracle database.
Super users are often asked to
run SQL commands by Oracle
Support, or use them to solve
problems.

SQL for End-Users


Jeannie Dobney

Agenda:
Background to using SQL for Applications users
How the underlying data structures relate to what you see on the screen with Oracle
Applications
Basic relational database concepts
Introducing the SQL language
Basic SELECT syntax
Using Logical operators
Single Row functions
Group Functions
Joining multiple tables
Sub-Queries
Brief overview of DML (Insert, Update and Delete)
Commit statements
Brief overview of DDL (Create, Alter, Drop and Truncate)
Brief overview of DCL (Grant and Revoke, System and object privileges)
Oracles Data Dictionary
Reports written in SQL*Plus

Page 1-1

Understanding eBusiness Suite Data Structures

SQL

Page 1-2

Understanding eBusiness Suite Data Structures

SQL

The Relational Database model

Database Tables

Journals table

ID

Name

Job

Salary

Dept

753

Jones

Sales

$25K

755

Brown

Mgr

$50K

757

Smith

Clerk

$15K

Primary Key:
Journal Header ID

Each journal consists


of one or more lines

Journal Lines

Foreign Key:
Journal Header ID

In a relational database, data is stored in two dimensional tables which are made up of rows
and columns.
Each column contains a particular type of data and each row contains a single record.
When database columns are created, the type of data they can contain is specified as either
character strings (VARCHAR2 or CHAR), numeric (NUMBER) or date/time values
(DATE). Size constraints can also be specified for most column data-types e.g.
VARCHAR2(15) stores alphanumeric data up to 15 characters.
Each record may be uniquely identified by a primary key a column made up of unique
value which allows individual records to be identified.
Links between tables are made by duplicating the value of a primary key in a related record.
The value in the related record is known as a foreign key.
Oracles type of database is called a relational database because of the way records are linked
via these related values.
This leads to a master-detail arrangement of data. Understanding this hierarchical
arrangement of data seems to be one of the key insights which new Applications users need
to really understand in order to work comfortably with Oracle Apps.
It is also possible to make specific columns mandatory when they are defined. This is done
by placing a not null constraint in their definition.
If a record does not populate an optional column the value in this field is called null. This is
an important concept which we will mention frequently. (The opposite to a null is a real
value i.e. a field which has been populated with some kind of data).
N.B. In reality some of Oracles Application tables do not have the sorts of constraints
which we might expect this is because some of this logic is enforced by the Forms front
end. The reason for this is so that Forms provides the user quicker feedback about errors they
have made, for example in attempting to duplicate a primary key value.

From a users point of view, database tables are organised in non-intuitive (master detail)
ways but the design is intended to reduce data redundancy and create efficient data access
(redundancy = storage duplication).

Page 1-3

Page 1-4

Understanding eBusiness Suite Data Structures

SQL

To present the user with the data in the way they expect, it is necessary to join the tables so
that a record in the parent table is linked to one in the child table where the key values
match. We will see exactly how this is done later in this course.
Oracles Technical Reference Manuals (TRMs) contain overview diagrams called ER
Diagrams (Entity Relationship Diagrams) which show data entities (tables) and their
relationships (primary / foreign keys).
The TRMs also describe each table including the size and type of data in each column.
Each Application has a Technical Reference Manual.
Oracles TRMs can be purchased from Oracle or accessed electronically through Metalink.
Most tables also contain a set of empty columns to enable the Descriptive Flexfields
feature. These columns are called ATTRIBUTE N (where N is a number).

Understanding eBusiness Suite Data Structures

SQL

Journals Window
Header Block / Region
Name

Status

Tables and Blocks

Tables and
Blocks

Category
Journals table

Source

Lines Block / Region


Line # Dr

Cr

Amt

Desc.
Journal Lines

The underlying tables are represented on the users screen using a tool called Forms, which
both paints the screens and manipulates the data.
Each table is represented by a block within a window. A block is a logical group of fields.
It may present the data as single records (as in the journal header block), or as a multi-record
block (as in the journal lines block).
The term block is used in some of the diagnostic tools, so it may be helpful to understand
it.

This is the actual Applications window represented diagrammatically in the previous slide.
It will now be clear that in this window the user is looking at data from two tables.
A Forms developer has written code which joins these tables so that when the user retrieves
a particular journal, they see the lines related to THAT journal, rather than some other
journal.
It also explains why when I put my cursor in one of journal lines and invoke the Find
Window, I get a different system response than if I have my cursor in one of the fields in the
journal header region.
To anthropomorphise this a little:

The next slide displays the window discussed above as an example.

If my cursor is in the journal header region and I invoke the find window, the system thinks:
aha, she wants to search for a particular journal.
If my cursor is in one of the lines, the system thinks: shes looking for a particular line in this
journal.

Page 1-5

Understanding eBusiness Suite Data Structures

SQL

Page 1-6

Understanding eBusiness Suite Data Structures

SQL

Which Table is Being


Accessed?

Where is it in the Schema of things?


PA
GL

AR
AP

PO

APPS

Data to and from users

Within Oracle Applications there are a number of helpful links to the underlying technology
components.

Within the database, there are product schemas (database user areas).

You will find these links in the Help menu.

For every application which is installed, you will have a schema which stores its data, for
example GL, AP, PA, etc

Help ~ Record History tells you not only which user created the record (the so-called Row
Who data written transparently with each record) but also the name of the table from which
the data is drawn.

The GL schema contains all the tables, views and other database objects belonging to the
General Ledger Application.

Help ~ Diagnostics ~ Examine provides access to values hidden from the user. These include
foreign keys and codes represented by different display values.
Help ~ About Oracle Applications includes version and path information.
You must have a password to use some of these tools your DBA can provide this to you.

The Apps Schema has access to the complete Oracle Applications data model. It consists
mainly of PL/SQL logic rather than storage (in packaged procedures and views). Much of
this logic is there to enable Oracles Multi-Org technology.
Since the advent of Multi-Org technology all users write to the various tables in GL, AP etc
through procedures stored in the APPS schema, which ensures that new records are tagged
with the organisation ID linked to that user (usually through a profile option at Responsibility
level). In the same way when users retrieve data, the APPS schema filters the data so that
users only see the data relating to their organisation.
So the APPS schema is a sort of gate-keeper to the other schemas.
In this way, Multi-Org technology allows multiple organisations to secure data within a
single database.
It is supported by an ORG_ID column on tables and an MO:Operating Unit profile option for
each Responsibility (which creates an implicit where clause linking the users organisation
only with records which have the appropriate Org_ID value).

Page 1-7

Understanding eBusiness Suite Data Structures

SQL

Page 1-8

Understanding eBusiness Suite Data Structures

SQL

SQL is the language used to add, modify


and remove data from the database.
SQL is an English-like programming
language i.e. relatively easy to read (for
example in Applications log files).
It consists of a number of clauses
structured around some key verbs:

Introducing the Sample Data


Emp table
Foreign Key:
DeptNo

Primary Key:
EmpNo

Dept table

Select - to read or retrieve data


Insert - to create a new record
Update - to modify an existing record
Delete - to remove a record from a table.

Primary Key:
DeptNo

SQL is a standardised language used by all relational databases.

This set up script for this data is shipped with every Oracle database.

The SQL acronym stands for Structured Query Language and is pronounced sequel.

It might seem simplistic, however it gives you an easy environment in which to learn the
skills which you can subsequently use with large volumes of data in the Applications
environment.

Oracles version complies with the international (ANSI) standard and is only marginally
different to that of other vendors (like Microsofts SQLServer or IBMs DB2).
SQL commands are not case sensitive.

The sample data is reproduced on the final page of this document.

As a general principle, users should never attempt to update the database directly using SQL.
Updating the database directly (rather than through the Applications) can seriously damage
the integrity of your data and invalidate your support contract.
SQL commands are typically issued from a utility like Oracles SQL Plus tool or Quests
TOAD.
Both these tools require client-side set-up (i.e. installation on you PC) before you can use
them.
For both tools you will also need a database user name and password from your DBA. You
cannot use your Applications login here.

Page 1-9

Understanding eBusiness Suite Data Structures

SQL

Page 1-10

Understanding eBusiness Suite Data Structures

SQL

Simple SELECT Statements

Two more SELECT clauses

Select * from emp;


Select *
from emp;
Select ename from emp;
Select ename, sal from emp;
Select dname from dept
/
Select dname Department from dept;

Select * from emp


where job = CLERK;
Select * from emp
where sal < 1500;
Select * from emp
order by ename;
Select * from emp
order by sal desc;
Select deptno, ename, sal
from emp
order by 1, 3;

The verb SELECT allows us to retrieve or read data from a table.

Two more clauses are introduced here:


The where clause which restricts which rows are retrieved and displayed.

Two clauses are introduced here:

The order by clause which sorts the display of data.

The select list which specifies the columns to be displayed.


The from clause which specifies which table the data is in.
It makes no difference whether you type your commands on one or more lines; by convention
each clause is started on a new line.
An asterisk (pronounced star) in the select list means all columns.
If you are selecting more than one column by name, separate them with commas (except for
the last column).
A word following a column name without an intervening comma is interpreted as a column
alias and will be used as the heading for that column in the data output i.e.
SELECT col_name1, col_name2 changed_name, col_name3, etc.
If you are accessing more than one table, commas should also separate the table list. You
may also alias table names, but having done so, every table reference in the statement must
use the alias.

To use the where clause to restrict rows, you must use a logical condition (more about logical
operators in the next slide).
Dates and alphanumeric literals (so-called character data) must be enclosed in single quotes
and are case sensitive.
Default date format is DD-MON-YY
A select statement without a where clause will retrieve all of the records in the table.
By default the order by clause sorts the output in an ascending sequence, you can change this
by using the DESC qualifier as shown.
The numbers in the final statement in the above slide are a short-hand way of referring to the
columns in the select list.
You can sort by columns which you do not display (i.e. are not in your select list).

To execute the command you use either a semi-colon on the final command line or a forward
slash on the following line.

Page 1-11

Understanding eBusiness Suite Data Structures

SQL

Page 1-12

Understanding eBusiness Suite Data Structures

SQL

Negative Conditions

Logical Operators

Not equal to: <> or !=


e.g. where source != PAYABLES
NOT IN or
NOT BETWEEN or
NOT LIKE
IS NOT NULL

>, <, >=, <= (greater than, less than


etc)
IN (X, Y, Z) i.e. list operator
BETWEEN X and Y i.e. range
operator
LIKE character pattern
including wildcards % and _
IS NULL to identify null values

In the example on the previous slide the Where clause restricts the data retrieved based on a
strict matching of values to a single literal value.

Negative conditions may be formed using the keyword NOT


e.g. where balance is not null
or symbolically
e.g. where source != PAYABLES

Other operators which could be used here include the following:


Comparison symbols for greater than, less than, greater than or equal to etc, e.g. Col_name
<= 30
Membership of a given list of values e.g. col_name IN (Q1, Q2, Q3)

To negate comparison operators, use the opposite symbol.


For example if the condition is value > 30,
the negation is value <= 30

Within a specified range e.g. col_name between N and M.


Matching a pattern using wildcards, % for any number of characters, _ for one character
e.g. Period_name LIKE JAN% would find all January periods,
but Period_name LIKE J_N-01 would find both January and June 2001
IS NULL finds row with null values e.g where end_date is null retrieves all currently active
records.

Page 1-13

Understanding eBusiness Suite Data Structures

SQL

Page 1-14

Understanding eBusiness Suite Data Structures

SQL

Introducing Functions

Other Tricks

NVL (col, alternative)


substitute value to replace null values
Example:
Select ename, sal, sal*12+com Package
from emp;
Now try:
Select ename, sal, sal*12+nvl(com,0) pkg
from emp;

Arithmetic e.g. Date_column + 7


(using + - * / )
Concatenation and the use of literals
e.g. Hello ||emp_name
Logical combinations: AND, OR
(use parenthesis to ensure execution
order)
Select distinct job from emp;

Other tricks which can be used in Select statements include the following:

Functions are mini-programs which can be applied to column values to manipulate them.

Simple arithmetic e.g. Date_column + 7 (i.e. a week after the recorded date)
Multiplication and division have precedence over addition and subtraction.
Use parenthesis to enforce execution order.
Nulls will cause very strange results well see how to handle them in a moment.

The NVL function may be one of the most important functions for Applications users.

Concatenation e.g. Number ||ID_column (i.e. this adds the word number to every ID
value retrieved)

A column value which has not been populated for a particular record is said to contain a null
value.

The logical operators AND and OR may be used to combine operators, e.g
where period_name = JAN-01 or period_name = FEB-01
Remember to use parenthesis to control the order in which such statements are evaluated
otherwise AND takes precedence over OR

Null values produce unexpected results when they are involved in arithmetic.

The keyword DISTINCT removes duplicate values


for example Select distinct period_name from GL_JE_Batches
lists each period in which Journal batches exist but regardless of how many batches exist for
that period, the period is displayed only once.

NVL allows null values to be replaced in ways that produce sensible results.

The syntax is NVL(col, alt) where col is the column or value to be evaluated and alt is the
value to substitute in if a null is found in col.

For example:
1,000 + null = null.
For example:
1,000 + NVL(null, 0) = 1,000
NVL only replaces nulls, it will not affect real values.

Page 1-15

Understanding eBusiness Suite Data Structures

SQL

Page 1-16

Understanding eBusiness Suite Data Structures

SQL

Some Other Examples of Functions

Some More Character Functions

InitCap (col) - converts text to title case


Lower (col) - converts text to lower case
Length (col) - returns the length of a string
Lpad (col, length, char) - makes a string a
specified length by adding characters
Rtrim (col, chars) - trims unwanted characters
from the right end of a string
Instr (col, char, start, num) - searches through a
string for a set of characters

TO_CHAR (col) forces the value to be read


or stored as a character string
ROUND(number, 2) round the value to 2
decimal places
UPPER (col) forces the value to upper case
SUBSTR (col, m,n) string operator allowing
a portion of a character string to be selected
or removed (from m char to nth char).

Functions are classified according to the type of data which they are used with: Number,
Date, Character or Conversion functions.
TO_CHAR is an example of a conversion function. Similar functions exist for the other datatypes as well (To_Number, To_Date). They can also be used for some kinds of formatting.
ROUND is an example of a function which manipulates numbers.
UPPER is an example of a function which manipulates character strings.
SUBSTR is am example of a string operator (also called a character function).
These functions return values for each row passed to them, so they are called single row
functions; later we will meet functions which produce one result for a group of rows.
Functions can also be nested in which case the innermost function executes first out to
the outermost function.

Page 1-17

Understanding eBusiness Suite Data Structures

SQL

Page 1-18

Understanding eBusiness Suite Data Structures

SQL

Some Date Functions


Add_Months ( Date_value, Num) adds the
number of months to the original date
Next_day (Date_value, Day) returns the
next e.g. FRIDAY after the original date
Months_Between (Date2, Date1) returns
the number of months between the dates
Last_day (date-value) returns last day of
the month in which the original date was in
Trunc (date) removes time portion of date

Some More Number Functions

Ceil (value) returns the smallest integer


larger than or equal to the value
Floor (value) returns the largest integer
larger than or equal to the value
Power (value, exponent) raises the value
to the specified exponent
Sign (value) returns 1 if value is positive,
-1 if the value is negative and 0 if zero

Note that logical operations including dates can be complicated by the time portion which is
invisible by default. This makes the TRUNC or ROUND functions valuable because you can
effectively remove the time component from a logical operation.

N.B. the Sign function can be useful in determining which values are larger.
For example Sign (Col_A Col_B) will return +1 if Col_B is less than Col_A

Page 1-19

Understanding eBusiness Suite Data Structures

SQL

Page 1-20

Understanding eBusiness Suite Data Structures

SQL

Date Conversion Example

The Power of Decode

Statement:
Select to_char (sysdate,
'fmDay ddth "of" Month YYYY') today
from dual

DECODE(col, if_value, then_value,


else_value)
Example:
select distinct decode (actual_flag,
'A', 'Actual',
'B', 'Budget',
'Encumbrances')
from GL_je_headers;

Output:
TODAY
-------------------------------Monday 16th of April 2007
This example shows the flexibility and power of Oracles functions.

DECODE is a powerful if-then-else replacement operator.

Sysdate is the system date stored by the system.


These sorts of values are called pseudo-columns, because you can manipulate them like data
in columns.

The example above shows the power of the decode function.


In the example the single letter flag is displayed using a whole word which would be more
meaningful to the user.

Dual is a dummy table which allows operations like this one i.e. where the structure of the
select statement requires a from clause even though the required result is not found in a
table.

Clever developers can use the decode functions in some very interesting ways.

In this case the To_Char function takes 2 arguments or inputs: the date it is to manipulate
and the mask which tells the system how to display the information. The mask is made up
of tokens. You can see a complete list of these tokens and all the arguments accepted by
Oracle functions in the SQL Language reference manuals supplied by Oracle as part of their
database server documentation (or available in softcopy form Oracles OTN Technet).

The syntax is: DECODE (expr, search, result [, search, result...] [,default])
Where expr is the expression (column or value) being evaluated
and search is the value to find
and result is the value to replace it with
(you may have as many search and result pairs as you require
and default is the value to output if the expression contains none of the specified search
values

Page 1-21

Page 1-22

Understanding eBusiness Suite Data Structures

SQL

Understanding eBusiness Suite Data Structures

SQL

Joining Tables

Group Functions

To retrieve related values from master / detail


tables join them by using the Where Clause to
specify a match on primary / foreign key.
For example:
Select Account_code, Vendor_Name
from AP_Invoices_All,
AP_Invoice_Distributions_All
where AP_Invoices_All.Invoice_ID =
AP_Invoice_Distributions_All.Invoice_ID
and Invoice_date =01-FEB-01

Group functions operate on a set of rows


to give one result per group:
MIN, MAX, AVG, SUM, COUNT etc
Use the GROUP BY clause to subdivide
rows into sub-groups. For example:
Select AVG (Invoice_amount)
from AP_Invoices_all
group by org_ID;

In contrast to the previous functions which return one result for each row evaluated, group
functions produce one result for set of rows.

If joining N tables, at least N - 1 join conditions must be specified. Omitting the join when
referencing more than one table creates a Cartesian Product i.e. invalid results

In general they are used to produce aggregate results.

To avoid ambiguous column references, column names such as Invoice_ID above must be
prefixed with a table reference (because a column of the same name exists in both columns
e.g. emp.deptno).

When using group functions, the select list may only contain columns which are subject to a
group function e.g. sum(col) or those columns which are listed in the group by clause.
Use the Where Clause to exclude rows from your groups. You cannot use group functions to
create conditions in the where clause.

It is in fact good practice to preface all column names with their table names this makes it
easier for the database to parse the statement. To simplify such statements it is therefore
advisable to add short table aliases.

Use the Having Clause to remove a group based on a group characteristic, for example the
following statement excludes any organisations which have had less than 500 invoices :

The example above is actually over simplified:


Only the Vendor_ID is stored in AP_INVOICES_ALL, so another join is required to display
the vendor name.

Select AVG(Invoice_amount)
from AP_Invoices_all
group by org_ID
having count(org_ID) > 500;

Only the Code Combination ID is stored in AP_INVOICE_DISTRIBUTIONS_ALL


so that foreign key must be joined to GL_Code_Combinations to obtain the account code
itself.

Group functions handle null values in the way you would expect i.e. they ignore them

As you can see this makes real-life SQL statements quite long and difficult to write; an
example showing the actual statement required to achieve these results is given on the next
page. The process which a Developer would use to research the details is also explained.

Page 1-23

Understanding eBusiness Suite Data Structures

SQL

Page 1-24

Understanding eBusiness Suite Data Structures

SQL

Join
Example

PO_Vendors

Accounts Payable Data Structures

Supplier Name

AP_Invoices_All

Vendor_ID

AP_Invoices_Distributions_All

CC_ID

GL_Code_Combinations

Account Code

2 primary clusters of tables:


Invoices:
AP_INVOICES_ALL
AP_INVOICE_DISTRIBUTIONS_ALL
AP_PAYMENT_SCHEDULES_ALL
Payments:
AP_CHECKS_ALL
AP_INVOICE_PAYMENTS_ALL
AP_PAYMENT_HISTORY_ALL

Actual Statement:
select vendor_name, c.segment1||'.'||c.segment2||'.'||c.segment3||'.'||c.segment4||'.'||c.segment5
account_code
from PO_vendors V,
AP_Invoices_All I,
AP_Invoice_Distributions_All D,
GL_Code_Combinations C
where i.Invoice_ID = d.Invoice_ID
and i.vendor_id = v.vendor_id
and d.dist_code_combination_id = c.code_combination_id

Page 1-25

ACCOUNT_CODE
------------------------01.420.7410.0000.000.

Understanding eBusiness Suite Data Structures

In this slide, the major tables supporting the Accounts Payable functionality are displayed,
however, this display does make it look somewhat simpler than it in fact is
For example, in the AP_INVOICES_ALL table the Supplier name value which the user sees
on the Applications screen, has to be retrieved by the developer from the PO_VENDORS
table by joining on the Vendor_ID (code). Similarly the Invoice Distributions table does not
contain the account code which the user sees it only contains an ID (foreign key) pointing
to where the account code is really stored.
This account code ID is called the CC_ID or Code Combination ID and it must be joined to
the GL_CODE_COMBINATIONS table in order to retrieve the code which the user is used
to seeing.

Output:
VENDOR_NAME
------------------------Building Management Inc.

Developers unfamiliar with a particular module will need to invest some time and effort to
become familiar with its tables.

The tables are all quite large and the data will not be meaningful to the developers in the
same way which it is to the business user thus the ideal development methodology for
modifications involves close collaboration between a business user and a developer.

SQL

Page 1-26

Understanding eBusiness Suite Data Structures

SQL

Sub-Queries

Other Useful Tips

One SQL Select statement may be


nested within another:
select invoice_num, invoice_date
from AP_invoices_all
where vendor_id =
(select vendor_id from PO_vendors
where vendor_name like 'Building%')
The nested query (sub-query) executes
first.

Pseudo-columns like RowNum can be


very helpful:
Select * from Huge_Table
where RowNum < 100;
limits the data retrieved to 99 rows

Sub-Queries are a very powerful tool for solving more difficult data retrieval problems.
If you are reviewing SQL scripts written by applications developers you are likely to see such
statements. They are easier to read if you remember that they are executed sequentially: the
most deeply nested statement executes first and then passes its results to the next most
deeply nested statement etc.)

Note that RowNum cannot be used meaningfully in conjunction with an order by clause as it
limits the rows retrieved before they are sorted.

If need be, use a highlighter to identify each sub-query and read them as if they were
executing sequentially from the most deeply nested statement, remembering that the nested
statement passes its results to the statement in which it is nested.

Page 1-27

Understanding eBusiness Suite Data Structures

SQL

Page 1-28

Understanding eBusiness Suite Data Structures

SQL

Sample Data
Emp Table
EMPNO
7369
7499
7521
7566
7654
7698
7782
7788
7839
7844
7876
7900
7902
7934

The Data Dictionary

USER_views = your own schema,


ALL_views = everything you have access to
DBA_views = everything
Desc DICT a good starting point
Example:
Select table_name from all_tables
where table_name like %PROJECT%;

ENAME
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
MILLER

JOB
CLERK
SALESMAN
SALESMAN
MANAGER
SALESMAN
MANAGER
MANAGER
ANALYST
PRESIDENT
SALESMAN
CLERK
CLERK
ANALYST
CLERK

MGR
7902
7698
7698
7839
7698
7839
7839
7566
7698
7788
7698
7566
7782

HIREDATE
13-JUN-83
15-AUG-83
26-MAR-84
31-OCT-83
05-DEC-83
11-JUN-84
14-MAY-84
05-MAR-84
09-JUL-84
04-JUN-84
04-JUN-84
23-JUL-84
05-DEC-83
21-NOV-83

SAL
800
1600
1250
2975
1250
2850
2450
3000
5000
1500
1100
950
3000
1300

COMM
300
500
1400

DEPTNO
20
30
30
20
30
30
10
20
10
30
20
30
20
10

Dept Table
DEPTNO
10
20
30
40

Oracle maintains its own list of which objects exist in the database. This is called the data
dictionary (dict).
You can use standard SQL commands to find out information about various objects.

DNAME
ACCOUNTING
RESEARCH
SALES
OPERATIONS

LOC
NEW YORK
DALLAS
CHICAGO
BOSTON

There are three classes of views (pseudo tables) which you can query, they have the prefixes
USER_xxx, ALL_xxx and DBA_xxx
For most of us the ALL_xxx views will probably be the most useful as they contain
information about all the objects which you can access.
Here are some examples:
Select text from ALL_VIEWS
Where view_name = AP_INVOICES;

If you are looking for a reference book, we recommend Oracle N: the Complete Reference by
Kevin Loney and George Koch (where N is the current version i.e. 8i, 9i, 10g etc)

Select table_name from ALL_TABLES


Where table_name like %USER%;

You can also download Oracle documentation without charge from Oracles OTN site
(http://otn.oracle.com.index.html) although you may find it a little daunting to begin with.

The Describe command (also Desc) will list the columns / structure of any specified table e.g.
Desc GL_JE_Headers
This command does not need a semi-colon to execute it.

There are also excellent resources available via Google

Page 1-29

Page 1-30

Understanding eBusiness Suite Data Structures

SQL

The author can be contacted via email at jdobney@bigpond.com

Understanding eBusiness Suite Data Structures

SQL

You might also like