3 # create t1 table with some records in target DB.
4 # cache it with -c and -f option
5 # Insert some records which satisfy the cache condition
6 # Insert some records which do not satisfy the cache condition
7 # Reload table with -r option
8 # It should get all records which satisfy the condition for specified fields
10 # AUTHOR : Jitendra Lenka
12 input
=${PWD}/cache
/CacheTable
/
16 REL_PATH
=${PWD}/cache
/CacheTable
19 cp $CSQL_CONFIG_FILE /tmp
20 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
21 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
22 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
23 DS
="$DSN $DBUSER $PASSWORD"
24 rm -f /tmp
/csql
/csqlds.conf
25 touch /tmp
/csql
/csqlds.conf
26 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
31 isql
$DS < ${REL_PATH}/fmodeinsert.sql
>/dev
/null
2>&1
37 rm -f /tmp
/csql
/csqltable.conf
38 touch /tmp
/csql
/csqltable.conf
40 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-c "f1=1" -f "f1,f3,f5"
43 rm -f /tmp
/csql
/csqltable.conf
44 touch /tmp
/csql
/csqltable.conf
46 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
47 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
51 isql
$DS < ${REL_PATH}/frecords.sql
>/dev
/null
2>&1
53 # again reload table with -r option.
54 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-r >/dev
/null
2>&1
57 rm -f /tmp
/csql
/csqltable.conf
58 touch /tmp
/csql
/csqltable.conf
60 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
61 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
65 #after reload, select from t1
66 echo "after reload , select * from t1;"
67 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/selectt1.sql
70 rm -f /tmp
/csql
/csqltable.conf
71 touch /tmp
/csql
/csqltable.conf
73 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
74 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
78 rm -f /tmp
/csql
/csqltable.conf
79 touch /tmp
/csql
/csqltable.conf
80 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
81 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1