Page 1 of 1

store variables in a sql server database

Posted: Wed Apr 19, 2017 12:07 pm
by dvalenzuela
Hi, how are you?


I want to store my variables in a sql server database, could you help me.

I already made the connection with the bd

Re: store variables in a sql server database

Posted: Thu Apr 20, 2017 4:25 am
by mishika
Hello,

Do you want to store the case variables for the process in the database?
One approach you can use is:
* Create a trigger which executes the SQL query to insert the variables into a table of the database and set the trigger to fire at any step in your process.
* To query for SQL server will be similar to the MySQL queries, the only difference is in executing it. To execute the query for SQL server you will have to pass the id of the db connection in the executeQuery function, like:
Code: Select all
$db = "id of the SQL server connection";
$query = "INSERT INTO VAR_TABLE (ID, VAR, VAL) VALUES ("01", "name" , "ABCD")";
$result = executeQuery($query, $db);
Hope this helps

Best Regards
Mishika

Re: store variables in a sql server database

Posted: Fri Apr 21, 2017 6:26 pm
by dvalenzuela
Thanks for your support.

Yo tengo creado un trigger con nombre “uno”:

1.jpg

Y mis variables “Cantidad” y “Contiene” las tengo definidas de la siguiente manera:

2.jpg

Este es mi proceso:

3.jpg

Y en la task “Ingreso Correspondencia”, en “steps”, tengo agregado mi trigger “uno” creado anteriormente:

4.jpg

Esta bien esto? Algo me falta, porque no me almacena las variables en la BD.

Muchas gracias.

Re: store variables in a sql server database

Posted: Fri Apr 21, 2017 7:58 pm
by amosbatto