 <!--------------------------------------------------------------------------------------------->
 
 <cfif action is "create_batch">
+	<cfquery name="k" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+		select someRandomSequence.nextval k from dual
+	</cfquery>
+
 	<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
 		insert into genbank_batch (
 			genbank_batch_id,
 			created_agent_id,
 			batch_name
 		) values (
-			someRandomSequence.nextval,
+			#k.k#,
 			#session.myAgentID#,
 			'#batch_name#'
 		)
 	</cfquery>
-	<cflocation url="genbank_submit.cfm?action=edbatch&batch_name=#batch_name#" addtoken="false">
+	<cflocation url="genbank_submit.cfm?action=edbatch&batch_id=#k.k#" addtoken="false">
 </cfif>
 <!--------------------------------------------------------------------------------------------->
 

<cfif action is "edbatch">
	<cfoutput>
		<cfquery name="b" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			select * from genbank_batch where batch_name='#batch_name#'
		</cfquery>
		<cfdump var=#b#>
	</cfoutput>
</cfif>
<!--------------------------------------------------------------------------------------------->

			select * from genbank_batch order by batch_name
		</cfquery>
		<cfloop query="d">
			<br><a href="genbank_submit.cfm?action=edbatch&batch_id=#batch_id#">edit batch #batch_name#</a>

		</cfloop>
	</cfoutput>
