程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> oracle數據庫之數組的操作樣例,oracle數據庫樣例

oracle數據庫之數組的操作樣例,oracle數據庫樣例

編輯:Oracle教程

oracle數據庫之數組的操作樣例,oracle數據庫樣例


1.創建bean對象

1 --創建bean對象
2 CREATE OR REPLACE TYPE "FM_FLOWCPHDTSWJJIMPBEAN"    as object
3 (
4   wf_no varchar2(256),
5   wf_priority_level varchar2(256)
6 )

2.創建基於bean的數組

1 --創建基於bean的數組
2 CREATE OR REPLACE TYPE "FM_FLOWCPHDTSWJJIMPARRAY"  is table of FM_FLOWCPHDTSWJJIMPBEAN

3.存儲過程的實現

 1 --存儲過程的實現
 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_combo
10                                      where pz_id = 71
11                                        and name = v_bean.wf_priority_level)
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;

oracle 存儲過程中怎使用數組,給一個可以調試成功的例子

oracle這麼強大的數據庫能使用數組的
在oracle中,數組主要是用來存儲批量數據,一次性的對數據庫進行插入,更新,刪除操作。
下面給你一個批量插入的例子,其他都類似的
這是我的blog上面有例子,你自己看看吧。
zhuwei511.blog.sohu.com/
 

oracle 數據庫中怎獲得對所關注用戶的操作日志

中文打字太慢,所以就用英文回答。

The answer by the first respondent is totally wrong. ARCHIVELOG/NONARCHIVELOG has nothing to do with what you ask for. 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 performing full 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......余下全文>>
 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved