3 # Create 't1' table with f1 int, f2 char(10) ,primarykey(f1) in target database
4 # Insert some records with null values
5 # Select from CSQL with -g .It should give actual data as in target database
6 # it should be unloaded by -u option
8 input
=${PWD}/cache
/Gateway
/complex.sql
12 REL_PATH
=${PWD}/cache
/Gateway
15 echo "create table t1 (f1 int,f2 char(10),primary key(f1));" >${REL_PATH}/t1create.sql
19 echo "insert into t1 values($a,'INDIA$a');"
20 echo "insert into t1 values($a+10 , NULL);"
21 done>>${REL_PATH}/t1create.sql
22 echo "t1create.sql file created"
23 echo "select * from t1;">${REL_PATH}/sel.sql
24 echo "select file created"
25 isql
$DSN < ${REL_PATH}/t1create.sql
>/dev
/null
2>&1
28 rm -f ${REL_PATH}/sel.sql
29 rm -f ${REL_PATH}/t1create.sql
32 export CSQL_CONFIG_FILE
=$REL_PATH/csql.conf
33 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql.db
34 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
35 echo "drop table t1;">${REL_PATH}/dp.sql
36 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
40 echo "Select * from t1 in CSQL"
41 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/sel.sql
44 rm -f ${REL_PATH}/sel.sql
45 rm -f ${REL_PATH}/t1create.sql
46 isql
$DSN < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
50 echo "Checking for table created or not"
51 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-l
54 rm -f ${REL_PATH}/sel.sql
55 rm -f ${REL_PATH}/t1create.sql
56 isql
$DSN < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
60 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql.db
61 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
62 isql
$DSN < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
64 rm -f ${REL_PATH}/dp.sql
65 rm -f ${REL_PATH}/sel.sql
66 rm -f ${REL_PATH}/t1create.sql