2 # Create t1,t2,t3,t4 and t5 table in target Database
3 # Cache all tables specifying different caching modes
4 # Use -S option to display cache information about each table
5 # drop all tables and use -S option
6 # It should display "no cached tables"
8 input
=${PWD}/cache
/CacheTable
/createtable.sql
12 REL_PATH
=${PWD}/cache
/CacheTable
15 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
17 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
18 DS
="$DSN $DBUSER $PASSWORD"
19 rm -f /tmp
/csql
/csqlds.conf
20 touch /tmp
/csql
/csqlds.conf
21 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
27 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
28 isql
$DS < ${REL_PATH}/createtable.sql
> /dev
/null
2>&1
32 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
36 rm -f /tmp
/csql
/csqltable.conf
37 touch /tmp
/csql
/csqltable.conf
40 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t1
>/dev
/null
2>&1
43 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
44 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
48 #cachetable with condition,"-c" option
49 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t2
-c "t2f1=11" > /dev
/null
2>&1
53 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
54 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
58 #cache table with "-f" option
59 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t3
-f "t3f1" > /dev
/null
2>&1
63 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
64 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
68 # cache table with "-d" option
69 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t4
-D > /dev
/null
2>&1
73 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
74 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
78 #cache table with condition, field list and direct option
79 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t5
-c "t5f1=11" -f "t5f2" -D > /dev
/null
2>&1
83 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
84 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
88 #describe the cache tables -S option
90 echo "(1). cachetable -S"
91 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-S
94 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
95 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
99 #Describe the specific cache table with -S option
100 echo "(2). cachetable -t t5 -S"
101 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t5
-S
104 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/droptable.sql
> /dev
/null
2>&1
105 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
106 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
110 rm -f /tmp
/csql
/csqltable.conf
111 touch /tmp
/csql
/csqltable.conf
113 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/droptable.sql
> /dev
/null
2>&1
114 isql
$DS < ${REL_PATH}/droptable.sql
>/dev
/null
2>&1
116 #use -S option when there is no table present in cache
117 echo "(3). cachetable -S (Cross Verification)"
118 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-S
121 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
125 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE