Variables as sql parameters

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Variables as sql parameters

jarod73
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Variables as sql parameters

Alessandro  Vernet
Administrator
Hi Carmine,

When you define the database service, leave the value of the select attribute empty, e.g. in <sql:param type="xs:string" select=""/>. Then, for the service to be called, you need to define an action. In that action, add under "Set Database Service Parameters", click on the plus icon, select the control "ipsgriglia" from the dropdown, and enter 1 as the parameter number. 1 corresponds to the first <sql:param> in the query, 2 to the second, and so on.

You'll let us know how this works for you,

Alex


On Mon, Mar 4, 2013 at 3:17 AM, jarod73 <[hidden email]> wrote:
Hi all,

I'm new to orbeon and xform ,I'm trying to use a variable  defined in my
code as parameter inside a database service.
At the moment I'm not able to pass the variable value to the query, can
someone point me in the right direction?

here some images of what I've done :

This one from the sql service: ( i've tryied ${varname},
{$varname},$varname,'$varname', ($varname) etc.. )

<http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n4656298/SQL.bmp>

this one from runtime XForms Inspector - form model request instance. I
always get variable name and not variable value (the variable is populated
correctly).
<http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n4656298/GRIGLIA.bmp>

Regards Carmine



--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Variables-as-sql-parameters-tp4656298.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Variables as sql parameters

jarod73
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Variables as sql parameters

Alessandro  Vernet
Administrator
Hi Carmine,

By "data grid", are you referring to the fr:repeat, or fr:datatable? In either case, it means you could have several instance of "ipsgriglia", so which one are you referring to with $ipsgriglia? I am lost! :) Maybe adding a screenshot of the relevant part of your form would help.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Variables as sql parameters

jarod73
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Variables as sql parameters

Alessandro  Vernet
Administrator
Hi Carmine,

I get the idea, but you can't have a reference to that $ipsgriglia variable in the SQL query. Instead, as you said, you must create a hidden field holding that value, and set the <sql:param> to the value in that field through an action.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet