This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I'm converting some of my code over to stored procedures in MySQL to improve on performance, then setting up a stored procedure reference in LS designer. The problem is that the LS code seems to insist on returning a list of entities where this might not always be needed. For example, I have a stored proc that does some processing on a record in the database, once complete it doesnt actually return anything to the client. As you can imagine this stored proc does not need to return anything, but the LS code insists that I choose an entity type for it to return, is there any way to tell LS that the proc does not return anything? |
|
|
Hi Mike, At the moment we only fully support sprocs that return entity collections. We have experimental support for sprocs that return scalar values via the IUnitOfWork.Calculate(ProcedureQuery) method. The current status of this on MySQL is that it has been tested with sprocs that return a single scalar value: CREATE PROCEDURE GetContributionCount() and functions that return a single scalar value: CREATE FUNCTION Y(...) We don't support out-parameters at the moment. We don't have designer support for scalar sprocs but you can still write friendly wrappers by hand. I can provide sample calling code for the above examples if required. We don't currently have support for sprocs that don't return anything at all. If this is a significant issue for you then let us know (ideally providing a sample sproc) and we will take a look. |
|
|
Sorry to jump on this old thread, but it relates exactly to what I wanted to ask. I am wanting to use a stored procedure that takes a single int parameter and returns a single scalar value. It would be great if you could provide sample calling code for this situation.
Thanks Andrew Dixon |
|
|
Here's a fragment from the test suite: Stored proc: CREATE PROCEDURE GetContributionCount Calling code: ProcedureQuery query = new ProcedureQuery("GetContributionCount"); (If your sproc has a parameter, you'll need to add a ProcedureParameter to that ProcedureQuery, e.g. new ProcedureParameter("MyParameter", 123).) |
|
|
Thanks Ivan, worked a treat.
Thanks Andrew |
|