易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 存储过程中应用事务的问题 - Oracle / 开发

SQL code:

CREATE OR REPLACE PROCEDURE usp_refreshTopN IS
BEGIN
--文档
INSERT INTO topnresource(resourceId,title,type,cover,brief,properUser,tag,clickAmount,createDate,topNCreateDate,organization,topnType)
SELECT A.* from (SELECT resourceid,title,type,cover,brief,properuser,tag,clickamount,createdate,sysdate,organization,2 from resources WHERE refer = 1 AND type = 1 ORDER BY createdate DESC) A WHERE ROWNUM<=20;
--旧的信息,从第11条到第20条
DELETE from topnresource tpr WHERE tpr.topnresourceid IN (SELECT b.topnresourceid from(SELECT rownum myno,a.topnresourceid from (SELECT * from topnresource ORDER BY createdate DESC) a) b WHERE myno>10 AND myno<=20) AND tpr.topntype=2;
--课程
INSERT INTO topnresource(resourceId,title,type,cover,brief,properUser,tag,clickAmount,createDate,topNCreateDate,organization,topnType)
SELECT A.* from (SELECT resourceid,title,type,cover,brief,properuser,tag,clickamount,createdate,sysdate,organization,1 from resources WHERE refer = 1 and type = 4 ORDER BY createdate DESC) A WHERE ROWNUM<=20;
--旧的信息,从第11条到第20条
DELETE from topnresource tpr WHERE tpr.topnresourceid IN (SELECT b.topnresourceid from(SELECT rownum myno,a.topnresourceid from (SELECT * from topnresource ORDER BY createdate DESC) a) b WHERE myno>10 AND myno<=20) AND tpr.topntype=1;

--社区热门文档
INSERT INTO topnresource(resour


相关问答:

Windows 7 怎样安装Oracle - Oracle / 基础和管理

各位大哥,帮个忙。

下个Oracle for vista 版本的安装试试
10G和11G的 
http://www.oracle.com/technology/software/products/database/index.html 
------------------------------------------- ......

oracle并发处理SOS - Oracle / 开发

我在开发的这个应用并发性比较高,oracle更新数据时候如何处理并发处理呢?各位大侠发表好的观点啊,在线等待!
oracle数据更新时,会自动默认行锁定,楼主不要操心,Oracle对并行处理已经很成熟了

引用
oracle ......

oracle 安装 01092 错误 - Oracle / 基础和管理

oracle 11g 安装 01092 错误,
日志信息:
[oracle@linux trace]$ vi alert_orcl.log 
MMON started with pid=14, OS id=9089
RESETLOGS after incomplete recovery UNTIL CHANGE 522752
Errors in file / ......

oracle 10g data guard - Oracle / 基础和管理

做玩data guard 后
在Primary服务器 执行 
SQL>SELECT SEQUENCE#,APPLIED from V$ARCHIVED_LOG ORDER BY SEQUENCE#;
 SEQUENCE# APP
---------- ---
  13 NO
  13 YES ......

一条 SQL - Oracle / 基础和管理

有这样一条SQL
 Select Get_Costtaxrate(col1), Get_Tcostvalue(col1) from a
 
其中Get_Costtaxrate、Get_Tcostvalue都是函数,这两个函数里面都是查找一个大表,Get_Tcostvalue还需要调用Get_C ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号