Why <UNDEFINED> on SQL
I have an sql statement that I would like to execute but I get the error
"zSearchChanges+5^MergeHyland.TypeTwoUtil.1 *KeyID"
and here is my sq
l "&sql(SELECT Key INTO :KeyID FROM MergeHyland.TypeTwoDimesionalTable WHERE Key = :Key)" any ideas why
My guess is you're not testing the SQLCODE variable's result before you try and access the KeyID host variable.
Docs here.
You should check the SQLCODE from running that statement. If SQLCODE is 100 (no record exists with the specified key), KeyID may not be defined.
See: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_esql#GSQL_esql_hvars