stored-proceduresdb2ibm-midrange

IBMi SQL stored procedures - how to set comma / decimal point in numbers


I am working on IBMi where whole number and fraction is represented by comma instead of decimal point (eg: 123,45 instead of 123.45).

This seem to be causing SQL functions to fail.

Example:

 SUBSTR(MySTRING,1,1)

SQL0104 30 12 Position 1 Token ,1 was not valid. Valid tokens: ) ,.

STRSQL provides a session value for this (Decimal point = *Comma, *Period, *Job...)

Is there header value or environment value for SQL stored procedures that would make a decimal and commas behave as US/UK users expect?


Solution

  • You need a space between parameters... when the decimal separator is *COMMA

    SUBSTR(MySTRING, 1, 1)