× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 11/12/2015 2:59 PM, Darryl Freinkel wrote:
I have the situation the a column has values that are sometimes numeric and
sometimes character. Example: 22.

The value brought in is 22.00.

Is this a case where I need to override the system value and if I know it's
character use the string value?

Fortunately, the cell itself knows if it is holding a character or a
number. I think this example came from Scott:

// based on the cell type as reported by POI, extract the value
// these WHERE clauses extract to
// generic fields named tempFloat and tempChar
// which will be assigned to the appropriate DB2 fields
type = SSCell_getCellType(cell);
tempChar = '';
tempFloat = 0.0;

// what is the cell type?
select;
when type = CELL_TYPE_STRING;
tempChar = String_getBytes(SSCell_getStringCellValue(cell));

when type = CELL_TYPE_FORMULA;
// evaluate the formula
newCellValue = evaluate(formulaEvaluator: cell);
newType = CellValue_getCellType(newCellValue);
if newType = CELL_TYPE_NUMERIC;
tempFloat = CellValue_getNumberValue(newCellValue);
else;
// handle Formula error
endif;

when type = CELL_TYPE_NUMERIC;
tempFloat = SSCell_getNumericCellValue(cell);

when type = CELL_TYPE_BOOLEAN;
tempBoolean = SSCell_getBooleanCellValue(cell);

other;
// handle as-yet unknown cell type

endsl;



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.