如何通过识别句子的最后一个字符[0-9A-Z,."#*]的位置来获取字符串
How to get a string by identifying the last position of a character [0-9A-Z,."#*] of the sentence
限制:最大字符串长度为 268,435,456 个 Unicode 字符(256 兆字符)或 536,870,912 个字节。这是大小限制。
情况是这样的:我需要最后一个字符的大小限制。 Oracle 抛出类似
的错误
: inconsistent datatypes: expected - got CLOB
如何修复此类错误,XMLAGG 是一个选项吗?
下面是测试代码:
` WITH q AS (
SELECT 'All aboard!
Hahahahaha
Aye Aye Aye Aye Aye Aye...
Crazy, but that s how it goes
Millions of people living as foes
Maybe it s not too late
To learn how to love and forget how to hate
Mental wounds not healing
Life s a bitter shame
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I ve listened to preachers, I ve listened to fools
I ve watched all the dropouts who make their own rules
One person conditioned to rule and control
The media sells it and you live the role
Mental wounds still screaming
Driving me insane
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I know that things are going wrong for me
You gotta listen to my words
Yeah
Heirs of a cold war, that s what we ve become
Inheriting troubles, I m mentally numb
Crazy, I just cannot bear
I m living with something that just isn t fair
Mental wounds stop healing
Who and what s to blame
I m going off the rails on a crazy train' AS sentence FROM DUAL)
SELECT SUBSTR(sentence,-256) AS Y FROM Q; `
结果:
Yeah
Heirs of a cold war, that s what we ve become
Inheriting troubles, I m mentally numb
Crazy, I just cannot bear
I m living with something that just isn t fair
Mental wounds stop healing
Who and what s to blame
I m going off the rails on a crazy train
测试场景:代码必须 return 以下场景的值
' 您好,我们篮子里有 14 个苹果,我们正在将它们运送到
使用#1243432 航班号'
经澳大利亚前往日本只需 23142 美元
' 被扶持的新人怎么能装塑料?为什么恐怖不能超过慈善骑士?头盔认为!任何病房如何错误打印发射器?更高的内核忽略具有感知数组的集合。解剖学围绕背部缺陷大笑?'
'949490909232哟,怎么了?'
'谢谢'
'5/16/1941'
' 1. 嗨伙计
这不是最好的主意;
足球是世界流行的运动吗
白宫能容纳多少头大象
狮子能吃
2 年内有 6 头鹿、4 头斑马和 8 头水牛。'
我猜你需要这个 -
SELECT SUBSTR(sentence,-LENGTH(sentence), 256) AS Y
FROM Q;
限制:最大字符串长度为 268,435,456 个 Unicode 字符(256 兆字符)或 536,870,912 个字节。这是大小限制。
情况是这样的:我需要最后一个字符的大小限制。 Oracle 抛出类似
的错误: inconsistent datatypes: expected - got CLOB
如何修复此类错误,XMLAGG 是一个选项吗?
下面是测试代码:
` WITH q AS (
SELECT 'All aboard!
Hahahahaha
Aye Aye Aye Aye Aye Aye...
Crazy, but that s how it goes
Millions of people living as foes
Maybe it s not too late
To learn how to love and forget how to hate
Mental wounds not healing
Life s a bitter shame
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I ve listened to preachers, I ve listened to fools
I ve watched all the dropouts who make their own rules
One person conditioned to rule and control
The media sells it and you live the role
Mental wounds still screaming
Driving me insane
I m going off the rails on a crazy train
I m going off the rails on a crazy train
I know that things are going wrong for me
You gotta listen to my words
Yeah
Heirs of a cold war, that s what we ve become
Inheriting troubles, I m mentally numb
Crazy, I just cannot bear
I m living with something that just isn t fair
Mental wounds stop healing
Who and what s to blame
I m going off the rails on a crazy train' AS sentence FROM DUAL)
SELECT SUBSTR(sentence,-256) AS Y FROM Q; `
结果:
Yeah Heirs of a cold war, that s what we ve become Inheriting troubles, I m mentally numb Crazy, I just cannot bear I m living with something that just isn t fair Mental wounds stop healing Who and what s to blame I m going off the rails on a crazy train
测试场景:代码必须 return 以下场景的值
' 您好,我们篮子里有 14 个苹果,我们正在将它们运送到 使用#1243432 航班号'
经澳大利亚前往日本只需 23142 美元' 被扶持的新人怎么能装塑料?为什么恐怖不能超过慈善骑士?头盔认为!任何病房如何错误打印发射器?更高的内核忽略具有感知数组的集合。解剖学围绕背部缺陷大笑?'
'949490909232哟,怎么了?'
'谢谢'
'5/16/1941'
' 1. 嗨伙计
这不是最好的主意;
足球是世界流行的运动吗
白宫能容纳多少头大象
狮子能吃 2 年内有 6 头鹿、4 头斑马和 8 头水牛。'
我猜你需要这个 -
SELECT SUBSTR(sentence,-LENGTH(sentence), 256) AS Y
FROM Q;