• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DBTag print/renders sql query statement

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic