3 # 3. Create table t1 in CSQL with all supported data types in it. and insert 10 records in it.
4 # Note that in this test case the table is not cached in csql and is present in csql
5 # insert 10 more records using csql tool.
6 # select records with WHERE clause containing parameters for all the fields with different data types.
7 # update all fields with WHERE clause on primary key
8 # delete records with WHERE clause on all fields
10 #Run this test only under csql/test or on this directory.
11 #Otherwise, it may fail
12 input
=${PWD}/cache
/Gateway
/mysqlinputtest1.sql
16 REL_PATH
=${PWD}/cache
/Gateway
20 # edit /tmp/csql/csqltable.conSQL_CONFIG_FILE /tmp/csql.conf
21 cp $REL_PATH/csql.conf
/tmp
/csql.conf
22 echo CSQL_SQL_SERVER
=true
>>/tmp
/csql.conf
23 echo PORT
=6004 >>/tmp
/csql.conf
24 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
25 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
26 DS
="$DSN $DBUSER $PASSWORD"
27 rm -f /tmp
/csql
/csqlds.conf
28 touch /tmp
/csql
/csqlds.conf
29 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
35 rm -f /tmp
/csql
/csqltable.conf
36 touch /tmp
/csql
/csqltable.conf
38 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
42 if [ $DSN = "oracle" ]
44 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/orainput_t1.oracle
>/dev
/null
2>&1
46 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/csqlinputtest3.sql
>/dev
/null
2>&1
51 echo "Unable Start Server"
55 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/selectstar.sql
56 isql
$DS < $REL_PATH/selectstar.sql
2>&1
59 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
63 if [ $DSN = "oracle" ]
65 for a
in 51 52 53 54 55
67 echo "insert into t1 values($a,'KKK');"
68 done >> $REL_PATH/oracsqlinputt1.sql
69 echo "select * from t1 where f1 in(10,30,50,54);" >> $REL_PATH/oraselect.sql
70 echo "select * from t1 where f1 between 20 and 54;" >> $REL_PATH/oraselect.sql
71 echo "update t1 set f2='LLL' where f1=20;" >> $REL_PATH/oraupdate.sql
72 echo "delete from t1 where f2='BBB';" >> $REL_PATH/oradelete.sql
73 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/oracsqlinputt1.sql
>/dev
/null
2>&1
74 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/oraselect.sql
75 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/oraupdate.sql
>/dev
/null
2>&1
76 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/oradelete.sql
>/dev
/null
2>&1
77 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/selectstar.sql
81 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/csqldb2inputtest3a.sql
>/dev
/null
2>&1
82 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/select.sql
83 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/db2update.sql
>/dev
/null
2>&1
85 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/csqlinputtest3a.sql
>/dev
/null
2>&1
86 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/select.sql
87 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/update.sql
>/dev
/null
2>&1
89 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/delete.sql
>/dev
/null
2>&1
90 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6004 -g -s $REL_PATH/selectstar.sql
93 isql
$DS < $REL_PATH/selectstar.sql
2>&1
96 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
100 isql
$DS < $REL_PATH/dropt1t2t3.sql
> /dev
/null
2>&1
101 rm -f $REL_PATH/ora
*.sql
102 rm -f /tmp
/csql
/csqltable.conf
103 touch /tmp
/csql
/csqltable.conf
105 ipcrm
-M 1199 -M 2277
106 kill `ps -el | grep csqlsqlserver | gawk -F" " '{ print $4 }'`