Oracle Database Array Operation example, oracle Database example
1. Create a bean object
1 -- CREATE bean object 2 create or replace type "fm_flowcphdtswjimpbean" as object3 (4 wf_no varchar2 (256), 5 wf_priority_level varchar2 (256) 6)
2. Create a bean-based array
1 -- CREATE a bean-based array 2 create or replace type "FM_FLOWCPHDTSWJJIMPARRAY" is table of FM_FLOWCPHDTSWJJIMPBEAN
3. Implementation of Stored Procedures
1 -- Implementation of stored procedures 2 procedure fm_cphd_updatewjjpllist (import_data FM_FLOWCPHDTSWJJIMPARRAY) IS 3 v_bean FM_FLOWCPHDTSWJJIMPBEAN; 4 BEGIN 5 for I in import_data.first .. import_data.last loop 6 v_bean: = import_data (I); 7 update fm_flow_cphd_ts_wjj t 8 set t. wf_priority_level = (select value 9 from fm_flow_pz_combo10 where pz_id = 7111 and name = Hangzhou) 12 where wf_id = 13 (select wf_id from fm_flow_bill where wf_no = v_bean.wf_no); 14 end loop; 15 END fm_cphd_updatewjjpllist;
How to Use arrays in oracle stored procedures? An example of successful debugging is provided.
Oracle is a powerful database that can use Arrays
In oracle, arrays are mainly used to store batch data and insert, update, and delete databases at a time.
The following is an example of batch insert.
Here is an example on my blog. Let's take a look.
Zhuwei511.blog.sohu.com/
How to obtain operation logs for users of interest in oracle Database
Chinese typing is too slow, so you can answer the question in English.
The answer by the first respondent is totally wrong. ARCHIVELOG/NONARCHIVELOG has nothing to do with what you ask. ARCHIVELOG/NONARCHIVELOG is about the recoverbility of the database, but what you want is "Auditing" in Oracle, which is about monitoring users 'activities in database.
The auditing mechanism for Oracle is extremely flexible, so I'll only talk about fully auditing on a single user.
1. Database server setup
To allow auditing on the server you must:
Set "audit_trail = true" in the init. ora file.
Run the $ ORACLE_HOME/rdbms/admin/cataudit. SQL script while connected as SYS.
2. Audit Options
Assuming that the "AAA" user is to be audited:
CONNECT sys/password AS SYSDBA
Audit all by aaa by access;
Audit select table, update table, insert table, delete table by aaa by access;
Audit execute procedure by aaa by access;
These options audit all DDL and DML issued by "AAA", along with some system events.
DDL (CREATE, ALTER & DROP of objects)
DML (insert update, DELETE, SELECT, EXECUTE ).
System events (LOGON, LOGOFF etc .)
3. View Audit Trail
The audit trail is stored in the SYS. AUD $ table. It's contents can be viewed directly or via the following views:
DBA_AUDIT_EXISTS
DBA_AUDIT_OBJECT
DBA_AUDIT_SESSION
DBA_AUDIT_STATEMENT
DBA_AUDIT_TRAIL
DBA_OBJ_AUDIT_OPTS
DBA_PRIV_AUDIT_OPTS
DBA_STMT_AUDIT_OPTS
The audit trail contains a lot of data, but t ...... The remaining full text>