Hi,
I'm trying to run from a script task a postgres stored procedure, but the postgres database return an error "call" is missing,
What Am I doing wrong ?
bool retCode = false; var userId = Get<Guid>("UtenteId"); var year = Get<int>("Anno"); var userConnection = Get<UserConnection>("UserConnection"); StoredProcedure storedProcedure = new StoredProcedure(userConnection, "SifLoadSurvey"); storedProcedure.WithParameter("Year", year); storedProcedure.WithParameter("UserId", userId); storedProcedure.InitializeParameters(); storedProcedure.PackageName = userConnection.DBEngine.SystemPackageName; using (var dbExecutor = userConnection.EnsureDBConnection()) { try { dbExecutor.CommandTimeout = 0; dbExecutor.StartTransaction(); storedProcedure.Execute(dbExecutor); dbExecutor.CommitTransaction(); retCode = true; } catch(Exception ex) { dbExecutor.RollbackTransaction(); retCode = false; } } return retCode;
Like
5 comments
12:33 Jun 14, 2021
Hi,
I solved it by converting the postgres procedure in a function
20:59 Dec 11, 2021
Hi sorry for my late answer,
I call the postgres function as a StoredProcedure
Show all comments