proc nextRec {} {

	global pgHan pgCt DB table moreRec sybmsg

	case $DB in {
	{SYB} {
		set rec [sybNext 1]
		if {$sybmsg(nextrow) == "NO_MORE_RESULTS"} {
			set moreRec 0
		}
	}
	{PG} {
		set rec [pgNext $pgHan]
		if {[lindex $rec 0] == "ERROR"} {
			set moreRec 0
			set pgCt 0
			return ""
		}
		incr pgCt -1
		if {$pgCt == 0} {set moreRec 0}
	}
	{default} {
		puts stderr "Sorry, Oracle not yet supported."
	}
	}
	return "$rec"
}
