This assertion works so I do know my connection string and so on is sweet:
consequence, err = db.Exec(“INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1), string(cfg.Basic.PrioritySHA256[:]))
However once I add the WHERE NOT EXISTS clause, I can’t work out methods to substitute the worth ( see the daring portion within the following:
consequence, err = db.Exec(“INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1) WHERE NOT EXISTS ( SELECT ‘x’ FROM [dbo].[Priority] WHERE [Priority_SHA256] = string(cfg.Basic.PrioritySHA256[:]))”, string(cfg.Basic.PrioritySHA256[:]))
Connecting to a sqlserver db
Did you imply:
INSERT INTO [dbo].[Priority] ([Priority_SHA256]) VALUES ($1) WHERE NOT EXISTS ( SELECT ‘x’ FROM [dbo].[Priority] WHERE [Priority_SHA256] = $1)
I did and tried that however it complains when it will get to the primary “WHERE”
Error:(16, 556) anticipated, bought ‘WHERE’