Ignition 8 Can not write to database from perspective development

Hello,

I am writing to you please to ask for help in a problem that I have when writing to the database. I have a form project developed in Ignition 8.0.1 Perspective which I have uploaded to an Ignition server. The problem that arises is that I can not write (I mean INSERT, UPDATE) to the database, but I can read the database through the client interface. I have already tried other equipment in my own test environment and it works well for me. I can write and read the database there.

I suspect that it may be due to a security issue and security issue since my local test team works with a free network and the client’s server obviously has the respective network security that they take into account. Extra and weird is that I do not get any error message or log of the console that I indicate I can deal with.

Please appreciate your support in this topic.

Best regards

Carolina Enriquez Linares

It shouldn’t be a security or network issue as all Perspective scripting methods and Queries are done on the actual gateway (in essence, Perspective is passing arguments/values to the Gateway at which point the Gateway is performing the queries or scripts).

Are your update queries being done in scripts, or via Named Queries? What specific methods are you using if scripting?

Hello,

I´m using Named queries for INSERT and UPDATE, so I call them by using the system.db.runNamedQuery function.

fecha=self.getSibling("Fecha").props.formattedValues.date
codequipo=self.getSibling("Codigo_Equipo").props.value
horometro=self.getSibling("Horometro").props.value
tiposervcomp=self.getSibling("Tipo_Servicio").props.value
comentario=self.getSibling("Comentario").props.text

GLN_15W40=self.parent.getChild("GLN_15W40").getChild("Value").props.value
GLN_HD_10W=self.parent.getChild("GLN_HD_10W").getChild("Value").props.value
GLN_HD_30=self.parent.getChild("GLN_HD_30").getChild("Value").props.value
GLN_HD_50=self.parent.getChild("GLN_HD_50").getChild("Value").props.value
GLN_HD_80W_90=self.parent.getChild("GLN_HD_80W_90").getChild("Value").props.value
GLN_RARUS_SHC_46=self.parent.getChild("GLN_RARUS_SHC_46").getChild("Value").props.value
GLN_M_LUBE_HD_85W_140=self.parent.getChild("GLN_M_LUBE_HD_85W_140").getChild("Value").props.value
REF_GLN_LIFE_50_50=self.parent.getChild("REF_GLN_LIFE_50_50").getChild("Value").props.value
LB_MOBIL_XHP_462=self.parent.getChild("LB_MOBIL_XHP_462").getChild("Value").props.value
LB_MOBIL_XHP_322=self.parent.getChild("LB_MOBIL_XHP_322").getChild("Value").props.value

params = {"fecha":fecha, "codequipo":codequipo, "horometro":horometro, "tiposervicio":tiposervcomp,"GLN_15W40":GLN_15W40, "GLN_HD_10W":GLN_HD_10W, "GLN_HD_30":GLN_HD_30, "GLN_HD_50":GLN_HD_50, "GLN_HD_80W_90":GLN_HD_80W_90, "GLN_RARUS_SHC_46":GLN_RARUS_SHC_46, "GLN_M_LUBE_HD_85W_140":GLN_M_LUBE_HD_85W_140, "REF_GLN_LIFE_50_50":REF_GLN_LIFE_50_50, "LB_MOBIL_XHP_462":LB_MOBIL_XHP_462, "LB_MOBIL_XHP_322":LB_MOBIL_XHP_322, "comentario":comentario}
result = system.db.runNamedQuery("Consumo_De_Lubricantes", "AddRegistro", params)

Do you have Security settings in place for the Named Query? If you have a Security Zone enabled for the AddRegistro Named Query and the users don’t fall into that Security Zone, then they would be unable to use it.