
Quote from joferar333 on May 19, 2022, 2:04 pmBuen Dia! @luishp,@gaev,@asleycruz,@daviddeargentina
ESPAÑOL
Tengo una base de datos que tiene dos tablas
usuarios
saldotmpEn la tabla usuarios tengo un campo que es "totalretorno"
En la tabla saldotmp tengo un campo que es "saldo"Intento agregar a la tabla saldotmp en el registro saldo el valor que contiene la variable "totalretorno" de la tabla usuarios...
SetVar "[gestion.saldotmp.saldo]" "[gestion.usuarios.totalretorno]"
dbpExecSQL "gestion" "INSERT INTO saldotmp (saldo) VALUES ([gestion.usuarios.totalretorno])" "[s1]"No me funciona no se en donde le estoy errando... alguna idea?
ENGLISH
I have a database that has two tables
Users
balanceIn the table users I have a field that is "totalretorno"
In the saldotmp table I have a field that is "saldo"I try to add to the saldotmp table in the balance registry the value contained in the "totalretorno" variable of the users ...
Setvar "[manage.saldotmp.saldo]" "[manage.usuarios.totalretorno]"
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ([GESTION.USUARIOS.TOTALRETORNO])" "[S1]"I don't work for me where I'm erring ... Any idea?
Buen Dia! @luishp,@gaev,@asleycruz,@daviddeargentina
ESPAÑOL
Tengo una base de datos que tiene dos tablas
usuarios
saldotmp
En la tabla usuarios tengo un campo que es "totalretorno"
En la tabla saldotmp tengo un campo que es "saldo"
Intento agregar a la tabla saldotmp en el registro saldo el valor que contiene la variable "totalretorno" de la tabla usuarios...
SetVar "[gestion.saldotmp.saldo]" "[gestion.usuarios.totalretorno]"
dbpExecSQL "gestion" "INSERT INTO saldotmp (saldo) VALUES ([gestion.usuarios.totalretorno])" "[s1]"
No me funciona no se en donde le estoy errando... alguna idea?
ENGLISH
I have a database that has two tables
Users
balance
In the table users I have a field that is "totalretorno"
In the saldotmp table I have a field that is "saldo"
I try to add to the saldotmp table in the balance registry the value contained in the "totalretorno" variable of the users ...
Setvar "[manage.saldotmp.saldo]" "[manage.usuarios.totalretorno]"
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ([GESTION.USUARIOS.TOTALRETORNO])" "[S1]"
I don't work for me where I'm erring ... Any idea?

Quote from ragman on May 19, 2022, 4:38 pmen mysql seria asi. sino me equic0?
faltan las ' '
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('[GESTION.USUARIOS.TOTALRETORNO]')" "[S1]"
en mysql seria asi. sino me equic0?
faltan las ' '
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('[GESTION.USUARIOS.TOTALRETORNO]')" "[S1]"

Quote from joferar333 on May 19, 2022, 4:51 pmGracias @ragman por su asistencia pero no funciona me dice que no coinciden las expresiones....
le puse las comillas tal como lo sugeriste pero aun asi no me funciona....
dbpExecSQL "gestion" "INSERT INTO saldotmp (saldo) VALUES ('[gestion.usuarios.totalretorno]')" "[s1]"
Gracias @ragman por su asistencia pero no funciona me dice que no coinciden las expresiones....
le puse las comillas tal como lo sugeriste pero aun asi no me funciona....
dbpExecSQL "gestion" "INSERT INTO saldotmp (saldo) VALUES ('[gestion.usuarios.totalretorno]')" "[s1]"
Quote from Gaev on May 19, 2022, 11:13 pm@joferar333
I am not sure what exactly is not working for you ...
1) try this ...
SetVar "[gestion.saldotmp.saldo]" "[gestion.usuarios.totalretorno]" AlertBox "variables" "[gestion.saldotmp.saldo] ... [manage.users.totalrestor]"... is the value of saldo in the current record of saldotmp updated ?
2) In the dbpExecSQL command, what is the value and purpose of [s1] ?
a) Try this first ...
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES (6789)" ""... this should insert a new record in saldotmp with the value of field balance equal to 6789
b) If (a) does not work as expected, try this ...
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('6789')" ""c) If (a) works as expected, try this ...
SetVar "[BalanceValue]" "1234" DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ([BalanceValue])" ""d) If (c) does not work as expected, try this ...
SetVar "[BalanceValue]" "1234" DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('[BalanceValue]')" ""Post your results for each syntax here.
I am not sure what exactly is not working for you ...
1) try this ...
SetVar "[gestion.saldotmp.saldo]" "[gestion.usuarios.totalretorno]" AlertBox "variables" "[gestion.saldotmp.saldo] ... [manage.users.totalrestor]"
... is the value of saldo in the current record of saldotmp updated ?
2) In the dbpExecSQL command, what is the value and purpose of [s1] ?
a) Try this first ...
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES (6789)" ""
... this should insert a new record in saldotmp with the value of field balance equal to 6789
b) If (a) does not work as expected, try this ...
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('6789')" ""
c) If (a) works as expected, try this ...
SetVar "[BalanceValue]" "1234" DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ([BalanceValue])" ""
d) If (c) does not work as expected, try this ...
SetVar "[BalanceValue]" "1234"
DBPEXECSQL "GESTION" "INSERT INTO SALDOTMP (BALANCE) VALUES ('[BalanceValue]')" ""
Post your results for each syntax here.

Quote from ragman on May 20, 2022, 2:30 amok, revisemos los campos de la Tabla,
así manejo los datos con mysql, y no tengo problema, solo el único campo que no coloco es id_archivo =int ( autoincrementa )
1 int(11) AUTO_INCREMENT
2 varchar(200) Sí NULL
3 varchar(255) Sí NULL
4 varchar(8) Sí NULL
5 varchar(1) Sí NULL
6 varchar(6) Sí NULL
7 varchar(255) Sí NULL
8 int(10) Sí NULL
dbpExecSQL "mysql" "INSERT INTO archivoz (archivo,mostrar,rut,estado,periodo,fullname)| VALUES ('[campo_archivo]','[campo_mostrar]','[campo_rut]','[campo_estado]','[campo_periodo]','[campo_fullname]');" ""
NOTA: no paso valores de una tabla a otra directamente, los paso a una variable temp, para revisar.
y lo otro, lo estas grabando a una tabla de resultado?
ok, revisemos los campos de la Tabla,
así manejo los datos con mysql, y no tengo problema, solo el único campo que no coloco es id_archivo =int ( autoincrementa )
1 int(11) AUTO_INCREMENT
2 varchar(200) Sí NULL
3 varchar(255) Sí NULL
4 varchar(8) Sí NULL
5 varchar(1) Sí NULL
6 varchar(6) Sí NULL
7 varchar(255) Sí NULL
8 int(10) Sí NULL
dbpExecSQL "mysql" "INSERT INTO archivoz (archivo,mostrar,rut,estado,periodo,fullname)| VALUES ('[campo_archivo]','[campo_mostrar]','[campo_rut]','[campo_estado]','[campo_periodo]','[campo_fullname]');" ""
NOTA: no paso valores de una tabla a otra directamente, los paso a una variable temp, para revisar.
y lo otro, lo estas grabando a una tabla de resultado?

Quote from joferar333 on May 23, 2022, 1:38 am@ragman
Thanks, new found Ok!
t
Thanks, new found Ok!
t