Hi,
Is there a way to execute more than one command using execute?
for exemple:
// sql is a tmysqldatasource
sql:execute([SET @name="Roberto"])
sql:execute([SET @ide="XAILER"])
I would like to get the same result using only one command, like this:
sql:execute([SET @user="Roberto"; SET @ide="XAILER"])
There are situations where I need to insert a lot of records with different fields and I have to use the execute method each time. It take some time that I would like to avoid.
btw, congratulations for version 2.6! Xailer is really a professional development tool. It is easy to use, fast to run and powerful
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
mysql execute
- ignacio
- Site Admin
- Mensajes: 9445
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
mysql execute
Roberto escribió el jue, 17 mayo 2012 17:28Hi,
Is there a way to execute more than one command using execute?
for exemple:
// sql is a tmysqldatasource
sql:execute([SET @name="Roberto"])
sql:execute([SET @ide="XAILER"])
I would like to get the same result using only one command, like this:
sql:execute([SET @user="Roberto"; SET @ide="XAILER"])
There are situations where I need to insert a lot of records with different fields and I have to use the execute method each time. It take some time that I would like to avoid.
btw, congratulations for version 2.6! Xailer is really a professional development tool. It is easy to use, fast to run and powerful
This is completely SQL Ansi standard for updating data fields and done in a single statement:
TEXT INTO cSelect
UPDATE MiTabla SET USER=?, IDE=? WHERE ...
ENDTEXT
WITH OBJECT oDataSource
:BeginTrans()
:Execute( :BuildSQLSt( cSelect, "Roberto", "XAILER" ) )
:CommitTrans()
END WITH
The construction you are using it seems to be for setting parameter values on a stored procedure or something like that, but I'm afraid I have never use those SQL sentences. I suggest the following:
:Execute( "CALL MiUpdate('Roberto', 'XAILER')" )
Regards,
Is there a way to execute more than one command using execute?
for exemple:
// sql is a tmysqldatasource
sql:execute([SET @name="Roberto"])
sql:execute([SET @ide="XAILER"])
I would like to get the same result using only one command, like this:
sql:execute([SET @user="Roberto"; SET @ide="XAILER"])
There are situations where I need to insert a lot of records with different fields and I have to use the execute method each time. It take some time that I would like to avoid.
btw, congratulations for version 2.6! Xailer is really a professional development tool. It is easy to use, fast to run and powerful
This is completely SQL Ansi standard for updating data fields and done in a single statement:
TEXT INTO cSelect
UPDATE MiTabla SET USER=?, IDE=? WHERE ...
ENDTEXT
WITH OBJECT oDataSource
:BeginTrans()
:Execute( :BuildSQLSt( cSelect, "Roberto", "XAILER" ) )
:CommitTrans()
END WITH
The construction you are using it seems to be for setting parameter values on a stored procedure or something like that, but I'm afraid I have never use those SQL sentences. I suggest the following:
:Execute( "CALL MiUpdate('Roberto', 'XAILER')" )
Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com