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

oracle与sqlserver插入数据动态字段值

记录一下以备下次快速找到。。。
       往tb_wf_privgrant表中插入一条记录,workflow_id字段值从tb_wf_workflow 表中获取workflow_name='知识审核'的所有记录中workflow_id最大值。
--oracle
declare   a NUMBER(10);
   begin
   select  max(workflow_id) into a from tb_wf_workflow where workflow_name='知识审核';
   insert into tb_wf_privgrant(grant_Id,workflow_id,member_id,member_type,knowledge_code) values (HIBERNATE_SEQUENCE.NEXTVAL, a,'r001','R','6001');
   end;
--sqlserver
--方法一
insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowledge_code)
   select max(workflow_id),'r001','R','6001' from tb_wf_workflow where workflow_name='知识审核'
--方法二
 declare   @a numeric(10,0)
   select   @a = max(workflow_id) from tb_wf_workflow where workflow_name='知识审核'
   insert into tb_wf_privgrant(workflow_id,member_id,member_type,knowledge_code)
   values (@a,'r001','R','6001')


相关文档:

Oracle存储过程包含三部分

Oracle存储过程包含三部分:过程声明,执行过程部分,存储过程异常。
Oracle存储过程可以有无参数存储过程和带参数存储过程。 
一、无参程序过程语法
 
1 create or replace procedure NoParPro
2 as  ;
3 begin
4 ;
5 exception  &nb ......

Oracle 1z0 047 Exam


Exam Number/Code : 1z0-047
Exam Name : Oracle Database SQL Expert
Questions and Answers : 278 Q&As
Update Time: 2010-04-15
1. Which two statements are true regarding the execution of the correlated subqueries? (Choose two.)
A. The nested query executes after the outer query returns th ......

Oracle 1z0 047 Exam


Exam Number/Code : 1z0-047
Exam Name : Oracle Database SQL Expert
Questions and Answers : 278 Q&As
Update Time: 2010-04-15
1. Which two statements are true regarding the execution of the correlated subqueries? (Choose two.)
A. The nested query executes after the outer query returns th ......

Oracle 1z0 047 Exam


Exam Number/Code : 1z0-047
Exam Name : Oracle Database SQL Expert
Questions and Answers : 278 Q&As
Update Time: 2010-04-15
1. Which two statements are true regarding the execution of the correlated subqueries? (Choose two.)
A. The nested query executes after the outer query returns th ......

linux oracle缩小回滚表空间大小undotbs01.dbf


http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
回滚表空间大小
-- 创建一个新的小空间的UNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- 设置新的表空间为系统UNDO_TABLESPACE
Alter SYSTE ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号