oracle 中如何将字符串转数字?

pobaby 2009-07-22 03:21:34

oracle 中如何将字符串转数字? 有现成的函数吗?类似java中的 hashcode 值。


比如:

字符串

ad-28934-2342-s-23-4

转换后变为

56998568234234
...全文
444 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cyc_520 2011-01-10
  • 打赏
  • 举报
回复
很好安师大f暗示f的是否
pobaby 2009-07-22
  • 打赏
  • 举报
回复
哦,太好了,十分感谢!
csuxp2008 2009-07-22
  • 打赏
  • 举报
回复
ora_hash 见识了
suncrafted 2009-07-22
  • 打赏
  • 举报
回复
这个还是首次看到
学习了
inthirties 2009-07-22
  • 打赏
  • 举报
回复
学习了
shiyiwan 2009-07-22
  • 打赏
  • 举报
回复
In Oracle 10g you can use the ORA_HASH function which computes a hash value for any given expression. It recieves three arguments:



expr - determines the data for which you want Oracle Database to compute a hash value. You can go wild on the length of this string there isn't any restriction on this.

max_bucket (optional) - determines the maximum bucket value returned by the hash function. You can specify any value between 0 and 4294967295. The default is 4294967295.

seed_value argument (optional) - enables Oracle to produce many different results for the same set of data. Oracle applies the hash function to the combination of expr and seed_value. You can specify any value between 0 and 4294967295. The default is 0.

SQL> select ora_hash('ad-28934-2342-s-23-4') from dual;

ORA_HASH('AD-28934-2342-S-23-4
------------------------------
3766956527

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧