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



Chuck,

The V5R4 SQL Reference Manual SQL Syntax Diagram for Cast and Dec require the comma. Is the comma optional or interpreted differently with internationalization? If I'm going to write portable SQL code how best to write it for i18n?

Thanks,
Paul Morgan

Principal Programmer Analyst
IT Supply Chain/Replenishment

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Thursday, August 04, 2011 9:10 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: SQL UDF not found MADNESS

On 04-Aug-2011 12:44 , Charles Wilt wrote:

Note also the space included after the comma so the syntax remains
valid where decimal separator is comma. Including the blank space after
the comma increases the portability of the SQL; e.g. someone in Spain
could copy\paste the above statement snippet without then also having to
add the missing spaces to the quoted snippet, in order to make the SQL
functional. However for the special case of no scale, per zero
specified on each scale provided, then even better to just drop both the
comma and the scale specification entirely, irrespective of the means
utilized to effect the casting to decimal; e.g. showing both forms of
casting with zero-scale defaulted:

select TRUEDATE( dec(fldCC, 2) /* scale defaults to zero */
, cast(fldYY as dec(2)) /* scale defaults to zero */
, ...

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.