Chr☆s Kwok 的技术笔记

.NET, C#, WPF, WCF, WF, .NetCore & LINQ ... I know how it works because I know why it works ...

博客园 首页 新随笔 订阅 管理

ora = //连接描述符名:ora
(description = //描述
(address = //网络地址之一
(protocol = tcp) //网络协议(tcp表示TCP/IP协议)
(host = 129.9.114.22) //服务器IP地址:129.9.114.22
(port = 1251) //服务器端口号:1251
)
(connect_data = //连接数据
(sid = ora7) //数据库标识名:ora7
(SERVER = DEDICATED)
(SERVICE_NAME = ora9i)
)
)

1、ORACLE备份数据到新表
create table poor.orderrequest_20171108 as select * from poor.orderrequest r WHERE r.ORDERREQUESTID=18859735;

select listagg(sickbedid, ',') within group(order by sickbedid) from concept.sickbed where ORGANIZATIONID=836248;

select wmsys.wm_concat(ii.EXTENSION) INTO v_sickbedids from concept.sickbed s, CONCEPT.SICKBEDII ii WHERE s.SICKBEDID=ii.SICKBEDID

2、在oracle中怎么通过字段名查询其所在的表
select c.owner, c.table_name, c.* from dba_tab_columns c where c.column_name like '%PROVIDE%';

3、Timestamp类型字段更新范例:
update POOR.OrderRequest set RowVersion = systimestamp, NumberVersion = NumberVersion + 1 where OrderRequestId in (83634);
update POOR.OrderRequest set RowVersion = to_timestamp('2018-04-08 21:20:42.439', 'yyyy-mm-dd hh24:mi:ss:ff'), NumberVersion = NumberVersion + 1 where OrderRequestId in (77133) and EncounterId in (12117);
commit;

USE JX_T30_DXS

select distinct OBJECT_SCHEMA_NAME(id) + '.' + object_name(id) from syscomments
where text like '%rowversion%' and text like '%OPENQUERY%' and text like '%POOR.ORDERREQUEST%' AND object_name(id) NOT LIKE '%删除%';

CREATE TABLE #tmpTable
(
OrderRequestID INT, NumberVersion INT, [RowVersion] DATETIME NULL
)

INSERT INTO #tmpTable(OrderRequestID, NumberVersion, [RowVersion])
SELECT * FROM OPENQUERY(syorcl, 'select r.orderrequestid, r.numberversion, r.rowversion from POOR.ORDERREQUEST r where OrderRequestId in (83634)');
select * from #tmpTable;
drop table #tmpTable;

3、更新事件内容调试时要注意清空ContentData为Null才会生效(调度会先把EventData序列化到ContentData):
update ixs.Event set eventdata='<ArrayOfEmp_Result ... </ArrayOfEmp_Result>'
, ContentData=null where Id = 17644781;

--判断字段是否全数字:
SELECT max(to_number(EXTENSION)) FROM PRPA.ENCOUNTERII where REGEXP_LIKE(EXTENSION, '(^[+-]?\d{0,}\.?\d{0,}$)');

 

posted on 2018-09-20 19:58  Chr☆s  阅读(9761)  评论(0编辑  收藏  举报