[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: OpenLDAP+Oracle10g
ZhangPu wrote:
Hello
A question about the procedure "set_person_name" of the testdata_metadata.sql
for Oracle.
Default, it was written as:
---------
CREATE OR REPLACE PROCEDURE set_person_name(keyval IN NUMBER, new_name IN varchar2) AS
BEGIN
UPDATE persons SET name=new_name WHERE id=keyval;
END;
/
---------
* What does this "new_name" mean?
It seemed like "new_name" does not exist in the tables which has been
created by the backsql_create.sql and testdb_create.sql or any back-sql
source.
Is it a internal identifier of Oracle itself?
Almost I don't know Oracle internal tables (for example, dual) clearly.
I guess it's the name of the parameter that is passed to the procedure;
the procedure is supposed to update table "persons", which is created in
"testdb_create.sql", setting the value of "new_name" in column "name" in
the row whose column "id" is set to "keyval", the first parameter of the
procedure. As you can see, the argument sequence is the opposite of a
regular update statement:
a)
set_person_name( keyval, new_name);
vs.
b)
update persons set name=new_name where id=keyval;
To allow both syntaxes, whenever appropriate, the "param_order" field is
available. That parameter is a bitmask: 0x1 refers to the "add_proc",
and 0x2 refers to "delete_proc". If defined, it indicates that the form
(a) is in use, i.e. the "keyval" comes first in the parameter sequence.
I suggest you refer to Oracle's documentation for details about stored
procedures; in detail, I cannot confirm the above procedure is correct
because I'm not familiar with Oracle.
p.
SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497