Extract value from form and send to database service how a parameter (filter)

别等时光非礼了梦想. 提交于 2019-12-25 09:47:59

问题


In my configuration, I try the next comand (BD mysql):

SELECT user, name, lastname FROM Cordloc 
where user=<sql:param type="xs:string" select="/form/section-1/usuario"/>

This database service is conect to drowpdown, but when I incluye the sentence "where user=<sql:param type="xs:string" select="/form/section-1/usuario"/>", this it's not working.

I try the show en drowdown name user, but filter with user login orbeon (in the table is same value "orbeon").

Please, can your help me with that.

Many thanks.


回答1:


You can't use an XPath expression, such as /form/section-1/usuario, in the query. Instead, the value of the select attribute must be left empty (as mentioned in 1. Set a service parameter).

Instead, you "feed" the value to the service from the action. In the Actions Editor, under Set Database Service Parameters, you can say that the value from a given field should be used for a parameter of your SQL query.



来源:https://stackoverflow.com/questions/43812144/extract-value-from-form-and-send-to-database-service-how-a-parameter-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!