Hello colleagues, I have a problem. I'm trying to do a SQL, select sum(.....). The code doesn't give me an error, but I don't know how to access the value of the variable later.
If you see my code, I have assigned a name to the value received, but when I execute the code, it always gives me "0", which is the value I have entered if there is nothing.
Innovator innovator = this.getInnovator(); // var innovator = new Innovator(); string ID = this.getID(); // esto sumaria todas las etapas var SentenciaSql = " select sum(MT_R_RUT_ETA.mt_rp_rut_eta_ltime) as 'Resultado'"+ " from innovator.MT_RUTA "+ " join innovator.MT_R_RUT_ETA on MT_RUTA.id = MT_R_RUT_ETA.SOURCE_ID "+ " where MT_RUTA.id = '"+ID+"'"; var ResultadoSQL = innovator.applySQL(SentenciaSql); // tomamos el valor de la suma var LT_Tot = ResultadoSQL.getProperty("Resultado","0"); // esto sumaria todas las etapas MENOS APROVISIONAMIENTO SentenciaSql = " select sum(MT_R_RUT_ETA.mt_rp_rut_eta_ltime) as 'Resultado'"+ " from innovator.MT_RUTA "+ " join innovator.MT_R_RUT_ETA on MT_RUTA.id = MT_R_RUT_ETA.SOURCE_ID "+ " where MT_RUTA.id = '"+ID+"' and MT_R_RUT_ETA.KEYED_NAME not like 'APROV%'"; ResultadoSQL = innovator.applySQL(SentenciaSql); // tomamos el valor de la suma var LT_Par = ResultadoSQL.getProperty("Resultado","0"); //String s = LT_Tot.ToString() + " - " + LT_Par.ToString(); String s = ResultadoSQL.ToString(); return innovator.newError(s);
I do it using SQL because it is faster than creating an AML and going through it to add the values.
1.- There is something similar in AML to "select sum"
2.- How can I pass the value of "SQLResult" to a variable to be able to display it on the screen.
In c# I usually use:
return innovator.newError(s);
With this the execution stops and it shows me "s".
Too many thanks!!!!!!