Oracle Stored Procedure demo
1.how to find invalid status stored procedure and recompile them?
SELECT OBJECT_NAME , status FROM user_objects WHERE OBJECT_TYPE = 'PROCEDURE';
Alter procedure schme.procedurename compile;
缺少练习的学习不是完整的学习,练习才是学习,总结才有思考。
SELECT OBJECT_NAME , STATUS FROM USER_OBJECTS WHERE OBJECT_TYPE = 'PROCEDURE'; ---sample table test(id integer,name varchar2)
CREATE OR REPLACE PROCEDURE testsp(v_msg VARCHAR2)
AS
BEGIN
DBMS_OUTPUT.PUT_LINE(v_msg);
END testsp; ALTER PROCEDURE TESTSP COMPILE; SET SERVEROUTPUT ON;
EXEC testsp('oracle stored procedure');
EXEC testsp('hua xiao yao'); CREATE OR REPLACE PROCEDURE procOneOutPara(v_msg VARCHAR2,v_out_p OUT varchar2)
AS
BEGIN
DBMS_OUTPUT.PUT_LINE(v_msg);
v_out_p :='execute success';
END procOneOutPara; declare
v_out_msg varchar2(100);
begin
procOneOutPara('hello java',v_out_msg);
dbms_output.put_line(v_out_msg);
end; CREATE OR REPLACE procedure procCursorReturn(v_id in integer ,outCursor OUT SYS_REFCURSOR )
AS
BEGIN
open outCursor for
select * from test where id = v_id;
exception
when others then
dbms_output.put_line('errors occurs');
rollback;
END procCursorReturn; DECLARE
testCursor SYS_REFCURSOR;
mytest test%ROWTYPE;
BEGIN
procCursorReturn(5,testCursor);
LOOP
FETCH testCursor INTO mytest;
EXIT WHEN testCursor%NOTFOUND;
dbms_output.put_line(mytest.name);
END LOOP;
CLOSE testCursor;
END;
Oracle Stored Procedure demo的更多相关文章
- csharp: Oracle Stored Procedure DAL using ODP.NET
paging : http://www.codeproject.com/Articles/44858/Custom-Paging-GridView-in-ASP-NET-Oracle https:// ...
- Get Resultset from Oracle Stored procedure
http://stackoverflow.com/questions/1170548/get-resultset-from-oracle-stored-procedure
- [转]Easy Stored Procedure Output Oracle Select
本文转自:http://www.oraclealchemist.com/oracle/easy-stored-procedure-output/ I answered a question on a ...
- [转]Dynamic SQL & Stored Procedure Usage in T-SQL
转自:http://www.sqlusa.com/bestpractices/training/scripts/dynamicsql/ Dynamic SQL & Stored Procedu ...
- [转]Oracle Stored Procedures Hello World Examples
本文转自:http://www.mkyong.com/oracle/oracle-stored-procedures-hello-world-examples/ List of quick examp ...
- [转]How to: Execute Oracle Stored Procedures Returning RefCursors
本文转自:http://www.telerik.com/help/openaccess-orm/openaccess-tasks-oracle-execute-sp-result-set.html I ...
- Entity Framework 6.0 Tutorials(9):Stored Procedure Mapping
Code First - Insert, Update, Delete Stored Procedure Mapping: Entity Framework 6 Code-First provides ...
- SQL Server 在多个数据库中创建同一个存储过程(Create Same Stored Procedure in All Databases)
一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 遇到的问题(Problems) 实现代码(SQL Codes) 方法一:拼接SQL: 方法二: ...
- Stored Procedure 里的 WITH RECOMPILE 到底是干麻的?
在 SQL Server 创建或修改「存储过程(stored procedure)」时,可加上 WITH RECOMPILE 选项,但多数文档或书籍都写得语焉不详,或只解释为「每次执行此存储过程时,都 ...
随机推荐
- 【循序渐进学Python】10.模块和包
1.导入模块 任何Python程序都可以作为模块导入,只要Python解释器能找到我们定义的模块所在位置即可,一般来讲,在一个模块被导入时,Python解释器会按照下面的步骤进行搜索: 在当前所在目录 ...
- C#十五子游戏
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解
[源码下载] 重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 通知 Toa ...
- ahjesus不断完善的js小"内裤"
String.prototype.isNullOrWhiteSpace = function () { /// <summary> /// 变量是undefined或者null或者空字符串 ...
- 硅谷新闻1--引导界面GuideActivity
1.红点切换间距 RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) iv_red_point.getLayoutPa ...
- linux下log4j乱码解决
使用log4j的时候,在WIN系统的时候正常显示中文,但是发布到linux系统的时候中文就显示成乱码了 由于log4j配置文件中没有设置编码格式(encoding),所以log4j就使用系统默认编码. ...
- 使用正则表达式获取Sql查询语句各项(表名、字段、条件、排序)
string text = "select * from [admin] where aa=1 and cc='b' order by aa desc "; Regex reg = ...
- .NET的内存限制
之前做点云的.Net程序,经常因为数据量大出现Outofmemory异常,但是看看任务管理器,内存还有好多剩余的,在网上搜了一下发现这样的解释. 不管系统内存多大,目前一个.NET 对象最多只能够使用 ...
- seajs快速了解
详情请点击原文 SeaJS是一个遵循CommonJS规范的JavaScript模块加载框架,可以实现JavaScript的模块化开发及加载机制.与jQuery等JavaScript框架不同,S ...
- Winform使用外部浏览器解决webbrowser问题
对于还是一个菜鸟的我,在最近自己接手了个项目,搞的自己也是醉了,身边也有没大神的现场指导,只能靠度娘和谷歌的大力帮助,要不然这么个小项目可定现在还交不了,不过在这过程种也确确实实学到了不少东西,我先说 ...