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 cp $REL_PATH/csql.conf
/tmp
/csql.conf
16 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
18 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
19 DS
="$DSN $DBUSER $PASSWORD"
20 rm -f /tmp
/csql
/csqlds.conf
21 touch /tmp
/csql
/csqlds.conf
22 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
28 if [ $DSN = "sybase" ]
30 echo "create table t1 (f1 int ,f2 char(10) NULL,primary key(f1));" >${REL_PATH}/t1create.sql
33 echo "create table t1 (f1 int NOT NULL ,f2 char(10) ,primary key(f1));" >${REL_PATH}/t1create.sql
35 echo "create table t1 (f1 int,f2 char(10),primary key(f1));" >${REL_PATH}/t1create.sql
39 echo "insert into t1 values($a,'INDIA$a');"
40 echo "insert into t1 values($a+10 , NULL);"
41 done>>${REL_PATH}/t1create.sql
42 echo "t1create.sql file created"
43 echo "select * from t1;">${REL_PATH}/sel.sql
44 echo "select file created"
45 isql
$DS < ${REL_PATH}/t1create.sql
>/dev
/null
2>&1
48 rm -f ${REL_PATH}/sel.sql
49 rm -f ${REL_PATH}/t1create.sql
53 rm -f /tmp
/csql
/csqltable.conf
54 touch /tmp
/csql
/csqltable.conf
55 echo "drop table t1;">${REL_PATH}/dp.sql
57 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
61 echo "Select * from t1 in CSQL"
62 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/sel.sql
65 rm -f ${REL_PATH}/sel.sql
66 rm -f ${REL_PATH}/t1create.sql
67 isql
$DS < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
71 echo "Checking for table created or not"
72 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-l
75 rm -f ${REL_PATH}/sel.sql
76 rm -f ${REL_PATH}/t1create.sql
77 isql
$DS < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
81 rm -f /tmp
/csql
/csqltable.conf
82 touch /tmp
/csql
/csqltable.conf
83 isql
$DS < ${REL_PATH}/dp.sql
>/dev
/null
2>&1
85 rm -f ${REL_PATH}/dp.sql
86 rm -f ${REL_PATH}/sel.sql
87 rm -f ${REL_PATH}/t1create.sql