UltraEdit --> 追加选项

UltraEdit --> Append option

我有大量 Oracle 数据库更新。这是一些产品支持工作。

我的示例更新是这样的

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' 的日期格式。 我正在使用超编辑。那是我的客户提供的唯一编辑器。 我必须将此日期格式附加到日期。

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

找到 [0-9]
替换 ','yyyy-mm-dd'

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

我有 SQL 开发人员,如果我们可以在 SQL 开发人员中实现这一点,那也很棒。

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

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(,'yyyy-mm-dd')
  • 检查正则表达式和select Perl