I am attempting to use DBTag and have run into an issue when no records exist for a query request.
When no records are returned for the resultset does anyone know why the SQL query statement will be printed / how to suppress this?? It is an intermittent problem that seems to occur when all the records are deleted and the page is refreshed.
As an example from the code snippet below - When the problem occurs I will see "select ContactFN, ContactLN, from Contacts where SubscriberNumber = 1 order by ContactLN" printed above my table column header.
code snippet:
<sql:connection id="conn1">
<sql:url><%=strDatabaseURL%></sql:url>
<sql
river><%=strDatabaseJDBCDriver%></sql
river>
<sql:userId><%=strDatabaseUserName%></sql:userId>
<sql
assword><%=strDatabasePassword%></sql
assword>
</sql:connection>
<sql
reparedStatement id="stmt1" conn="conn1">
<sql:query>
select ContactFN,
ContactLN,
from Contacts
where SubscriberNumber = <%=strCustomerID%> order by ContactLN
</sql:query>
<TABLE WIDTH="720" BORDER="0" CELLSPACING="2" CELLPADDING="2" ID=TableDataGrid>
<thead>
<TR ALIGN="CENTER" >
<TD WIDTH="150" HEIGHT="25" CLASS="categories" BACKGROUND="_images/black2_bg.gif">First Name </TD>
<TD WIDTH="150" HEIGHT="25" CLASS="categories" BACKGROUND="_images/black2_bg.gif">Last Name</TD>
</TR>
</thead>
<%-- loop through the rows/query --%>
<sql:resultSet id="rset2">
<TR ALIGN="CENTER" CLASS="copy2" BGCOLOR=\"#CCCCCC\" RECNUM=<sql:getColumn position="6"/> >
<td <%=strTableStyle%> >
<sql:getColumn position="1"/>
<sql:wasNull></sql:wasNull>
</td>
<td <%=strTableStyle%> >
<sql:getColumn position="2"/>
<sql:wasNull></sql:wasNull>
</td>
</tr>
</sql:resultSet>
<tr>
<td colspan="2">
<sql:wasEmpty>
No records found
</sql:wasEmpty>
</td>
</tr>
</sql
reparedStatement >
</table>