欢迎莅临 SUN WU GANG 的园子!!!

世上无难事,只畏有心人。有心之人,即立志之坚午也,志坚则不畏事之不成。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  470 随笔 :: 0 文章 :: 22 评论 :: 30万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  004 DB / ORACLE

日常数据库操作记录
摘要:第一步:使用管理员账户登录,system system 第二步:执行命令 --根据现场情况,注意设置表空间大小create tablespace ZBQUEUE datafile 'D:\ZBQUEUE.ora' size 100m;--alter database datafile 'D:\ORA 阅读全文
posted @ 2020-12-03 17:29 sunwugang 阅读(103) 评论(0) 推荐(0) 编辑

摘要:1.字符串截取方法 --5SELECT INSTR('8.30~9.00', '~') FROM dual; --8.30SELECT SUBSTR ('8.30~9.00', 0, INSTR ('8.30~9.00', '~',1,1)-1) AS time FROM dual;--18.30S 阅读全文
posted @ 2019-09-03 15:16 sunwugang 阅读(140) 评论(0) 推荐(0) 编辑

摘要:触发器名:触发器对象的名称。由于触发器是数据库自动执行的,因此该名称只是一个名称,没有实质的用途。触发时间:指明触发器何时执行,该值可取:before:表示在数据库动作之前触发器执行;after:表示在数据库动作之后触发器执行。触发事件:指明哪些数据库动作会触发此触发器:insert:数据库插入会触 阅读全文
posted @ 2019-09-02 14:30 sunwugang 阅读(399) 评论(0) 推荐(0) 编辑

摘要:public bool QueueToRegister(string appointsId, string enrolDoctor) { using (OleDbConnection conn = new OleDbConnection(DBHelper.Instance.ConnectionStr)) { ... 阅读全文
posted @ 2019-08-15 17:11 sunwugang 阅读(1048) 评论(0) 推荐(0) 编辑

摘要:1.字符串转日期: to_date(paramStr,'YYYYMMDDHH24MISS') to_date(paramStr,'yyyy-MM-DD') to_date(paramStr,'yyyy/mm/dd hh24:mi:ss') to_date(paramStr,'yyyy-MM-dd hh24:mi:ss') 2.日期转字符串 to_char(paramDate,'HH24:MI:... 阅读全文
posted @ 2018-12-24 16:45 sunwugang 阅读(202) 评论(0) 推荐(0) 编辑

摘要:方式一: 使用 || 进行拼接,略,此处不进行说明 方式二: 使用wmsys.wm_concat拼接函数进行拼接,如下所示 --合并字符串,默认使用逗号隔开 select (select to_char(wmsys.wm_concat((partofcheck))) from QUEUEDETAIL 阅读全文
posted @ 2018-11-21 13:51 sunwugang 阅读(1091) 评论(0) 推荐(0) 编辑

摘要:create or replace procedure INIT_DICT_QUEUECODE(p_queueId int,p_paramType in varchar2,p_queenName in varchar2,p_ofDepart in varchar2,p_result out int) is loopNum number;--循环次数 codeNum number;--号源编号 c... 阅读全文
posted @ 2018-09-20 10:14 sunwugang 阅读(173) 评论(0) 推荐(0) 编辑

摘要:年龄大了,写程序总记不住、记录一下格式: private const string SQL_INSTERT = @"INSERT INTO QS_ROOM_QUEUE (QUEUEID,ROOMID,PRIORITY) VALUES(?,?,?)";private const string SQL_ 阅读全文
posted @ 2018-09-19 16:30 sunwugang 阅读(267) 评论(0) 推荐(0) 编辑

摘要:alter table us_studies modify enroldate default to_char(sysdate,'yyyy-mm-dd'); ALTER TABLE QS_QUEUE ADD OFDEPART VARCHAR2(20); alter table QS_QUEUE mo 阅读全文
posted @ 2018-09-12 15:13 sunwugang 阅读(125) 评论(0) 推荐(0) 编辑

摘要:--标准函数Lpad 可以实现左补零,但是如果多于需要长度,则会截断字符串 SELECT LPAD ('1' , 3 , '0') FROM DUAL -- return 001 情况一:需要补零。 SELECT LPAD ('1' , 3 , '0') FROM DUAL 结果:001 正确 情况 阅读全文
posted @ 2018-08-10 11:38 sunwugang 阅读(295) 评论(0) 推荐(0) 编辑

摘要:合并前效果: 合并后效果: 阅读全文
posted @ 2018-08-09 17:53 sunwugang 阅读(246) 评论(0) 推荐(0) 编辑

摘要:参考: 注:同理而言,需要查第几条数据或需要查询指定条数的数据——where rn=N or where rn in(num1,num2,numx,......) 阅读全文
posted @ 2018-08-09 17:11 sunwugang 阅读(7190) 评论(0) 推荐(1) 编辑

摘要:SQL 事务 Oracle事务 Sql存储过程 Oracle存储过程 阅读全文
posted @ 2018-07-24 13:46 sunwugang 阅读(366) 评论(0) 推荐(0) 编辑

摘要:select * from r_patient a where a.birthdate= to_date('1953-03-01','yyyy-mm-dd');select * from r_patient where to_char(birthdate,'yyyy-mm-dd')= '1953-0 阅读全文
posted @ 2017-11-22 11:10 sunwugang 阅读(455) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示