adding test scripts
[csql.git] / test / adapter / Select / test007na.ksh
blob94ad31407fca31e09669631564a12a2cf6dea131
1 #!/bin/ksh
2 #create table t1 with two fields,
3 #insert 10 rows into the table ,
4 #call fetch without call execute,it returns NULL.
7 CSQL_CONF=${PWD}/adapter/Select/csql.conf
8 REL_PATH=.
9 if [ -s "$CSQL_CONF" ]
10 then
11 REL_PATH=${PWD}/adapter/Select
14 rm -f /tmp/csql.conf
15 cp $REL_PATH/csql.conf /tmp/csql.conf
16 echo CSQL_SQL_SERVER=true >>/tmp/csql.conf
17 #echo PORT= >>/tmp/csql.conf
18 export CSQL_CONFIG_FILE=/tmp/csql.conf
19 if [ -z "$DBUSER" ]
20 then
21 echo DSN=$DSN >>$CSQL_CONFIG_FILE
22 if [ $DSN = "psql" ]
23 then
24 echo TARGET_DATABASE=postgres >>$CSQL_CONFIG_FILE
25 else
26 echo TARGET_DATABASE=mysql >>$CSQL_CONFIG_FILE
28 DS=$DSN
29 else
30 echo DSN=$DSN >>$CSQL_CONFIG_FILE
31 echo DBUSER=$DBUSER >>$CSQL_CONFIG_FILE
32 echo PASSWORD=$PASSWORD >>$CSQL_CONFIG_FILE
33 echo TARGET_DATABASE=oracle >>$CSQL_CONFIG_FILE
34 DS="$DSN $DBUSER $PASSWORD"
37 $CSQL_INSTALL_ROOT/bin/csqlsqlserver >/dev/null 2>&1 &
38 pid=$!
39 sleep 3
40 ${REL_PATH}/selecttest7na
41 if [ $? -ne 0 ]
42 then
43 kill -9 $pid
44 exit 1;
46 rm -f /tmp/csql.conf
47 kill -9 $pid
48 exit 0;