Getting count of rows of sql lite table

Hello, I am writing information to a sqllite database. I need to be able to count the current rows of the table first. Can somebody tell me how to do this?

My code to write is this

set loc to space & "~/Library/Preferences/PekiTest.db" & space
		set head to "sqlite3" & loc & quote
		set tail to quote
		set tblName to "XML_Submission"
		set dbhome to path to preferences folder
		set InsertValues to "insert into XML_Submission values(" & quoted form of (JobNameField's stringValue() as string) & ", " & quoted form of (descriptionField's stringValue() as string) & "); "
		do shell script head & InsertValues & tail

I dont know if you are still looking for this, but take a look at my post
I am getting a row count (well the first column is an incrementing number) and it is for mySQL.