Implement the multi_row case #314

This commit is contained in:
Rafa de la Torre 2016-12-13 16:51:11 +01:00
parent 4cd72616ca
commit e53a39875e

View File

@ -19,8 +19,13 @@ BEGIN
END IF;
<% if multi_row %>
RETURN QUERY
SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>);
BEGIN
RETURN QUERY
SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>);
EXCEPTION
WHEN OTHERS THEN
RAISE WARNING 'whatever';
END;
<% elsif multi_field %>
SELECT * FROM <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %>(<%= ['username', 'orgname'].concat(params).join(', ') %>) INTO ret;
RETURN ret;