User bio
404 bio not found
Member since Feb 1, 2021
Posts:
Replies:
@Theo Stolker I'm not sure what you mean by, "I never liked the different behavior of embedded sql, like when you have no result, you have no easy way to find that out." When you run an embedded query, it sets a variable called SQLCODE. If SQLCODE = 0, query completed with results. If SQLCODE = 100, query completed with no results. If SQLCODE < 0, there was an error with the query.
FYI, in your "Building SQL In Strings" section, you can also still use %SQL.Statement like this:
set stmt = ##class(%SQL.Statement).%New()
// Note the question mark in the query.
set query = "SELECT Name, Age FROM Patient WHERE ID=?"
set sc = stmt.%Prepare(query)
// You can add error handing here if the above status results in an error
// Providing variables to the %Execute method will insert them where the question marks are in the query, in order
set rs = stmt.%Execute(id)
Open Exchange applications:
Certifications & Credly badges:
David has no Certifications & Credly badges yet.
Global Masters badges:







Followers:
Following:
David has not followed anybody yet.
You can create and log exceptions so that they show up in the application error logs in the SMP. That's how I prefer to do things.