Page 1 of 1

use 'insert into' in a trigger

Posted: Tue Sep 15, 2020 11:04 am
by ludovicsantaroni
Hello,

I want to insert an entry in a local PM Table with a trigger.

Here is the code I use to do it :

$queryINSERT = "INSERT INTO PMT_RVD_NAT_DI_NUMEROATTRIBUTION (CODESOCIETE,EXERCICE,NUMERO_CHRONO,NUMERO_ATTRIBUTION) VALUES ($SocieteAttribution,$Exercice,$NumeroChrono,$NumeroAttribution)";
executeQuery($queryINSERT);

Variables $SocieteAttribution,$Exercice,$NumeroChrono,$NumeroAttribution are defined in the same trigger.

This part doesn't work. Could you explain me what it's wrong ?

Thanks in advance!

Re: use 'insert into' in a trigger

Posted: Tue Sep 15, 2020 6:14 pm
by Ironguts25
Is your syntax correct? Shouldn't you be using single quotes around your variables, like so:

('$SocieteAttribution', '$Exercice', '$NumeroChrono', '$NumeroAttribution')

Re: use 'insert into' in a trigger

Posted: Wed Sep 16, 2020 3:24 am
by ludovicsantaroni
Yes, it works now. Thanks you for your response!

IOS Certification

Posted: Wed Sep 16, 2020 5:19 am
by JayaChetty
Commonly, the two main platforms, iOS, and Android are holding the entire market portion. Though Android handles the broader domains than iOS, the growth rate is higher on the iOS application. FITA is the best IOS Training Institute in Chennai. The trainers from FITA are Well- Experienced in IOS Training in Chennai.
Web: https://www.fita.in/ios-developer-training-institutes-in-chennai/

Re: use 'insert into' in a trigger

Posted: Wed Sep 16, 2020 10:54 am
by mbadino
ludovicsantaroni wrote: Tue Sep 15, 2020 11:04 am Hello,

I want to insert an entry in a local PM Table with a trigger.

Here is the code I use to do it :

$queryINSERT = "INSERT INTO PMT_RVD_NAT_DI_NUMEROATTRIBUTION (CODESOCIETE,EXERCICE,NUMERO_CHRONO,NUMERO_ATTRIBUTION) VALUES ($SocieteAttribution,$Exercice,$NumeroChrono,$NumeroAttribution)";
executeQuery($queryINSERT);

Variables $SocieteAttribution,$Exercice,$NumeroChrono,$NumeroAttribution are defined in the same trigger.

This part doesn't work. Could you explain me what it's wrong ?

Thanks in advance!
HI, I made severals dynaforms with grid variables and string variables, Do you know if it is posible to insert and how grid and global variables in a PM Table? With report table is not so easy ...

Re: use 'insert into' in a trigger

Posted: Thu Sep 17, 2020 11:35 pm
by Ironguts25
Ironguts25 wrote: Tue Sep 15, 2020 6:14 pm Is your syntax correct? Shouldn't you be using single quotes around your variables, like so:

('$SocieteAttribution', '$Exercice', '$NumeroChrono', '$NumeroAttribution')
Please note, single quotes should not be used if the variable is a number.

https://wiki.processmaker.com/3.5/DynaForm_Control_Properties#Rules_to_Correctly_Create_a_SQL_Query