首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UltraEdit -->附加选项

UltraEdit -->附加选项
EN

Stack Overflow用户
提问于 2016-05-20 12:03:12
回答 1查看 95关注 0票数 0

我有大量的Oracle DB更新列表。这是一些支持的工作。

我的示例更新如下

代码语言:javascript
复制
update XYZ 
  set  name = 'abb',
       job  = 'mgr'
where joining_date = to_date('2015-02-11'
  and job_id in (....list of job_id this can be anywhere in 1000s...);



update XYZ
  set  name = 'jab',
       job  = 'appdev'
where joining_date = to_date('2016-03-10'
  and job_id in (....list of job_id this can be anywhere in 1000s...);

根据连接日期和job_ids,有几个更新。名单上不停地写着。

这里真正缺少的是'yyyy-mm-dd'的日期格式。我在用UltraEdit。这是我客户唯一提供的编辑。我得把这个日期格式附加到日期上。

我尝试用正则表达式查找和替换

找0-9

替换“yyyy dd”

如果我这样做,日期中的最后一个数字也会被替换。

我有,如果我们能够在中实现这一点,那也将是很棒的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-24 10:17:14

如果我正确理解了这个问题,您将寻找一种将文本'yyyy-mm-dd'附加到所有date语句的方法,以便这两个示例如下所示:

代码语言:javascript
复制
update XYZ 
  set  name = 'abb',
       job  = 'mgr'
where joining_date = to_date('2015-02-11','yyyy-mm-dd')
  and job_id in (....list of job_id this can be anywhere in 1000s...);



update XYZ
  set  name = 'jab',
       job  = 'appdev'
where joining_date = to_date('2016-03-10','yyyy-mm-dd')
  and job_id in (....list of job_id this can be anywhere in 1000s...);

如果这是正确的,您可以使用以下选项执行搜索和替换操作:

  • 查找什么: to_date\(('[\-0-9]*')
  • 替换为: to_date($1,'yyyy-mm-dd')
  • 检查正则表达式并选择Perl
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37346277

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档