Página 1 de 1

mysql execute

Publicado: Jue May 17, 2012 5:28 pm
por Roberto
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

mysql execute

Publicado: Jue May 17, 2012 6:10 pm
por ignacio
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,