代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
PLSQL
】
多表连接查询,更新存储过程
作者:
Dezai.CN
/ 发布于
2011/7/22
/
945
<div>Oracel存储过程 <span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)">.查询数据的存储过程 </span><span style="color: rgb(0,0,255)">PROCEDURE</span><span style="color: rgb(0,0,0)"> GetEvent(SCSWId </span><span style="color: rgb(128,128,128)">IN</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">VARCHAR2</span><span style="color: rgb(0,0,0)">, FromDate </span><span style="color: rgb(128,128,128)">IN</span><span style="color: rgb(0,0,0)"> DATE, ToDate </span><span style="color: rgb(128,128,128)">IN</span><span style="color: rgb(0,0,0)"> DATE, refOut OUT refcursor) </span><span style="color: rgb(0,0,255)">IS</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">BEGIN</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">OPEN</span><span style="color: rgb(0,0,0)"> refOut </span><span style="color: rgb(0,0,255)">FOR</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">select</span><span style="color: rgb(0,0,0)"> NOTES.NOTE_ID, NOTES.NOTE, SCSW_CALENDAR.DATE_TIME </span><span style="color: rgb(0,0,255)">from</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> NOTES </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR.NOTE_ID</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">notes.note_id </span><span style="color: rgb(0,0,255)">where</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR.SCSW_ID </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> SCSWId </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR.DATE_TIME </span><span style="color: rgb(128,128,128)">>=</span><span style="color: rgb(0,0,0)"> FromDate </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR.DATE_TIME </span><span style="color: rgb(128,128,128)"><</span><span style="color: rgb(0,0,0)"> ToDate </span><span style="color: rgb(0,0,255)">order</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">by</span><span style="color: rgb(0,0,0)"> SCSW_CALENDAR.DATE_TIME; </span><span style="color: rgb(0,0,255)">END</span><span style="color: rgb(0,0,0)"> GetEvent; </span><span style="color: rgb(128,0,0); font-weight: bold">2</span><span style="color: rgb(0,0,0)">.更新数据的存储过程: </span><span style="color: rgb(0,0,255)">procedure</span><span style="color: rgb(0,0,0)"> UpdateArticlesubmodel ( ArticleSubID </span><span style="color: rgb(0,0,255)">number</span><span style="color: rgb(0,0,0)">, ArticleTitle nvarchar2, ArticleKeyWord nvarchar2, ArticleContent CLOB, CreatePerson nvarchar2, ChangeDate date, SetTop </span><span style="color: rgb(0,0,255)">number</span><span style="color: rgb(0,0,0)">, ArticleSubStyleID </span><span style="color: rgb(0,0,255)">number</span><span style="color: rgb(0,0,0)">, Checked </span><span style="color: rgb(0,0,255)">number</span><span style="color: rgb(0,0,0)"> ) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">begin</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">update</span><span style="color: rgb(0,0,0)"> "ArticleSubModel" </span><span style="color: rgb(0,0,255)">set</span><span style="color: rgb(0,0,0)"> "ArticleTitle"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleTitle, "ArticleKeyWord"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleKeyWord, "ArticleContent"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleContent, "CreatePerson"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">CreatePerson, "CreateDate"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ChangeDate, "SetTop"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">SetTop, "ArticleSubStyleID"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleSubStyleID, "Checked"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">Checked </span><span style="color: rgb(0,0,255)">where</span><span style="color: rgb(0,0,0)"> "ArticleSubID"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleSubID; </span><span style="color: rgb(0,0,255)">commit</span><span style="color: rgb(0,0,0)">; Exception </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> others </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">rollback</span><span style="color: rgb(0,0,0)">; </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)"> UpdateArticlesubmodel; </span><span style="color: rgb(128,0,0); font-weight: bold">3</span><span style="color: rgb(0,0,0)">.删除数据的存储过程 </span><span style="color: rgb(0,0,255)">procedure</span><span style="color: rgb(0,0,0)"> DeleteArticlesubmodel ( ArticleSubID </span><span style="color: rgb(0,0,255)">number</span><span style="color: rgb(0,0,0)"> ) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">begin</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">delete</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">from</span><span style="color: rgb(0,0,0)"> "ArticleSubAccessories" </span><span style="color: rgb(0,0,255)">where</span><span style="color: rgb(0,0,0)"> "ArticleSubID"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleSubID; </span><span style="color: rgb(0,0,255)">delete</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">from</span><span style="color: rgb(0,0,0)"> "ArticleSubModel" </span><span style="color: rgb(0,0,255)">where</span><span style="color: rgb(0,0,0)"> "ArticleSubID"</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">ArticleSubID; </span><span style="color: rgb(0,0,255)">commit</span><span style="color: rgb(0,0,0)">; Exception </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> others </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">rollback</span><span style="color: rgb(0,0,0)">; </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)"> DeleteArticlesubmodel;</span></div>
试试其它关键字
同语言下
.
查看某张表的表结构
.
oracle 集合操作
.
for 循环中倒序 用reverse
.
Oracle 临时表空间收缩
.
查看session及其对应运行的sql
.
Oracle常用查看表结构命令
.
Oracle Connect By Prior用法(实现递归查询)
.
重置排序 SEQUENCE
.
创建一个trigger
.
批量替换字段中的字符
可能有用的
.
查看某张表的表结构
.
oracle 集合操作
.
for 循环中倒序 用reverse
.
Oracle 临时表空间收缩
.
查看session及其对应运行的sql
.
Oracle常用查看表结构命令
.
Oracle Connect By Prior用法(实现递归查询)
.
重置排序 SEQUENCE
.
创建一个trigger
.
批量替换字段中的字符
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3