Questions tagged [named-parameters]

Named parameters enable you to specify an argument for a particular parameter by associating the argument with the parameter's name rather than with the parameter's position in the parameter list.

371 questions
2
votes
1 answer

In Struts2 named variable not getting cleared when redirected to another action

I am having a weird problem when redirecting to an action from another action. In short the named variable captured in the first action (from which I am redirecting) is still preserved somehow in the value stack and it is overwriting the same named…
Chantz
  • 5,883
  • 10
  • 56
  • 79
2
votes
5 answers

how to deal with situation when function has lot of params and client code needs only change only few of them?

How to not get lost in that case ? Example, this is a function that returns bool but takes on 10 params: bool myFunc(bool par1 = true, bool par2 = false, bool par3 = true, bool par4 = true /* and so on */ ) {} And let's say that the function…
rsk82
  • 28,217
  • 50
  • 150
  • 240
2
votes
1 answer

groovy - Sql eachRow named parameters with map

I'm trying to perform select like this: def queries = [ [ paramQuey: "", mainQuery: "SELECT * FROM SOME_TABLE" ], [ paramQuey: "SELECT SOME_COLUMN AS COUNT FROM A_TABLE WHERE SOMETHING=3", mainQuery:…
Kw4s
  • 45
  • 3
  • 8
2
votes
1 answer

Is it possible to use named parameters when command type is adCmdText?

I'm trying to use named parameters with following query through Adodb.Command but no luck. Select * From mytable Where col1 = Lower(@param1) And col2 = Upper(@param2) And col3 = @param1 The code I used something like that. Dim cmd Set cmd =…
remiremi
  • 39
  • 1
  • 5
2
votes
1 answer

SQL/parameters: positional and (then) named?

While calling a procedure/function in Oracle, is there a rule for the sequence of parameters of positional and named (and default) types? ...like the positional params come first... ...or the named appear at the last of the list? Any examples (it is…
Pop Stack
  • 926
  • 4
  • 19
  • 27
1
vote
2 answers

Dynamic named parameter in route values collection using Razor view

I use a helper method to create sections in my view: @helper CreateFacetSection(WebViewPage page, string sectionName, List model) { var showMore =…
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
1
vote
1 answer

ASP.NEt MVC 3.0 Pass Int Array as Parameter from Ajax ActionLink to Controller

can i pass an Int Array from Ajax.ActionLink (from my View) to Controller as a parameter this is my view @{ int [] IDArray = ViewBag.AllIds; } @Ajax.ActionLink("send", "SendtoSS", new { id= IDArray }, new AjaxOptions { OnBegin =…
HaBo
  • 13,999
  • 36
  • 114
  • 206
1
vote
1 answer

JPA Query named parameter issue in Repository

I have this method in my repository: @Query(""" SELECT items FROM ItemEntity items WHERE items.type = :type AND (:idList IS NULL OR items.id IN :idList) """) List findItems(@Param("type") String type, @Param("idList") List
askwer
  • 163
  • 13
1
vote
1 answer

Passing a name of named optional argument to a method in C#

I was wondering if I can do something like this, that is, pass a name of a named optional parameter to use it in a method call. I'm using a method from a library, which has like 50 optional named parameters (they only change a value of a permission,…
Chos5555
  • 23
  • 5
1
vote
1 answer

Would it be possible to call a Kotlin function with named parameters from Groovy (including `copy`)?

Context - a Kotlin codebase with Spock/Groovy tests. In my Groovy tests it would be convenient to call Kotlin functions with named parameters using the names. I use this particularly for test builders for entities. I'd like to be able to call them…
Robert Elliot
  • 1,372
  • 13
  • 20
1
vote
1 answer

Is there a way to force a function or method to be called using named parameters only?

For example, let's say we wrote the following function: function myFunction( Foo $foo, Bar $bar, ) {} In the future, we realize we want to re-order our parameters: function myFunction( Bar $bar, Foo $foo, ) {} If this function is…
Leo Galleguillos
  • 2,429
  • 3
  • 25
  • 43
1
vote
1 answer

Extract JPA Named Parameters in Javascript

I am trying to extract JPA named parameters in Javasacript. And this is the algorithm that I can think of const notStrRegex = /(?
1
vote
2 answers

How to pass interval parameter into sql request using namedparameterjdbctemplate java

I am dealing with NamedParameterJdbcTemplate in java. I'm trying through NamedParameterJdbcTemplate to pass the interval parameter (3 month) to the sql query DELETE FROM message WHERE dt_log
1
vote
2 answers

Regex: how to replace numbers that are separated by comma with function calls to those same numbers

I'm trying to replace the numbers inside a function call with "descriptive" functions that simply just returns the argument they are given. Basically, to simulate named parameters in Java. For instance I would like to replace the arguments to a…
VanTheMan
  • 117
  • 6
1
vote
1 answer

Unable to do batch update with Subquery in Insert or Update in Spring boot NamedParameterJdbcTemplate

Am trying to insert mutiple records using NamedParameterJdbcTemplate batchupdate. Am able to insert record without using subquery in Insert statement. But when I use Subquery its returning dataintegrityviolationexception Please find below code for…