#!/bin/sh

# set global env setting
. /opt/jilroy/checkit//bin/env

if [ "$1" = "" ]
then
	echo	"Usage:truncatetables ALL|table_name"


else

	if [ "$1" = "ALL" ]
	then
	# if all is requested then truncate all repository tables
	# before deleting the base tables
		$RUN_JAVA com.rj.common.database.TableField $APP_CONFIG_FILE
		$RUN_JAVA com.rj.common.database.TruncateTables $APP_CONFIG_FILE $1
		$INSTALLDIR/bin/inittables.sh
	else
		$RUN_JAVA com.rj.common.database.TruncateTables $APP_CONFIG_FILE $1
	fi
fi
