G Tellez wrote:
In addition to the last thread regarding an update with Bool types, I didn't finish this point:

- If I write in Links: ...where(profile.userid == r.user)... this is
translated in SQL into: where ((userid = 'gtellez') AND (mylistopt =
false) AND (langpref = 'english') AND (favcategory = 'Reptiles') AND
(banneropt = false))

What I wanted to ask here, is why the Links expression with ONE condition is translated into SQL as a query with FIVE conditions? That's causing the update with Bool types problem discussed in the last thread.

Is there any chance you can explain me a little bit?

Gabriel

Hi Gabriel,

What it's meant to be doing is first making a select query to fetch rows that match your criteria (in this case the single comparison profile.userid == r.user) and then performing an update query on each matching row to modify it. I'm not sure this design ever made sense, or what the rationale might have been.

In your case, I wonder what's going wrong. It seems like it's fetching the row incorrectly, or using different data than what's found in the row, either of which would be surprising. Is it possible that your table has more than one row matching your criterion? Including one with "false" in the columns where that surprises you?

If you can provide us with a minimal test case, including a short bit of links code and an example database table, that would be brilliant. It could be, for example, just a database pre-loaded with one row, along with a single Links command that should update the row but doesn't.

Thanks,
Ezra


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users

Reply via email to