Statistics and temp tables
Posted in 1994
Can any one explain why update statistics complain about a dropped
temporary table ? I know that I don't have to drop temporary tables, but
that's besides the point.
HP-UX sinco A.08.02 D 9000/837
RSAM Version 5.00.UC5 -- On-Line -- Up 2 days 01:05:49 -- 8128 Kbytes
INFORMIX-SQL Version 4.10.UC1
Below is the script used as well as the logged output.
-------------------------------------
Ti Lian Hwang
email : tilh@sin-co.sin-ro.dhl.com
-------------------------------------
#####################################
#! /bin/ksh
#
# Filename: hsekeep.ksh
# Desc : isql programs to delete old GIS data
# Version : 1.10
# Author : Ti Lian Hwang
# Date : 07 Nov 94
#
. /usr/local/include/infx.sis
BASE=`dirname $0`
BASE=$BASE/..
DATE=`date +%d`
LOGFILE=/tmp/gis_del.`date +%a`
isql gis << ! > $LOGFILE 2>&1
set isolation to dirty read;
delete from clearance
where mess_sent_time is null
and mess_recv_time is null
and clear_date < today - 14;
delete from flight
where flight_arr_date < today - 30;
delete from batch
where current - batch_time > 2 units day;
select hawb_no from hawb
where pcs_checked = 0 and pcs_scanned = 0
and current - create_time > 35 units day
into temp del_hawb with no log;
unload to $BASE/dat/hawb2.$DATE select *
from hawb2 where hawb_no in
(select hawb_no from del_hawb);
delete from hawb2 where hawb_no in
(select hawb_no from del_hawb);
unload to $BASE/dat/hawb.$DATE select *
from hawb where hawb_no in
(select hawb_no from del_hawb);
delete from hawb where hawb_no in
(select hawb_no from del_hawb);
drop table del_hawb;
select rowid from mawb
where current - flight_arr_date > 35 units day
and not exists
( select hawb.hawb_no from hawb
where hawb.mawb_no = mawb.mawb_no
and hawb.flight_no = mawb.flight_no
and hawb.flight_arr_date = mawb.flight_arr_date
)
into temp del_mawb with no log;
unload to $BASE/dat/mawb.$DATE select *
from mawb where rowid in
(select * from del_mawb);
delete from mawb
where rowid in
(select * from del_mawb);
drop table del_mawb;
set isolation to dirty read;
update statistics;!
###############################
result of log file :
###############################
Isolation level set.
18 row(s) deleted.
42 row(s) deleted.
232 row(s) deleted.
24 row(s) retrieved into temp table.
24 row(s) unloaded.
24 row(s) deleted.
24 row(s) unloaded.
24 row(s) deleted.
Table dropped.
6 row(s) retrieved into temp table.
6 row(s) unloaded.
6 row(s) deleted.
Table dropped.
Isolation level set.
215: Cannot open file for table (gisadm.del_mawb).
110: ISAM error: end or beginning of the file.
Error in line 1Near character position 16