sitemule / noxDB

Not only XML. SQL,JSON and XML made easy for IBM i
MIT License
41 stars 20 forks source link

json_SetInt procedure ignore the leading zeroes #80

Open RootDeepak opened 1 year ago

RootDeepak commented 1 year ago

How can we preserve leading zeros when using the "json_SetInt" procedure to set an integer value in the JSON object?

NielsLiisberg commented 1 year ago

Use the json_setvalue using an edit Word or edit code RPG BIF . Then use the enum LITERALS to “not” quote the data as in a string.

But if it is ok to have it as a string - then use the same approach as above but with json_setStr()

tir. 25. jul. 2023 kl. 09.01 skrev RootDeepak @.***>:

How can we preserve leading zeros when using the "json_SetInt" procedure to set an integer value in the JSON object?

— Reply to this email directly, view it on GitHub https://github.com/sitemule/noxDB/issues/80, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHRBMTBRVRS6EXTTIXLXR5VJPANCNFSM6AAAAAA2WTHEWI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

RootDeepak commented 1 year ago

Thank you Niels for your response.

NielsLiisberg commented 1 year ago

First use this :

jx_setValuePointer jx_setValue ( Pointer node, Pointer nodePath, Pointer value, UnsignedInteger nodeType)

Sets the passed value to the node pointed to by the passed path expression. Parameters

  1. Pointer [value] — Node
  2. Pointer [string, value] — Node path expression
  3. Pointer [string, nopass, value] — Value (default: empty string)
  4. UnsignedInteger (5) [nopass, value] — Node type (see node type constants, default JX_UNKNOWN)

Return ValuePointer — Changed node

using the fourth parameter as JX_LITERAL

On Tue, Jul 25, 2023 at 10:10 AM Deepak Kumar Mishra < @.***> wrote:

Hi Niels, I utilized the EDITC RPG BIF in json_setvalue to set a value, but could you provide further details on how to employ an enum LITERALS to prevent the data from being treated as a string?

— Reply to this email directly, view it on GitHub https://github.com/sitemule/noxDB/issues/80#issuecomment-1649337451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHR6DQFGNIHZZYKCLYTXR55QBANCNFSM6AAAAAA2WTHEWI . You are receiving this because you commented.Message ID: @.***>

RootDeepak commented 1 year ago

Thanks, Neils.