*   *ID* C05CODD  DBCMD    changed on 1992-09-28-13.23.11 by ADMIN     *
file connect ( kern test sqlmode db2 !
create table t (sd date, time1 time, time2 time, triptime time,
         time3 time, time4 time) !
insert into t values ('19630115', '90000', '60000',
         '40000', '150000', '120000')!
set format internal !
select sd + 1 year + 6 months into :a from t!
select 1 year + sd + 6 months into :a from t !
select 1 year + 6 months + sd into :a from t !
select 1 year + 3 * 6 months + sd into :a from t !
select 1 year - 6 months + sd into :a from t !
select - 6 months + 1 year + sd into :a from t !
select sd + 1 month + 1 month into :a from t !
select sd + 2 months          into :a from t !
commit !
update t set sd = sd + 6 months !
select sd into :a from t !
update t set sd = 6 months !
select sd into :a from t !
rollback !
update t set triptime = triptime + 5 hours !
select triptime into :a from t !
update t set triptime = 5 hours + 3 minutes !
select triptime into :a from t !
update t set triptime = '00000000' + 5 hours !
select triptime into :a from t !
update t set triptime = 5 hours !
select triptime into :a from t !
rollback !
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1 !
select * into :a,:b,:c,:d,:e,:f from t where time1         > time2 + 1 !
select time1-time2, 1 second into :a,:b,:c,:d,:e,:f from t!
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1!
select * into :a,:b,:c,:d,:e,:f from t where 1 < time1-time2 !
dass die naechsten zwei Befehle nicht gehen, ist Kaese,
aber nur durch intern eingebautes num/lfill(chr(...)) zu beheben !
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1 second!
select * into :a,:b,:c,:d,:e,:f from t where     1 second  < time1 - time2 !
select * into :a,:b,:c,:d,:e,:f from t where time1         > time2 + 1 second!
 * time - time geht, time + time nicht. wie db2 !
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 = time3 - time4 !
select * into :a,:b,:c,:d,:e,:f from t where time1 + time4 = time3 + time2 !
select * into :a,:b,:c,:d,:e,:f from t where     1         = time3 + time2 !
create table t1 ( ts timestamp)!
insert into t1 values ('19630115113423034567') !
select ts + 3 months into :a from t1 !
set format iso !
select date ('1989-3-31') into :a from t !
select date ( 1989-3-31 ) into :a from t!
select sd + 1 year + 6 months into :a from t!
select 1 year + sd + 6 months into :a from t !
select 1 year + 6 months + sd into :a from t !
select 1 year + 3 * 6 months + sd into :a from t !
select 1 year - 6 months + sd into :a from t !
select - 6 months + 1 year + sd into :a from t !
select sd + 1 month + 1 month into :a from t !
select sd + 2 months          into :a from t !
commit !
update t set sd = sd + 6 months !
select sd into :a from t !
update t set sd = 6 months !
select sd into :a from t !
rollback !
update t set triptime = triptime + 5 hours !
select triptime into :a from t !
update t set triptime = 5 hours + 3 minutes !
select triptime into :a from t !
update t set triptime = '00:00:00' + 5 hours !
select triptime into :a from t !
update t set triptime = 5 hours !
select triptime into :a from t !
rollback !
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1 !
select * into :a,:b,:c,:d,:e,:f from t where time1         > time2 + 1 !
select time1-time2, 1 second into :a,:b,:c,:d,:e,:f from t!
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1!
select * into :a,:b,:c,:d,:e,:f from t where 1 < time1-time2 !
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 > 1 second!
select * into :a,:b,:c,:d,:e,:f from t where time1         > time2 + 1 second!
select * into :a,:b,:c,:d,:e,:f from t where time1 - time2 = time3 - time4 !
select * into :a,:b,:c,:d,:e,:f from t where time1 + time4 = time3 + time2 !
select * into :a,:b,:c,:d,:e,:f from t where     1         = time3 + time2 !
drop table t !
drop table t1!
commit release !
