Suppress 0 in callablestatement
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jayanthi_Vilayanur
Posted On:   Wednesday, April 9, 2003 10:41 AM

When i give the following command, i get the output as 0, if there is no value in the database.



QTYOPERATINGDAYSLUNCH = callStmt.getInt(5);



I attach the result to the textbox as follows:



<%=QTYOPERATINGDAYSLUNCH %>'>




I dont want to display '0' in the text box. How can i achieve this goal while retrieving from callablestatement




thanks in advance

Jayanthi

Re: Suppress 0 in callablestatement

Posted By:   Roger_Hand  
Posted On:   Wednesday, April 9, 2003 10:23 PM

A quick and easy way ...
QTYOPERATINGDAYSLUNCH = callStmt.getInt(5);

/* Convert to string, or empty string if 0 */
String strQty
= (QTYOPERATINGDAYSLUNCH > 0) ? Integer.toString(QTYOPERATINGDAYSLUNCH) : "";

strQty
%>'>
About | Sitemap | Contact