Hello I've got a problem - help me please if you can. Users are able to setup some parameters in the my application config file. For example they can setup what persons (by person names) should be watched by my application in the database. Application config file looks like <person pattern="D"/> <person pattern="Ric"/> <person pattern="Rav"/> and so on. So my appllication should watch all persons if their names is started with "D", "Ric" or "Rav".
Application should select from database new records that correspond to the person patterns and show it to the users. I need 'like' statement to be repeated via "or" separator so many times as person pattern specified in the config file. One person pattern will always be there. So if there is only one person I'll set up in the "Person.sqlmap" file something like that: <select id="GetNewPersons" resultMap="PersonMap" parameterClass="System.Collections.IDictionary"> select from Person where person_name like #pattern1# </select> If there will be two person pattern in the config I'll set up "Person.sqlmap" like: <select id="GetNewPersons" resultMap="PersonMap" parameterClass="System.Collections.IDictionary"> select from Person where (person_name like #pattern1# or person_name like #pattern2#) </select> I could allow users to edit the "Person.sqlmap" file according to the application config file. But this two files should always in synchronized state - and user couldn't always achive that. Or I could analyzi how many time person pattern occurs in the application config file and repeat obtaining person list from database. Is it possible to add sql conditions to the sql map statement in the runtime? <select id="GetNewPersons" resultMap="PersonMap" parameterClass="System.Collections.IDictionary"> select from Person where (person_name like #pattern1# [or person_name like #pattern N#]) </select> -- Thank you ___________________________________________________________________________ This communication is confidential and may be legally privileged. If you believe you are not an intended recipient, please inform the sender, delete the e-mail and do not copy, print or use it or disclose it to others. You can inform the sender by replying to this e-mail or by telephone (+380 44 4906080).