Florida,
So that you can compare Oracle
Procedure to Oracle
Functions, here is an example of an Oracle (PL/SQL)
Function that offers the same calculation support as the earlier "area_of_circle" procedure:
Code:
create or replace function circle_area (radius in number) return number is
begin
Return 3.14159 * (power(radius,2));
end;
/
Function created.
Notice the syntactical simplicity, not only of the function definition, above, but the invocation flexibility, below (which can now take the form of a non-procedural SQL SELECT statement):
Code:
select circle_area(7) from dual;
CIRCLE_AREA(7)
--------------
153.93791
1 row selected.
I typically prefer Oracle FUNCTIONS since I can use them with equal facility in both SQL statements and procedural PL/SQL blocks.
Now to your statement:
florida41 said:
I think of schema from my Access database experience as tables with relationships but not familiar with the user term?
In Oracle,
schema most significantly relates to
ownership. A schema can own tables, views, indexes, synonyms, procedures, functions, packages, triggers, sequences, clusters, database links, et cetera. For the schema to exist, an Oracle
User must exist by the same name as the schema. In the Oracle world, a
User and a
Schema are congruent and inextricable...You cannot have a schema without a user and vice versa.
To help you compare, these terms in Oracle to the same terms in other database engines, I'll try to distinguish the terms from non-Oracle database perspectives. In most other database environments, you create "logins" with passwords to allow people to connect to the database. Once a person connects to the database installation, they can access information from a variety of databases (provided they have been GRANTed permission to access the database), which live independently of any login. Those "databases" compare favourably with Oracle "schemas". (Recall that a non-Oracle "database" can own tables, views, functions, et cetera, just as can an Oracle schema.)
So, in the final analysis, Oracle "welds" into one unit the concept of "logins" (Oracle Users) and "databases" (Oracle Schemae). In Oracle, these concepts are one and the same; in non-Oracle environments, the concepts are independent and distinct.
Also, it is important to mention that the Oracle term, "database" refers to all of the Oracle USERS (schema) that reside within the data dictionary of a single Oracle Instance. So, what would be 20 "databases" in a Sybase, or MS SQL Server, or DB2, or MySQL installation would be 20 "Users" (or 20 "Schema") in a single Oracle "database".
For more background and insight on Oracle's database and instance
architecture, I suggest clicking on an earlier thread from last week, thread759-943578.
Let us know if you any follow-on questions.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
@ 20:31 (11Nov04) UTC (aka "GMT" and "Zulu"),
@ 13:31 (11Nov04) Mountain Time