I am trying to insert a single row into an external MS SQL Server table. I have set up the SQL Gateway. The insert query runs, but it is inserting an extra row each time.
What am I missing:
#include %occInclude
set gc = ##class(%SQLGatewayConnection).%New()
if gc = $$$NULLOREF quit $$$ERROR($$$GeneralError, "Can not create sql gateway connection.")
set pDSN = "xxxx"
set usr = "xxx"
set pwd = "xxxx"
set sc = gc.Connect(pDSN,usr,pwd,0)
if $$$ISERR(sc) quit sc
if gc.ConnectionHandle = "" quit $$$ERROR($$$GeneralError,"connection failed")set sc=gc.AllocateStatement(.hstmt)
if $$$ISERR(sc) quit sc