Skip to Content
0

SAP ASE 16.0: "default" and constraint do not work on a global temporary table

Apr 05 at 06:39 AM

45

avatar image

Hello,

Does global temporary table support "default" and constraint?

I defined default value on a column in global temporary table on ASE 16.0 SP03 PL02, but it does not work.
I added check constraint on another column, but the constraint is ignored.

Reproducing the issues:

1> create global temporary table t1 (a int not null, b int default 0 null)
2> go
1> insert into t1 (a) values (1)
2> go
(1 row affected)
1> select * from t1
2> go
a b
----------- -----------
1 NULL

(1 row affected)
1> create global temporary table t2 (a int check (a>0))
2> go 1> insert into t2 values (-12345) 2> go (1 row affected) 1> select * from t2 2> go a ------------ -12345 (1 row affected) 1>

CR 813529 may be describing this issue.

"CR 813529 Correct handling of default values for global temporary tables. See KBA 2608519."

I tried to see KBA 2608519 for detail, but blocked.

Could anyone make sure they are the known issues?

Regrads,
Kazuo Otani

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Bret Halford
Apr 05 at 01:49 PM
0

The KBA referenced hasn't been published yet and seems to be on an entirely different issue anyway.

The CR looks right, however, and is fixed in the next scheduled rollup, 16.0 SP03 PL04, currently expected to be released in June
( see release schedule at https://wiki.scn.sap.com/wiki/display/SYBASE )

I ran your example on the internal nightly build binary:

1> select @@version
2> go

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adaptive Server Enterprise/16.0 SP03 PL04/EBF 27872 SMP/P/x86_64/SLES 11.1/ase1
60sp03plx/3371/64-bit/DEBUG/Wed Apr 4 04:11:45 2018

1> create global temporary table t1 (a int not null, b int default 0 null)
2> go
1> insert into t1 (a) values (1)
2> go
(1 row affected)
1> select * from t1
2> go
a b
----------- -----------
1 0

(1 row affected)

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Is the behavior of constraint corrected as well?

0
The check constraint behavior is not corrected yet. I opened new CR 814654 for it and will be publishing KBA 2634213 for it.

-bret

0