Thanks for pointers. Got this working now:
var rs = db.execute('SELECT main_detail_id,staff_notes FROM main_detail '+
'where main_detail_id=? AND staff_notes !=?',[this_main_detail_id,' ']);meerkat > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of Robert > Sent: Tuesday, March 10, 2009 10:17 PM > To: Gears Users > Subject: [gears-users] Re: parameters > > > The last one is the correct way. > > Is the 'getValue' function returning a string instead of an integer? > Maybe the parameter engine is putting quotes around it. > > Also, maybe it's just a typo in your example, but you're not > requesting the staff_notes column in the parameterized version. > > rob > > On Mar 10, 1:00 pm, meerkat <[email protected]> wrote: > > //var this_main_detail_id = getValue("main_detail_id"); > > OR > > var this_main_detail_id ="034115441312108"; > > > > var tbl = $('notes'); > > while(tbl.rows.length > 0) > > tbl.deleteRow(-1); > > > > var sql = "SELECT main_detail_id,staff_notes FROM main_detail > WHERE > > main_detail_id = this_main_detail_id"; > > > > OR > > var sql = "SELECT main_detail_id,staff_notes FROM main_detail > WHERE > > main_detail_id = "+this_main_detail_id; > > OR > > var rs = db.execute('SELECT main_detail_id FROM main_detail '+ > > 'where main_detail_id=?',[this_main_detail_id]); > > > > Hello, > > > > I am trying to use parameters with Gears sqlite database. I have tried > > the above but I can't get the value selected or bound in the sql. When > > I write the parameter by itself I get the correct value. > > > > Any ideas on the correct way to do this? > > > > Thanks, > > Tosca
