Hi. this is my first post so please be gentle...I am writing an application that will allow a user to submit a work request. This request gets a number.... This number is recorded in table A. Under each request number, there can be several requests.Example.... Tracking number 2000 can have information coming in.... sequence 01, 02, 03, 04. This is in Table B.The Code to generate a new Request number is easy, its the sequence under each that is confusing me. In the Query analyzer I can get it to work.DECLARE @newseq intSET @newseq=(select max (suffixSeq) from incomingdata where (tagID) = '2004' AND (suffix)= 'ff')SET @newseq =@newseq + 1select @newseq
this is the table of what I would LIKEID suffix TagId suffixseq1 en 2000 012 ff 2000 013 en 2001 014 en 2000 025 en 2000 03<sql:query var="queryName" dataSource="jdbc/PPOefab" >SET NOCOUNT ONINSERT into incomingdata (suffix,tagID,tcaeitemnumb,tcaeitemrev,descriptofdata,custID)Values ('${param.suffix}', '${param.projnum}', '${param.tcaeNum}', '${param.tcaeRevLevel}', '${param.dataDescription}','${sessionScope.svID}')SELECT NewIdNumber = @@IDENTITYSET NOCOUNT OFF</sql:query><c:out value="${queryName.rows[0].NewIdNumber}"/><c:set var="idnumb" value="${queryName.rows[0].NewIdNumber}"/><sql:query var="new" dataSource="jdbc/PPOefab">SELECT MAX(suffixSeq) as maxseq FROM incomingdata WHERE tagID = ? AND suffix= ?<sql:param value="${param.projnum}"/><sql:param value="${param.suffix}"/></sql:query><c:out value="${new.rows[0].maxseq}"/><c:set var="newseq" value="${new.rows[0].maxseq + 1}"/><sql:update dataSource="jdbc/PPOefab">UPDATE incomingdataSET suffixSeq = '${newseq}'WHERE ID = ? <sql:param value="${idnumb}"/></sql:update>
Why is it the query Analyzer makes it work but my JSTL code doesnt?Please help.