Skip to content

MakeDecimalForCsv routines return null when value is zero #21

@ameyer66

Description

@ameyer66

The two routines MakeDecimalForCsvNegatives(n) and MakeDecimalForCsvNoNegatives(n) both return a NULL string if the value of 'n' equals zero.
This caused issues in a bulk load when the program tried to load the null data into a field that was set to no nulls.
Fixed it by changing the freturn string to "0" from "" in the two routines in my build.

function MakeDecimalForCsvNegatives, a
    required in aNumber, n
    external function
        IsDecimalNegatives, boolean
    endexternal
proc
.ifdef DBLV11
    if (%IsDecimalNegatives(aNumber))
        freturn %string(aNumber)
.else
    if (aNumber && %IsDecimalNegatives(aNumber))
        freturn %string(aNumber)
.endc
    freturn "0"  ;; fixed this line
endfunction

function MakeDecimalForCsvNoNegatives, a
    required in aNumber, n
    external function
        IsDecimalNoNegatives, boolean
    endexternal
proc
.ifdef DBLV11
    if (%IsDecimalNoNegatives(aNumber))
        freturn %string(aNumber)
.else
    if (aNumber && %IsDecimalNoNegatives(aNumber))
        freturn %string(aNumber)
.endc
    freturn "0" ;;fixed this line
endfunction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions