3 #16. create table t1,t2 in target DB with 10 records.
4 # load t1 table with condition option
5 # load t2 table with condition .
7 # unload the two tables t1,t2 with -u option.
9 # AUTHOR : Jitendra Lenka
11 input
=${PWD}/cache
/CacheTable
/inputtest4.sql
15 REL_PATH
=${PWD}/cache
/CacheTable
18 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
19 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
20 DS
="$DSN $DBUSER $PASSWORD"
21 rm -f /tmp
/csql
/csqlds.conf
22 touch /tmp
/csql
/csqlds.conf
23 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
29 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
30 # create table t1,t2 in target DB.
31 isql
$DS < ${REL_PATH}/create.sql
>/dev
/null
2>&1
34 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
38 echo Table t1 and t2 created
in target DB.
40 rm -f /tmp
/csql
/csqltable.conf
41 touch /tmp
/csql
/csqltable.conf
43 echo "cachetable -t t1"
44 echo "cachetable -t t2 -c \"t2f1<5\" "
46 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
>/dev
/null
2>&1
49 isql
$DS < ${REL_PATH}/dropt1t2.sql
>/dev
/null
2>&1
50 rm -f /tmp
/csql
/csqltable.conf
52 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
56 echo "Table t1 unloaded from CSQL"
58 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t2
-c "t2f1<5" >/dev
/null
2>&1
61 rm -f /tmp
/csql
/csqltable.conf
62 touch /tmp
/csql
/csqltable.conf
64 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
65 isql
$DS < ${REL_PATH}/dropt1t2.sql
>/dev
/null
2>&1
66 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
70 # unload the two tables from csql and remove entry from csqltable.conf
72 echo "Table t2 unloaded from CSQl"
73 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-u >/dev
/null
2>&1
76 rm -f /tmp
/csql
/csqltable.conf
77 touch /tmp
/csql
/csqltable.conf
79 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
80 isql
$DS < ${REL_PATH}/dropt1t2.sql
>/dev
/null
2>&1
82 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
86 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t2
-u >/dev
/null
2>&1
89 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
90 isql
$DS < ${REL_PATH}/dropt1t2.sql
>/dev
/null
2>&1
91 rm -f /tmp
/csql
/csqltable.conf
93 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
97 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1t2.sql
> /dev
/null
2>&1
98 isql
$DS <${REL_PATH}/dropt1t2.sql
>/dev
/null
2>&1
99 rm -f /tmp
/csql
/csqltable.conf
100 touch /tmp
/csql
/csqltable.conf
101 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE