sql - Update table A when row inserted in table B with multi select column -


I have 2 tables like this:

  Visitor Id | Name | Visit_from | From Image Visitor_log ID | Name | Visit_prom | From The requester   

When I insert a record in Visitor_log , the dates are updated in the table of viewers. When 1 visitor is requested I have to do this. The problem is that the Visitor_log.Visitor field is a multi-select field, so the code works only for one visitor:

  subline_detailed (rsold, rsnew) ew_execute ("UPDATE [visitor] set [to visit] = (go to '' and & amp; rsnew (" & "); , [to] = ('& amp; amp; rsnew ("to") and "') where [visitor]. [visitor] name] = ('& amp; rsnew (" visitor ") and"'); " )   

where the clause is created:

  WHERE [visitor]. [Visitor] M] = (Visitor A)   

But when multiple visitors are selected, it happens:

  WHERE [visitor] [visitor] Name] = (Visitor A, Visitor B, Visitor C)   

There is no Visitor Visitor A, Visitor B, Visitor C Therefore the SQL query fails in the form.

I have been stuck in a while. Now any help is greatly appreciated.

Update: I see it Query is set to what SQL is doing to response.write ...

sql: UPDATE [visitor] SET [visitors (name) ] = ('Mark M, Paul P') = ('10 / 10/2014 ') = ('10 / 10/2014') [Visitors] [Visitor]);

While reviewing your update, I think your problem is in quotes each Specific values ​​should be quoted and you should use these operators. Therefore, your query should look like this:

  update [visitor] to go to SET [=] ('10 / 10/2014 '), [TO] = ('10 / 10 / 2014 ') where [visitor]. [Visitor (name)] ('Mark M', 'Paul P');   

Assuming that rsnew ("visitor") is a string of values ​​different from coma and your language is vbscript, you can do something like

  Ew_execute ("UPDATE [Visitor] SET [to visit] = ('go to & amp; rsnew (") & amp; "'), [TO] = ('& amp; rsnew (" to ") & amp; "') where [visitor] [visitor] name] IN (" "and (rsnew (" visitor "),", ","', '") and"'); "   

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -