Hello,
I am trying to bind some parameters in a query but I can't do it. I have the
following (JavaScript in html page):
var rs = db.execute('SELECT distinct '+
'schedule.schedule_id, ' +
'orders.order_no, '+
'orders.order_no_iteration, '+
'organisation.organisation_name, '+
'strftime(\'%H:%M\',schedule.the_start_time,\'unixepoch\')AS the_start_time,
'+
'strftime(\'%H:%M\',schedule.the_end_time,\'unixepoch\')AS the_end_time, '+
'date(schedule.the_date,\'unixepoch\',\'localtime\') AS the_date, '+
'schedule.user_id, '+
'properties.property_id, '+
'properties.property_name_number, '+
'properties.property_address1, '+
'properties.property_address2, '+
'properties.property_town, '+
'properties.property_postcode, '+
'properties.tenant_name, '+
'properties.tenant_tel, '+
'properties.tenant_mobile, '+
'date(orders.estimated_completion_date,\'unixepoch\',\'localtime\') AS
estimiated_completion_date, '+
'orders.other_contact_tel, '+
'main_detail.quantity, '+
'trades.trade_code, '+
'activities.activity_code, '+
'activities.unit_type, '+
'main_detail.activity_description, '+
'main_detail.main_detail_id, '+
'activities.activity_id, '+
'users.user_id, '+
'users.user_type, '+
'trades.trade_id '+
'FROM schedule,users,main_detail,properties,orders,activities,organisation,
trades '+
'WHERE schedule.user_id = ? '+
'AND users.user_id = ? '+
'AND schedule.schedule_id = ? '+
'AND main_detail.main_detail_id = ? '+
'AND main_detail.property_id = ? '+
'AND main_detail.order_id = ? '+
'AND main_detail.activity_id = ? '+
'AND properties.organisation_id = ? '+
'AND activities.trade_id = ? '+
'AND users.user_type != ?',['users.user_id',this_user_id
,this_schedule_id,this_main_detail_id,'properties.property_id','orders.order
_id','activities.activity_id','organisation.organisation_id','trades.trade_i
d','Subcontractor']);
I have tried $this_schedule_id or :this_schedule_id or ?this_schedule_id or
'$this_schedule_id' or ':this_schedule_id' or '?this_schedule_id'
I get the url variables ok with:
var this_schedule_id = getValue("my_schedule_id");
var this_user_id = getValue("user_id");
var this_main_detail_id = getValue("main_detail_id");
document.write("SID "+ this_schedule_id);
document.write("\\");
document.write("uID "+ this_user_id);
document.write("\\");
document.write("mdID "+ this_main_detail_id);
I get an empty result set even though I know that the variables produce a
row (tested in external sql program).
If anyone can suggest what I am doing wrong I would really appreciate your
help.
meerkat
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users