Link to home
Start Free TrialLog in
Avatar of Dolamite Jenkins
Dolamite JenkinsFlag for United States of America

asked on

deleterow();

I'm trying to loop through the sqlite database to transmit the data to the server ... once the data is transmitted successfully and the server returns "1" I want it to delete the row just transmitted (.deleterow) then next transmit the next row (.next)... but the way I am doing it isn't working

if(jObject.Result == 1)
{ getGroundData.deleteRow();
 getGroundData.next();

Open in new window



var Groundy = function(){
var db = Ti.Database.open('TennisApp');
var getGroundData = db.execute('SELECT user, MatchUID,Ossys, UserID, SetPrKey, Game, Point, Stroke, XCor, YCor FROM GroundStrokeData');
while (getGroundData.isValidRow())
{
     var user = getGroundData.fieldByName('UserID');
     var UserID = getGroundData.fieldByName('UserID');
     var MatchUID = getGroundData.fieldByName('MatchUID'); 
     var Ossys = getGroundData.fieldByName('Ossys');
     var SetPrKey = getGroundData.fieldByName('SetPrKey'); 
     var Game = getGroundData.fieldByName('Game');
     var Point = getGroundData.fieldByName('Point');  
     var Stroke = getGroundData.fieldByName('Stroke'); 
 
     var XCor = getGroundData.fieldByName('XCor');
     var YCor = getGroundData.fieldByName('YCor');
  GroundDtrokeTransmit(user, MatchUID, Ossys, UserID, SetPrKey, Game,  Point, Stroke, XCor, YCor);
 
}
db.execute('DELETE FROM GroundStrokeData');
getGroundData.close();
db.close();
 
};
 
var GroundDtrokeTransmit = function(user, MatchUID, Ossys,  UserID, SetPrKey){ 
var xhr=Titanium.Network.createHTTPClient();    
 xhr.onerror = function(e){ 
 Ti.API.error('groundy Bad Sever =>'+e.error);
};

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aaron Tomosky
Aaron Tomosky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial