I will definitely agree with @Chi Nguyen-Rettig - it may be pretty helpful for some basic stuff you forgot when you're middle or senior developer and when you know exactly what you're looking for. So it's basically a bit like doing the usual search but without the need to wade through the search results.

But when you're talking about beginners - I see all kinds of things from my students (who for some reason just don't want to open the lecture and prefer to get answers themselves from other sources) that have nothing to do with the reality and don't work most of the time.

All in all, I wouldn't use ChatGPT to write code that does something complicated. But it may or may not be a good source answers for simple questions. And in this case, you still need to understand what's going on to be able to assess the correctness of what you see. Case in point, some spam posts on the Community - people try to cheat and write "articles" using ChatGPT which generates class/package names that don't even exist.

And if you think about it, where does ChatGPT get its answers? From the knowledge base somewhere. So if this data is not there, it can extrapolate and come up with something that may give you general direction but may not work.

Here is a video to illustrate the article: Generating meaningful test data using Gemini

https://www.youtube.com/embed/00g64yDMamw
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

The command doesn't know. That's why you need to check the SQLCODE variable.

If SQLCODE  = 0 then the row exists and it was updated. If SQLCODE  = 100 then the row doesn't exist. If it not equal to either then you have a problem.

Example for Embedded SQL:

 &SQL(update WH.Size
   set Height = 1000
 where %ID = 10)
 write SQLCODE

Example for Dynamic SQL:

 SET myquery = "update WH.Size set Height = 1000 where %ID = 10"
 SET tStatement = ##class(%SQL.Statement).%New()
 SET tStatus = tStatement.%Prepare(myquery)
 SET rset = tStatement.%Execute()
 write rset.%SQLCODE

Not sure what you mean by "if the row exists" in regards with insert. The row does not exist, because you're creating it.