3 # Create table t1 having two integer field f1 ,f2 with primary key f1 and create table t2 having two integer field f1,f2 with foreign key f1 refers t1 (f1). Insert some record into t2 .It should fail to insert record as PK table has no record.
5 QUITFILE
=${PWD}/tools
/csql
/quit.sql
9 REL_PATH
=`pwd`/tools
/csql
13 echo "drop table t2;" >${REL_PATH}/drp1.sql
14 echo "drop table t1;" >>${REL_PATH}/drp1.sql
16 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/insertat_child_wthout_parent.sql
19 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drp1.sql
20 rm -f ${REL_PATH}/drp1.sql
24 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drp1.sql
27 rm -f ${REL_PATH}/drp1.sql
31 rm -f ${REL_PATH}/drp1.sql