Message Boards
Optional parameters in a called MS SQL stored procedure
Optional parameters in a called MS SQL stored procedure
New Member Posts: 10 Join Date: 11/15/21 Recent PostsHi ! I have a MS SQL procedure called in Java - LIFERAY. It is a general procedure with many optional parameters.
1. How can define OPTIONAL PARAMETERS in default.xml?
2 How to call the procedure without a part of the optional parameters ?
RE: Optional parameters in a called MS SQL stored procedure
Liferay Master Posts: 591 Join Date: 8/8/14 Recent PostsHi ,
You can either use a Placeholder or QueryPos to include
parameter in your Procedure
Ex.
CALL somprocedue(? , ? );
CAL someprocdure([$PARAM1$],[$PARAM2])
Then you can replace the placeholder in your finderimpl using string replace utility or use QueryPos
QueryPos qPos = QueryPos.getInstance(query);
qPos.add(param1);
qPos.add(param2);
RE: Optional parameters in a called MS SQL stored procedure
New Member Posts: 10 Join Date: 11/15/21 Recent PostsThank you for answer.
But it don't resolve the problem.
I asked about 'OPTIONAL PARAMETERS'.
This means that once I have to call the procedure with 1 parameter, another time I have to call it with 3 parameters and so on.
My procedure has 11 parameters, only the first beeing mandatory. How to specify that params 2 ... 11 are OPTIONAL ?
So, if you or other anybody has an idea, please post it.
Many thanks,
Alex
RE: RE: Optional parameters in a called MS SQL stored procedure
New Member Posts: 10 Join Date: 11/15/21 Recent PostsHI !
No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL procedure ?
Many thanks for any usable information !
Alex
RE: Optional parameters in a called MS SQL stored procedure
New Member Posts: 10 Join Date: 11/15/21 Recent PostsHI !
I renew my request.
No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL procedure ?
Many thanks for any usable information !
Alex