如果 URL 中没有 HTTP,则与 SQL 相关的不稳定错误

发布于 2024-12-13 02:35:53 字数 886 浏览 1 评论 0原文

select
wu.ACCOUNT_NUMBER as WS_ACCOUNT_NUMBER,
wu.LIFETIME_REVENUE as WS_LIFETIME_REVENUE,
wu.FIRST_NAME||' '||wu.LAST_NAME as WS_ACCOUNT_NAME,
wu.PRIMARY_EMAIL as WS_ACCOUNT_EMAIL,
wu.TIME_CREATED as WS_ACCOUNT_TIME_CREATED,
wuu.URL as BUSINESS_URL
from
WUSER wu
left outer join WUSER_URL wuu on wu.ACCOUNT_NUMBER = wuu.ACCOUNT_NUMBER

where
wu.ACCOUNT_NUMBER = 123456789;

屏幕上显示的 URL 是超链接,单击它应该将我们带到该网站。问题是它仅在 Oracle 数据库中之前附加了 HTTP 协议时才有效。

例如,当数据库中的网址为 http://www.google.com 时,它可以工作 a> 或 http://google.com 但当网址为 google.com 或 www.google.com 时失败

我们的客户对此要求非常明确,并且希望在没有 HTTP 到该网址时能够跳转到该网站记录在数据库中。

**可能的解决方案有哪些?我可以编写一个条件插入来逐条记录检查是否有 HTTP,如果没有,则以某种方式附加它?

如果是的话,也请告诉我 SQL**

请帮助!!!!!!

select
wu.ACCOUNT_NUMBER as WS_ACCOUNT_NUMBER,
wu.LIFETIME_REVENUE as WS_LIFETIME_REVENUE,
wu.FIRST_NAME||' '||wu.LAST_NAME as WS_ACCOUNT_NAME,
wu.PRIMARY_EMAIL as WS_ACCOUNT_EMAIL,
wu.TIME_CREATED as WS_ACCOUNT_TIME_CREATED,
wuu.URL as BUSINESS_URL
from
WUSER wu
left outer join WUSER_URL wuu on wu.ACCOUNT_NUMBER = wuu.ACCOUNT_NUMBER

where
wu.ACCOUNT_NUMBER = 123456789;

URL displayed on the screen is hyperlink and should take us to the website on clicking it. Problem is that it works only and only when it has a HTTP protocol attached prior to it in the Oracle db.

for example, it works when the url in db is http://www.google.com or http://google.com
but it FAILS when the url is google.com or www.google.com

Our client is very specific about this requirement and wants to be able to hop over to the website when there is no HTTP to the URL record in the db.

**What are the possible solutions? Can I write a conditional insert to check record by record if there is HTTP, and if not, then append it somehow ?

If yes, please tell me the SQL too**

Please Help!!!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千年*琉璃梦 2024-12-20 02:35:53

您是否能够在插入数据之前检查数据,并在前面添加 HTTP://

HTTP:// 放在字符串前面的条件代码可以是...

CASE WHEN UPPER(wuu.URL) LIKE 'HTTP://%'
THEN wuu.UR
ELSE 'HTTP://' || wuu.URL
END

(它只占几行,以便于阅读。)

Are you able to check the data before it's being inserted, and pre-pend the HTTP://?

Conditional code to put HTTP:// in front of the string could be...

CASE WHEN UPPER(wuu.URL) LIKE 'HTTP://%'
THEN wuu.UR
ELSE 'HTTP://' || wuu.URL
END

(It's only on several lines to make it easier to read.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文