Question
· Feb 24, 2022

Parameter in embedded SQL

Hello, first question for me:

Is there a way to use a class Parameter in embedded SQL without having to declare a local variable, in a similar way to how it is done with Property by preponing i% as described here. See my example:

Class Test.Test Extends %RegisteredObject
{ 
Parameter MyParam = "1";  
Property MyProperty;  
(...)
Method PerformQuery() {
    set myParamLocalVar = ..#MyParam //this is what I would like to avoid
    &sql(SELECT * FROM MY_TABLE
        WHERE MY_PROPERTY = :i%MyProperty
        AND MY_PARAM = :myParamLocalVar)
    (...)
}
}
Product version: IRIS 2020.1
Discussion (1)1
Log in or sign up to continue