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
1 answer
Can you use a function with optional arguments for pipelining in OCaml?
I try this (using Core):
Some 9
|> Option.value_exn
|> printf "%d\n"
But the interpreter says:
Line 2, characters 9-25:
Error: This expression has type
?here:Base__Source_code_position0.t ->
?error:Base.Error.t…

Søren Debois
- 5,598
- 26
- 48
0
votes
2 answers
Named Parameter Idiom and non-copyable class
I am implementing a class that uses Named Parameter Idiom to initialise its members:
class Person
{
public:
Person & first_name(std::string n) { m_first_name = n; return *this; }
Person & last_name(std::string l) { m_last_name =…

Krzysiek Karbowiak
- 1,655
- 1
- 9
- 17
0
votes
2 answers
How to solve Empty Result Data Access Exception
org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
NamedParameterJdbcTemplate jdbcTemplate;
@Autowired
public void setJdbcTemplate(NamedParameterJdbcTemplate jdbcTemplate) {
this.jdbcTemplate =…

Akki Patel
- 11
- 1
- 2
0
votes
1 answer
JPA TopLink Help!
Greetings,
As of now I had accomplished building a single-table JPA.
But when going to one-to-one or one-to-many. Things get complicated.
Especially when it comes to queries with parameters.
I always get an exception on a named-query
Exception…

Cyril Horad
- 1,555
- 3
- 23
- 35
0
votes
0 answers
Named Parameter not getting recognized in jdbcTemplate.queryForList() method
I am getting below exception :
ERROR 1 --- [eduler_Worker-3] jdbc.sqltiming
: 123. PreparedStatement.setObject(1, {ids=[33925]})
com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of
range.
Caused by:
…

codeLover
- 2,571
- 1
- 11
- 27
0
votes
0 answers
Simple Query taking approx 2 sec when using NamedParamterJdbcTemplate. From SQL DB, takes less than 100 milliseconds
A simple query with where clause on 3 columns and having index on these 3 columns is taking approx 2 sec. The number of records in the table is around 8 million and the result is around 1000-4000 rows. No function used on the columns in the where…

apa
- 1
0
votes
1 answer
JDBCTemplate/NamedParameterJdbcTemplate failed to insert FileItem/Blob
I have a normal PreparedStatement that insert FileItem fileItem to BLOB column:
ps.setBinaryStream(1, fileItem.getInputStream(), (int) fileItem.getSize());
The problem I can enter FileItem to NamedParameterJdbcTemplate:
I tried with…

Ori Marko
- 56,308
- 23
- 131
- 233
0
votes
2 answers
Create batch file with multiple named parameters
I got a requirement to create batch file with multiple optional parameters.
Example
MyTestSqlBatch.bat ServerName DatabaseName [UserId] [Password] [Command] [parameter]
here ServerName and DatabaseName are mandatory. And
UserId, Password are…

Jagadeesh
- 1,630
- 8
- 24
- 35
0
votes
2 answers
Can we Replace a portion of String in Java which has symbol in the start and end to Identify?
I have a String SELECT *FROM USERS WHERE ID = '@userid@' AND ROLE = '@role@'
Now i have replace any string between @...@ , with a actual value .
Expected output SELECT *FROM USERS WHERE ID = '4' AND ROLE = 'Admin'
This replace will happen from a…

Chanky Mallick
- 569
- 8
- 27
0
votes
0 answers
Why does JavaScript not have named parameters?
Named parameters (i.e. fnCall(x = "something")) are very useful for visually verifying you are passing the correct item in the correct spot (among other reasons to use them.)
JS doesn't natively support them. This article already covers the work…

oooiiiii
- 302
- 2
- 11
0
votes
1 answer
Dynamically created order by clause in java showing as sql injection issue in Vercode scan
I am currently working on refactoring existing code as per veracode standards. I have a piece of code where Order By clause is dynamically created based on user input. In veracode it suggest to use Named Parameter but that is not possible. Below is…
0
votes
1 answer
Parameterized queries to create a user throwing missing user or role name exception
I'm trying to run a CREATE USER query on an oracle 12 database using the Oracle.ManagedDataAccess library. This query works perfectly without using named parameters. But when i try to use named parameters it looks like the parameters are not passed…

Mark Baijens
- 13,028
- 11
- 47
- 73
0
votes
0 answers
Named parameters on IE
I have many functions that are created like this one:
function _campoForm({ id, tipo, regole, campiPerRiga, css, stile, eventi, parametri, abilitato, traduzione, visibile, modelKey, serverKey }) { ... }
If I try to run this code on IE, this errors…

Hikari
- 589
- 7
- 29
0
votes
2 answers
Named Parameter Idiom and (abstract) base classes
Suppose I'm writing a 3D renderer in C++11, where I create materials and assign them to a model.
I'd like to be able to create materials using the Named Parameter Idiom, like this:
auto material = Material().color( 1, 0, 0 ).shininess( 200 );
I can…

Paul Houx
- 1,984
- 1
- 14
- 16
0
votes
1 answer
How can I check if an empty named parameter has been passed in in bash?
So I want to be able to use a -h option to show the help details. I have:
while getopts ":h:d:n" opt; do
case $opt in
h) help="true" >&2
;;
d) vdir="$OPTARG"
;;
n) vname="$OPTARG"
;;
\?) echo "Error: Invalid option…

MicWit
- 655
- 12
- 31