I am trying to insert data into existing table in database from mobilefirst. the adapter is working fine and i can insert data into database from the adapter. But when it is invoked in client side it shows failure message.
function insert(){
var invocationData = {
adapter:"sqlad",
procedure:"procedure1",
parameters:[$('#empid').val(),$('#empname').val()]
};
WL.Client.invokeProcedure(invocationData,{
onSuccess :loadFeedsSuccess,
onFailure :loadFeedsFailure,
});
}
function loadFeedsSuccess() {
alert("success");
}
function loadFeedsFailure() {
alert("failure");
}
html
<body style="display: none;">
<!--application UI goes here-->
<h1>ENTER THE EMP DETAILS</h1>
EMP ID<input type="text" id=empid> <br> <br>
Emp NAME<input type="text" id=empname><br> <br>
<input type="submit" value=register onclick="insert();">
<script src="js/initOptions.js"></script>
<script src="js/main.js"></script>
<script src="js/messages.js"></script>
</body>
adap imp.js
var procedure1Statement = WL.Server.createSQLStatement("INSERT INTO testdemo(empid,empname) Values(?,?)");
function procedure1(empid,empname) {
return WL.Server.invokeSQLStatement({
preparedStatement : procedure1Statement,
parameters : [empid,empname]
});
}