我有大量的Oracle DB更新列表。这是一些支持的工作。
我的示例更新如下
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”
如果我这样做,日期中的最后一个数字也会被替换。
我有,如果我们能够在中实现这一点,那也将是很棒的。
发布于 2016-05-24 10:17:14
如果我正确理解了这个问题,您将寻找一种将文本'yyyy-mm-dd'附加到所有date语句的方法,以便这两个示例如下所示:
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')https://stackoverflow.com/questions/37346277
复制相似问题