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
|
I have a PostgreSQL Stored Procedure: CREATE OR REPLACE FUNCTION "GetManifestNumber"() RETURN Integer AS$$ BEGIN RETURN nextval('"ManifestNumber_seq"'); END $$ LANGUAGE 'plpgsql' VOLATILE; I have tried but been unsuccessful in getting the “ManifestNumber” to return. Can anyone give me a pointer to how to handle this? |
|
|
I don't think we've tested with LANGUAGE 'plpgsql' functions but we do have LANGUAGE 'sql' functions returning scalar values. Here is our standard test case: CREATE FUNCTION GetContributionCount()RETURNS BIGINT AS 'SELECT COUNT(*) FROM Contributions;' LANGUAGE 'sql' VOLATILE; Presumably you could write something similar that does a SELECT nextval in the body instead, though I'm not sufficiently familiar with PostgreSQL to be sure about the exact syntax of things like nested quotes. You should then be able to call this from LightSpeed using the IUnitOfWork.Calculate(ProcedureQuery) method as follows: ProcedureQuery query = new ProcedureQuery("GetContributionCount"); |
|
|
Thank you works GREAT one small change, if your used 'Quotes' in Postgresql it need to look like this: ProcedureQuery query = new ProcedureQuery("\"GetContributionCount\"()"); Roy |
|