INSERT PARAMETER IN PROCEDURE MYSQL ASSQL

40 views
Skip to first unread message

Achille Mehatcheye Favre

unread,
Jun 22, 2013, 4:27:42 AM6/22/13
to as...@googlegroups.com
Hello i have probleme with assql.
I have one procedure in mysql  ajouterEquipe (5 parameters)
but in flex it's impossible for me do insert parameters can i have help ?

st.sql="call ajouterEquipe (?,?,?,?,?,?)";
st.setString(1,nom);
st.setString(2,tel);
st.setString(3,fax);
st.setString(4,rue);
st.setString(5,ncp);
st.setString(6,ville);
var token:MySqlToken = st.executeQuery();
token.addResponder(new AsyncResponder(resultat.ajouterEquipe, erreur.afficherLeMessageErreur,token));

i have error like ?

i just want to know how can i insert parameters in call function in AS3

Thanks

César Mendoza

unread,
Jun 22, 2013, 1:57:54 PM6/22/13
to as...@googlegroups.com
Hi!
In this link http://devcesar.blogspot.com.ar/2009/04/assql-abm-example-ejemplo-de-un-abm.html I made an example of how to insert, delete or modify data.
What I do? Just build the query with the data.

private function postEdit():void
{
if (boolStateNew == false){
service.send("UPDATE tabla set comentario ='"+ tiComentario.text
+ "' where tablaID='"+ grid.selectedItem.tablaID +"'");
service.send("UPDATE tabla set descripcion ='"+
tiDescripcion.text + "' where tablaID='"+ grid.selectedItem.tablaID
+"'");
Alert.show("updated");
cancelEdit();
service.send("SELECT * FROM tabla");
}
else
{
service.send("INSERT INTO `test`.`tabla`
(`tablaID`,`descripcion` ,`comentario`) VALUES (NULL , '"
+ tiDescripcion.text + "', '" + tiComentario.text + "')");
Alert.show("Inserted ...");
cancelEdit();
service.send("SELECT * FROM tabla");
}
}


--
You received this message because you are subscribed to the Google Groups "asSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to assql+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/assql.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Saludos.
César Javier Mendoza.

Achille Mehatcheye Favre

unread,
Jun 26, 2013, 1:25:41 AM6/26/13
to as...@googlegroups.com
Thank Cesar! now i have problems!
in my query i have byteArray parameters (Pictures) to insert into blob in mysql.

how can i add parameters with your solutions ???

thanks in advance.

César Mendoza

unread,
Jun 26, 2013, 1:59:48 PM6/26/13
to as...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "asSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to assql+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/assql.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Achille Mehatcheye Favre

unread,
Jun 27, 2013, 12:41:53 AM6/27/13
to as...@googlegroups.com
Let me explain very well my probleme  (look this example)
Hello i have probleme with assql.
I have one procedure in mysql  ajouterEquipe (5 parameters)
but in flex it's impossible for me do insert parameters can i have help ?

st.sql="call ajouterEquipe (?,?,?,?,?,?,?)";
st.setString(1,nom);
st.setString(2,tel);
st.setString(3,fax);
st.setString(4,rue);
st.setString(5,ncp);
st.setString(6,ville);

st.setString(7,photo);

var token:MySqlToken = st.executeQuery();
token.addResponder(new AsyncResponder(resultat.ajouterEquipe, erreur.afficherLeMessageErreur,token));

i have error like ?

i guest the parameters can't send to Mysql query.  and I my query add information into 3 tables and i need pk for the first table to make link between orther 2 tables. that why i'm using procedure.

Thanks

Achille Mehatcheye Favre

unread,
Jun 27, 2013, 12:44:14 AM6/27/13
to as...@googlegroups.com


Le jeudi 27 juin 2013 06:41:53 UTC+2, Achille Mehatcheye Favre a écrit :
Let me explain very well my probleme  (look this example)
Hello i have probleme with assql.
I have one procedure in mysql  ajouterEquipe (5 parameters)
but in flex it's impossible for me do insert parameters can i have help ?

st.sql="call ajouterEquipe (?,?,?,?,?,?,?)";
st.setString(1,nom);
st.setString(2,tel);
st.setString(3,fax);
st.setString(4,rue);
st.setString(5,ncp);
st.setString(6,ville);

st.setBinary(7,photo);
Reply all
Reply to author
Forward
0 new messages