×
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.