Question
· Nov 28, 2019

Getting Parameters cleanly from Property Definition

HI,

I have made a query with class definitions and all their properties and put them in a view.

All is good besides Parameters is showing junk characters. Is there a way to do it cleanly besides getting into the code??

 

SELECT 
CC.ID As CompiledClass, 
CC.SqlSchemaName,
CC.SqlTableName,
CP.Name As PropertyName, 
CP.SqlFieldName, 
CP.Type,
PD.Parameters

FROM %Dictionary.CompiledProperty CP
JOIN %Dictionary.CompiledClass CC
ON CP.Parent = CC.ID

JOIN %Dictionary.PropertyDefinition PD
ON PD.ID = CP.ID1

Discussion (11)1
Log in or sign up to continue

Call this sqlproc passing class and prop names:

ClassMethod Params(class, prop) As %String [SQLProc]
{
    set result = ""
    set param = ""
    for {
        set param = $$$defparamMemberNext(class,$$$cCLASSproperty,prop,$$$cPROPparameter,param)
        quit:(param ="")
        set value = $$$defMemberArrayGet(class,$$$cCLASSproperty,prop,$$$cPROPparameter,param)
        set result = result _ param _ "=" _ value _ ","
    }
    quit result
}

I resolved it by following the sql proc method and then creating a view with that sql proc within the query.

An object script function seems to be the only way to make it work.

Eduard, your code didn't work most probably because we have an older version. All I did was iterate through all the params and add the key and value in output
Thanks for your help