📄 ejbql.out
字号:
ij> -- This test EJBQL Absolute function. Resolve 3535-- Begin of ABS/ABSVAL test. For all valid types, un-escaped function.-- Integer has a range of -2147483648 to 2147483647-- Basiccreate table myint( a int );0 rows inserted/updated/deletedij> create table myinteger( a integer );0 rows inserted/updated/deletedij> select abs(a) from myint;1 -----------ij> select abs(a) from myinteger;1 -----------ij> insert into myint values (null), (+0), (-0), (+1), (-1), (1000), (-1000), (null), (2147483647), (-2147483647);10 rows inserted/updated/deletedij> insert into myinteger values (NULL), (+0), (-0), (+1), (-1), (1000), (-1000), (NULL), (2147483647), (-2147483647);10 rows inserted/updated/deletedij> select a from myint;A -----------NULL 0 0 1 -1 1000 -1000 NULL 2147483647 -2147483647ij> select a from myinteger;A -----------NULL 0 0 1 -1 1000 -1000 NULL 2147483647 -2147483647ij> select abs(a) from myint;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> select abs(a) from myinteger;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> select -abs(a) from myint;1 -----------NULL 0 0 -1 -1 -1000 -1000 NULL -2147483647-2147483647ij> select -abs(a) from myinteger;1 -----------NULL 0 0 -1 -1 -1000 -1000 NULL -2147483647-2147483647ij> select abs(abs(-abs(-abs(a)))) from myint;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> select abs(abs(-abs(-abs(a)))) from myinteger;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> SELECT ABSVAL(ABSVAL(-ABSVAL(-ABSVAL(A)))) FROM MYINT;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> SELECT ABSVAL(ABSVAL(-ABSVAL(-ABSVAL(A)))) FROM MYINTEGER;1 -----------NULL 0 0 1 1 1000 1000 NULL 2147483647 2147483647 ij> insert into myint values (-2147483648);1 row inserted/updated/deletedij> insert into myinteger values (-2147483648);1 row inserted/updated/deletedij> select a from myint where a=-2147483648;A ------------2147483648ij> select a from myinteger where a=-2147483648;A ------------2147483648ij> -- Errorselect -a from myint where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select -a from myinteger where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(-a) from myint where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(-a) from myinteger where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(a) from myint where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(a) from myinteger where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(-abs(a)) from myint where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> select abs(-abs(a)) from myinteger where a=-2147483648;1 -----------ERROR 22003: The resulting value is outside the range for the data type INTEGER.ij> drop table myint;0 rows inserted/updated/deletedij> drop table myinteger;0 rows inserted/updated/deletedij> -- End of Integer test-- Smallint has a range of -32768 to 32767-- Basiccreate table mysmallint( a smallint );0 rows inserted/updated/deletedij> select abs(a) from mysmallint;1 ------ij> insert into mysmallint values (null), (+0), (-0), (+1), (-1), (1000), (-1000), (null), (32767), (-32767);10 rows inserted/updated/deletedij> select a from mysmallint;A ------NULL 0 0 1 -1 1000 -1000 NULL 32767 -32767ij> select abs(a) from mysmallint;1 ------NULL 0 0 1 1 1000 1000 NULL 32767 32767 ij> select -abs(a) from mysmallint;1 ------NULL 0 0 -1 -1 -1000 -1000 NULL -32767-32767ij> select abs(abs(-abs(-abs(a)))) from mysmallint;1 ------NULL 0 0 1 1 1000 1000 NULL 32767 32767 ij> SELECT ABSVAL(ABSVAL(-ABSVAL(-ABSVAL(A)))) FROM MYSMALLINT;1 ------NULL 0 0 1 1 1000 1000 NULL 32767 32767 ij> insert into mysmallint values (-32768);1 row inserted/updated/deletedij> select a from mysmallint where a=-32768;A -------32768ij> -- Errorselect -a from mysmallint where a=-32768;1 ------ERROR 22003: The resulting value is outside the range for the data type SMALLINT.ij> select abs(-a) from mysmallint where a=-32768;1 ------ERROR 22003: The resulting value is outside the range for the data type SMALLINT.ij> select abs(a) from mysmallint where a=-32768;1 ------ERROR 22003: The resulting value is outside the range for the data type SMALLINT.ij> select abs(-abs(a)) from mysmallint where a=-32768;1 ------ERROR 22003: The resulting value is outside the range for the data type SMALLINT.ij> drop table mysmallint;0 rows inserted/updated/deletedij> -- End of Smallint test-- Bigint has a range of -9223372036854775808 to 9223372036854775807-- Basiccreate table mybigint( a bigint );0 rows inserted/updated/deletedij> select abs(a) from mybigint;1 --------------------ij> insert into mybigint values (null), (+0), (-0), (+1), (-1), (1000), (-1000), (null), (9223372036854775807), (-9223372036854775807);10 rows inserted/updated/deletedij> select a from mybigint;A --------------------NULL 0 0 1 -1 1000 -1000 NULL 9223372036854775807 -9223372036854775807ij> select abs(a) from mybigint;1 --------------------NULL 0 0 1 1 1000 1000 NULL 9223372036854775807 9223372036854775807 ij> select -abs(a) from mybigint;1 --------------------NULL 0 0 -1 -1 -1000 -1000 NULL -9223372036854775807-9223372036854775807ij> select abs(abs(-abs(-abs(a)))) from mybigint;1 --------------------NULL 0 0 1 1 1000 1000 NULL 9223372036854775807 9223372036854775807 ij> SELECT ABSVAL(ABSVAL(-ABSVAL(-ABSVAL(A)))) FROM MYBIGINT;1 --------------------NULL 0 0 1 1 1000 1000 NULL 9223372036854775807 9223372036854775807 ij> insert into mybigint values (-9223372036854775808);1 row inserted/updated/deletedij> select a from mybigint where a=-9223372036854775808;A ---------------------9223372036854775808ij> -- Errorselect -a from mybigint where a=-9223372036854775808;1 --------------------ERROR 22003: The resulting value is outside the range for the data type BIGINT.ij> select abs(-a) from mybigint where a=-9223372036854775808;1 --------------------ERROR 22003: The resulting value is outside the range for the data type BIGINT.ij> select abs(a) from mybigint where a=-9223372036854775808;1 --------------------ERROR 22003: The resulting value is outside the range for the data type BIGINT.ij> select abs(-abs(a)) from mybigint where a=-9223372036854775808;1 --------------------ERROR 22003: The resulting value is outside the range for the data type BIGINT.ij> drop table mybigint;0 rows inserted/updated/deletedij> -- End of Bigint test-- REAL has a range of +/-1.175E-37 to +/-3.402E+38 -- Basiccreate table myreal( a real );0 rows inserted/updated/deletedij> select abs(a) from myreal;1 -------------ij> insert into myreal values (null), (+0), (-0), (+1), (-1), (null), (100000000), (-100000000),(3.402E+38), (-3.402E+38),(1.175E-37), (-1.175E-37);12 rows inserted/updated/deletedij> select a from myreal;A -------------NULL 0.0 0.0 1.0 -1.0 NULL 1.0E8 -1.0E8 3.402E38 -3.402E38 1.175E-37 -1.175E-37 ij> select -a from myreal;1 -------------NULL 0.0 0.0 -1.0 1.0 NULL -1.0E8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -