|
From: John Yeung <gallium.arsenide@xxxxxxxxx>returning
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Date: 07/14/2016 11:38 AM
Subject: Re: [IBMiOSS] Field Length using node.js
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxx>
On Thu, Jul 14, 2016 at 12:01 PM, Kevin Adler <kadler@xxxxxxxxxx> wrote:
Here's what it's reporting for the lengths:
ITITEM=7
ITIDESC=8
ITPRICE=8
ITQTY=6
The Node.js developer confirmed my suspicion that fieldWidth is
returnsthe length of the column name (plus a null terminator). It really
questionthe *actual* length of the column name in case of truncation. I
name.why this might be useful to a Node.js developer, since I would have
suspected that the node db adapter would never truncate the column
Interesting. I question why this might be useful to ANY developer,
because, really, who ever needs to know the length of the field NAME?
At least, when would you ever want to know the length of the (full,
untruncated) name, but NOT want the (full, untruncated) name itself?
fieldScale
fieldPrecise will return the precision (total column width) and
(digits after the decimal) will return the scale.
So for the table in question,
ITITEM should return scale = 15, precision = 0
ITIDESC should return scale = 30, precision = 0
ITPRICE should return scale = 9, precision = 2
ITQTY should return scale = 9, precision = 0
I guess you meant precision = 15, scale = 0 for ITITEM, etc.
John Y.
As an Amazon Associate we earn from qualifying purchases.
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.