User bio
404 bio not found
Member since Apr 14, 2022
Replies:

Try this:

ClassMethod GetTreeInfo(
  pRoot As %String,
  Output pTree,
  ByRef pParmsAs %Status
{
  Set MyId=..GetId,pos=1
  &Sql(Select Name,ID into :name,:id from MSDS_COM.Loc where Parent=:MyId)
  Set:SQLCODE (name,id)=""
  if pRoot=""
  {
    Set pTree(0,"ch",1) = ""
    Set pTree(1) = $LB(name,id,1,"","")
  }
  Quit $$$OK
}

For further examples, see the class ZENTest.DynaTreeTest in the SAMPLES namespace.

Through %ZEN.proxyObject is unlikely to work, since the q parameter cannot be disabled in this case

q - output numeric values unquoted even when they come from a non-numeric property

Use your own class, for example:

Class dc.proxyObject Extends %RegisteredObject
{

Property ID As %VarString;

}
set object ##class(dc.proxyObject).%New()
set object.ID = 123456

set ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.json,object,,,,"aelotw")

Output:

{
  "ID":"123456"
}

I do not observe any differences in the behavior of xDBC and Portal.

Given:

Class dc.test Extends %Persistent
{

Property s1 As %String(MAXLEN 2TRUNCATE 1);

Property s2 As %String(MAXLEN 2);
}
  • insert into dc.test(s1,s2)values('abc','ab')
    Result
    ID s1 s2
    1 ab ab
  • insert into dc.test(s1,s2)values('abc','abc')

    Result for any JDBC/ODBC tools (DBVisualizer, SQL Data Lens, etc.):

    [SQLCODE: <-104>:<Field validation failed in INSERT>]
    <Field 'dc.test.s2' Truncation (Varchar Value: 'abc ...' Length: 3) > maxlen:  (2)>]

    Result for Management Portal:

    [SQLCODE: <-104>:<Field validation failed in INSERT>]
    
      [%msg: <Field 'dc.test.s2' (value 'abc') failed validation>]
Certifications & Credly badges:
Vitaliy has no Certifications & Credly badges yet.
Global Masters badges:
Vitaliy has no Global Masters badges yet.
Followers:
Following:
Vitaliy has not followed anybody yet.