好的,事情就是这样。我有旧的 sql server 文本格式的注释。它将所有笔记记录在一个大数据中。我需要提取该文本块并对其进行解析,以便为每个注释条目创建一行,其中包含用于时间戳、用户和注释文本的单独列。我能想到的唯一方法是使用正则表达式来定位每个音符的 unix 时间戳并对其进行解析。我知道有用于解析分隔符的拆分函数,但这会删除分隔符。我需要在 \d{10} 上进行解析,但还需要保留 10 位数字。这是一些示例数据。
create table test_table
(
job_number number,
notes varchar2(4000)
)
insert into test_table values
(12345, '1234567890 username notes text notes text notes text notes text 5468204562 username notes text notes text notes text notes text 1025478510 username notes text notes text notes text notes text')
(12346, '2345678901 username notes text notes text notes text notes text 1523024512 username notes text notes text notes text notes text 1578451236 username notes text notes text notes text notes text')
(12347, '2345678902 username notes text notes text notes text notes text 2365201214 username notes text notes text notes text notes text 1202154215 username notes text notes text notes text notes text')
我希望看到每个音符的一个记录看起来像这样。
JOB_NUMBER DTTM USER NOTES_TEXT
---------- ---------- ---- ----------
12345 1234567890 USERNAME notes text notes text notes text notes text
12345 5468204562 USERNAME notes text notes text notes text notes text
12345 1025478510 USERNAME notes text notes text notes text notes text
12346 2345678901 USERNAME notes text notes text notes text notes text
12346 1523024512 USERNAME notes text notes text notes text notes text
12346 1578451236 USERNAME notes text notes text notes text notes text
12347 2345678902 USERNAME notes text notes text notes text notes text
12347 2365201214 USERNAME notes text notes text notes text notes text
12347 1202154215 USERNAME notes text notes text notes text notes text
感谢您提供任何帮助