Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Optional parameters in a called MS SQL stored procedure
Hi ! 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 ?
Hi ,
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);
Thank 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
HI !
No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL procedure ?
Many thanks for any usable information !
Alex
HI !
I renew my request.
No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL procedure ?
Many thanks for any usable information !
Alex
Powered by Liferay™