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.
Questions tagged [named-parameters]
371 questions
0
votes
0 answers
Reading multiple rows for DB2 using JDBC named templates but without "IN" clause in SQL
I would like to fetch serveral rows of data from a table.
I have a dao, sql and some parameters.
public static final String SELECT = ""
+ "SELECT NAME, SURNAME, AGE, LEVEL"
+ "FROM MYTABLE "
+ "WHERE "
public static final…

Riv
- 347
- 2
- 5
- 14
0
votes
0 answers
How to copy named parameters to variables?
Imagine this ruby code:
class Class1
def initialize( par1: 1, par2: 2, par3: 3)
@par1 = par1
@par2 = par2
@par3 = par3
end
end
p Class1.new ##
p Class1.new(par1: 'one', par2: 'two',…

knut
- 27,320
- 6
- 84
- 112
0
votes
1 answer
Set Value of Cell, relative to active cell, within single column named range
I have written the following code as part of a larger sub-routine to set the value of a cell, relative to the active cell, when a particular selection has been made within the active cell.
ActiveCell.Offset(0, 5).Value = "CLV 7"
While this works, I…

ManbyRiver
- 11
- 5
0
votes
2 answers
Keeping named and default parameters when assigning a function
When assigning a function using an unapplied method, it appears that named and default parameters are lost. Is there any way to avoid this?
def foo(namedParam: String = "defaultValue") = namedParam*2
// scala> foo()
// res8: String =…

Alfredo Gimenez
- 2,174
- 1
- 14
- 19
0
votes
0 answers
nested exception is java.sql.SQLException: Invalid column type
I have to execute a query in my project,I have used jdbctemplate with MapSqlParameterSource to execute but mycode is giving following excpetion
Exception ex : org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback;…

user2572003
- 743
- 3
- 8
- 16
0
votes
1 answer
Parameter instance recId is invalid for the requested conversion. ERRORCODE=-4461
I am using spring JdbcNamedTemplate to insert data in database. For other operations (such as delete) it is working for fine, But while insert I am getting -4461 error from DB2.
I already went to these…

User45
- 74
- 1
- 10
0
votes
4 answers
How to set default values for named function parameters simulated via object literals in JavaScript?
I'd like to use named parameters (simulated via object literals) in my JavaScript functions for ease of readability. The code I've written works fine when I explicitly pass my parameters, but I'm having trouble trying to set a default value, so that…

Sapphireblue
- 104
- 2
- 15
0
votes
1 answer
Positional before Named argument list parsing
How would you do that in the parser combinators
def namedAfterPos[P, N](pos: Parser[P], nmd: Parser[N], sep: Parser[_] = ",") = ???
List("a", "a,a,a", "a,a,a=b,a=b", "a=b, a=b") map (_ parseWith namedAfterPos("a", "a=b")) map {case Success(res, _)…

Little Alien
- 1
- 8
- 22
0
votes
1 answer
can **kwargs expand into explicit named args in a method call
I searched quite a bit for this, so please forgive if I missed something.
I generally desire that methods in my system have only explicit named arguments (other than self of course), like so:
# want an explicit parameter signature
def method_1(self,…

Bruce
- 25
- 3
0
votes
2 answers
Ways to refactor named arguments with default values
I have a method with a lot of named arguments, some with default values:
def myClass
def initialize(a:, b:, c:, d:, e:, f:, g: nil, h: nil, i: nil)
...
end
end
The list is a little hard to look at and comprehend. I am looking for way to…

Nick Ginanto
- 31,090
- 47
- 134
- 244
0
votes
1 answer
Conflict using named parameters with a ParamArray
I have written a method with these parameters:
Sub MethodName(ByVal paramName1 As String,
ByVal paramName2 As String,
ByVal paramName3 As String,
ByVal ParamArray lastParam As String())
End Sub
In the…

ElektroStudios
- 19,105
- 33
- 200
- 417
0
votes
3 answers
Using switches inside batch file
I have a batch file and I need to invoke it like this "mybatch.bat -r c:\mydir", and the batch file loops through the directory and writes file names to the output. The problem I'm facing is that I cannot read parameter "-r".
Here's what it looks…

Ostati
- 4,623
- 3
- 44
- 48
0
votes
4 answers
HQL Query with multiple Criteria
I am trying to write a HQL Query which selectes rows from a table based on multiple criteria.
firstName,lastName
the catch is that the query should be flexible to ignore any empty or null values
so
select t from table t where (:firstname = '' or…

Anuj Gakhar
- 681
- 2
- 13
- 26
0
votes
1 answer
Passing array to one of named parameters in script block?
I am trying to figure out a way to pass an array to a named parameter in a separate script. However, I could not find any solution.
Test2.ps1:
param(
[int]$a,
[int]$b,
[int]$c,
[string[]]$d
)
write-host "`$a = $a"
write-host "`$b =…

MagicGuru
- 175
- 2
- 11
0
votes
1 answer
Unexpected behavior for NamedParameterJdbcTemplate
I'm using Spring's NamedParameterJdbcTemplate wrapper.
I have inserted one dealno into the (Oracle) database and verified with Oracle SQL Developer.
When I have a fixed query to select for that dealno (and a useless namedParameter), I get an…

rajah9
- 11,645
- 5
- 44
- 57