set parameter for SQL stored procedure

I have a textbox with a local variable assigned so that the variable (intKind) is set when the user enters a number. Next to the textbox, there's a button, when it is clicked a Server Action is carried out. The Server Action holds an SQL entity, with a call to a working stored procedure which expects an input parameter also called intKind. How can I feed the SQL entity with the value of the variable intKind?

Solution

Hi Maurice,


you would need to add in input parameter to your server action, passing that into your sql parameter, and passing the screen variable into your server from your screen action.


For clarity, I named the sql input parameter, the server input parameter and the screen local variable differently, but there's no need for that, you can give them all the same name if you prefer :


so, sql takes in parameter named SQLParamKind :

A server action called 'PerformSQL' has an input parameter called ServerInputKind, and in the properties (right bottom) of the SQL node, that server parameter is being mapped to the SQLParamKind.



A screen action is executed when button is clicked, calling the server and passing the screen variable screenVariableKind into the servers input parameter ServerInputKind.


The online courses are excellent to get acquainted with these basics of OS application structure.  I'd recommend starting with developing web apps OS 11


Welcome to the community and have fun learning,

Dorine


PS.  Just for completeness, you don't need to put the sql node in a server action, it is possible to add it directly to your screen action that gets executed on button click, and just pass the screen variable into the sql input parameter.

Solution

Great explanation, thanks for this. What I missed in my code was the last step, putting the local variable into the Server Action. Now I have done that, the logic is working.

The next step is to put the resultset into a List. If I have questions, I'll ask.

First, of course, I will explore the online courses you are referencing.

--

Maurice