`
文章列表

while循环

create or replace procedure while_test(start_in int,end_in int) is init_a int :=start_in; begin while (init_a <= end_in) loop dbms_output.put_line(init_a); init_a:=init_a+1; end loop; end while_test;  while循环和简单循环很类似,区别在于while循环每次循环之前检查是否满足终止条件
createorreplaceprocedurexsxxgl_test_3is begin for test_rec in (select * from
create or replace procedure sz_test(start_in int,end_in int) is begin for int_a in start_in..end_in loop dbms_output.put_line(int_a); end loop; end sz_test; SQL> set serveroutput onSQL> exec xsxxgl_test_3(11,15) 1112131415 PL/SQL procedure successfully completed

简单循环

create or replace procedure jdxh_test(start_in pls_integer,end_in pls_integer) is init_a pls_integer :=start_in; begin loop exit when init_a > end_in; dbms_output.put_line(init_a); init_a:=init_a+1; end loop; end jdxh_test;     简单循环:是因为它仅是以loop关键字开始,以end loop语句结束,靠循环体内的exit,exit when ...

简单for循环

 create or replace procedure test_1 is begin for res in 1..5 loop dbms_output.put_line('haha:'||res); end loop; end test_1;  执行时: SQL> set serveroutput onSQL> exec test_1   另外oracle拼接字符时是用||来进行拼接   ----------------test2--------------------- create or replace procedure xsxx ...

oracle建表

create table xsxxgl_test( xh varchar2(20) not null, xm varchar2(100), sfzjh varchar2(100), bz varchar2(200), primary key (xh) ); comment on table xsxxgl_test is '测试表'; comment on column xsxxgl_test.xh is '学号'; comment on column xsxxgl_test.xm is '姓名'; comment on column xsxxgl_test.sfzjh ...

调用存储过程

 create or replace procedure Test(dwh in varchar2) is p_sql VARCHAR(10000); begin p_sql := 'update XSXXGL_XSJBXX_TEST set yddh='||777777||' where xh='||dwh||''; execute immediate p_sql; commit; end TEST;    ------------------------------------第一种情况:调用存储过程不提交,在ADF中提交----------- ...

ADF绑定层代码编写

    博客分类:
  • ADF
/** * 提交保存 * */ public String saveButton() { String yhbh = UserOperation.getYhbh(); BindingContext bc = BindingContext.getCurrent(); //获取上下文 DCBindingContainer bcContainer = (DCBindingContainer) bc.getCurrentBindingsEntry(); //取得绑定容器 DCIterato ...
-- 声明游标;CURSOR cursor_name IS select_statement --For 循环游标 --(1)定义游标 --(2)定义游标变量 --(3)使用for循环来使用这个游标 declare --类型定义 cursor c_job is select empno,ename,job,sal from emp where job='MANAGER'; --定义一个游标变量v_cinfo c_emp%ROWTYPE ,该类型为游标c_emp中的一行数 ...
软件环境 Windows 2000 + ORACLE9i  硬件环境 CPU 1.8G + RAM 512M   现在我们有2张表 如下: T1--大表 10000笔 T1_FK_ID T2--小表 5000笔   T2_PK_ID T1通过表中字段ID与T2的主键ID关联   模拟数据如下: --T2有5000笔数据 create table T2 as select rownum id, a.*  from all_objects a  where 1=0;   -- Create/Recreate primary, unique and foreig ...

oracle批量操作

-------批量新增--------- DECLARE CURSOR cur IS SELECT a.XH, a.ZYH, a.BJH, a.XM, a.XBM, a.SFZJH, a.CSRQ FROM xsxxgl_xsjbxx a WHERE not exists (SELECT 1 FROM zs_xsxx2 b WHERE a.xh = b.xsid); --定义游标 TYPE rec IS TABLE OF cur%ROWTYPE; --定义类型 recs rec; BEGIN OPEN cur; --打开游标 ...
JSFUtils.resolveExpression("#{pageFlowScope.cfzj}"); ---------------------------------------------------------------------------------------------- AdfFacesContext.getCurrentInstance().getPageFlowScope().put("cfzj",null); //先把selectCfzj设为空值RichInputText sslyValue = (RichInputT ...
   当下拉框值变化时,文本框内容相应变化(也就是根据下拉框id值再查一遍数据)
  /** *对选择记录进行可操作性判断 * @param actionEvent */ public void actionSetParam(ActionEvent actionEvent) { if (JSFUtils.resolveExpression("#{pageFlowScope.cz}") == null) { //操作判断 return; } DCIteratorBinding dcIt = ADFUtils.findIt ...
 e
Global site tag (gtag.js) - Google Analytics