#!/bin/csh

# Initialize the Conductor Proc_Test.Test pipeline.
#
# initialize_tables,v 1.2 2005/11/12 09:35:56 castalia Exp

set Initialize = 0
@ Records = 16

while ($#argv)
	switch ($1)
		case -[Ii]*:
			set Initialize = 1
			shift
			breaksw
		case -[Rr]*:
			shift
			if (! $#argv) then
				echo "Missing record count."
				exit 1;
			endif
			@ Records = $1
			shift
			breaksw
	endsw
end

#	Procedures table. Always reinitialized.
mysql < Proc_Test.Test_Procedures-Create.SQL

if ($Initialize) \
	mysql -e 'DROP TABLE IF EXISTS Proc_Test.Test_Sources;'

while ($Records)
	mysql < Proc_Test.Test_Sources-Create.SQL
	@ Records--
end

exit 0
