如果 URL 中没有 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 是超链接,单击它应该将我们带到该网站。问题是它仅在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否能够在插入数据之前检查数据,并在前面添加
HTTP://
?将
HTTP://
放在字符串前面的条件代码可以是...(它只占几行,以便于阅读。)
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...(It's only on several lines to make it easier to read.)