fixing compilation error
[csql.git] / test / cache / CacheTable / test023.ksh
blob5de8754d1cebf451946565933558ff0100747bca
1 #!/bin/sh
2 # Test Case
3 #23. create table 't1' with 5 fields in Target DB with records.
4 # Load the table 't1' in field mode in csql without condition.
5 # Example : select f1,f2,f3 from t1 ;
6 # Select query executes the selected records from csql.
8 #Run this only under csql/test or in this directory, otherwise it will fail.
10 #Author : Jitendra Lenka
11 input=${PWD}/cache/CacheTable
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
18 isql myodbc3 < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1
19 if [ $? -ne 0 ]
20 then
21 exit 1;
24 echo Table t1 created with 5 records in target DB.
26 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
27 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
29 # cache from target to csql with -f option.
30 echo "cachetable -t t1 -f \"f1,f2,f3\" "
32 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f "f1,f2,f3"
33 if [ $? -ne 0 ]
34 then
35 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
37 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
38 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
39 exit 2;
42 echo "select * from t1;"
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql
45 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
46 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
48 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
49 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
51 exit 0;