是否可能会溢出Oracle NUMBER类型? [英] Is it possible to overflow an Oracle NUMBER type?

查看:92
本文介绍了是否可能会溢出Oracle NUMBER类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用名为Appworx的流程调度软件.其中,每个流程和子流程可以具有任意数量的条件",如果为"true",则将采取某些条件操作.

I'm working with process scheduling software called Appworx. In it, each process and subprocess can have an arbitrary number of "conditions", which if true, some conditional action is taken.

可能的条件操作之一是goto语句,其中普通整数是标签(每个条件均从1开始编号).我想使用此功能来循环评估和运行一些任务,但是您只能 goto 编号更高的条件(不要问我为什么...这似乎毁了大多数实用程序).

One of the possible conditional actions is a goto statement, where a plain integer is the label (each condition being numbered starting at 1). I'd like to use this feature to evaluate and run a few tasks in a loop, but you can only goto higher-numbered conditions (Don't ask me why... this seems to ruin most of the utility).

我有理由相信,所有这些都是Oracle在后端进行的评估.看完Appworx的架构后,看来 goto 标签都是NUMBER(12,0).我怀疑检查标签是否低于当前条件的逻辑是这样的:

I have reason to believe that all of this is evaluated by Oracle on the backend. And having looked at the schema for Appworx, it appears that the goto labels are all NUMBER(12,0). I suspect that the logic that checks whether a label is lower than the current condition is something like:

where label > current_condition

因此,如果我要提供一个具有足够高值的goto,我认为它会欺骗检查并允许我执行简单的循环.至少如果Oracle使用普通整数.是否有可能使它们溢出,我将使用什么值来使值溢出回到1?

So, if I were to supply a goto with a high enough value, I think it would cheat the checking and allow me to do simple loops. At least if Oracle used normal integers. Is it possible to overflow them, and what value would I use to overflow the value back to 1?

我想Oracle版本相当重要,如果是的话,它是11g.

I suppose the Oracle version matters quite a bit, if so, it's 11g.

PS另外,如果有人愿意为我重新添加标签,请添加"appworx"

PS Also, if anyone would care to re-tag this for me, please add "appworx"

推荐答案

Oracle数字实际上是具有40个十进制数字有效位数的浮点数字.
因此,它们不会溢出.

Oracle numbers are in fact floating point numbers with 40 decimal digit significand.
So, they can't be overflowed.

(10 ^ 40-1)是最大整数,可以增加1.
证明

(10^40-1) is the maximal integer number which can be increased by 1.
proof

NUMBER(12,0)是NUMBER类型的子类型.
也就是说,它由NUMBER类型和限制检查器组成.

NUMBER(12,0) is a subtype of type NUMBER.
That is, it consists of NUMBER type and a restriction checker.

这篇关于是否可能会溢出Oracle NUMBER类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆