]
Barry LaFond commented on TEIIDDES-2942:
----------------------------------------
[~shawkins] Designer currently allows setting a procedure parameter to *RETURN* direction
*and* have a *Result Set* defined. Couldn't find any restrictions/info in the BNF
doc. Is this legal? and if not, we can easily add a validation rule. And what do we
export if both exist?
Procedure input parameter has result in the generated DDL
---------------------------------------------------------
Key: TEIIDDES-2942
URL:
https://issues.jboss.org/browse/TEIIDDES-2942
Project: Teiid Designer
Issue Type: Bug
Components: Dynamic VDBs
Affects Versions: 10.0.2
Environment: Fedora 24
Reporter: Matej Kralik
Priority: Critical
Attachments: ddlProject.zip
I have a procedure with one input parameter. When I want to preview this procedure or
deploy dynamic VDB, server shows me error that:
{code:java}
TEIID31100 Parsing error: Encountered "(4000) [*]result[*]) RETURNS" at line 2,
column 52.
Procedure testProc RESULT param p1 must be of type OUT.
{code}
I noticed that generated dynamic VDB contains 'result' in this parameter but this
parameter has set direction to IN. When I delete the result from dynamic VDB, the
procedure works fine.
Actual DDL:
{code:java}
CREATE VIRTUAL PROCEDURE testProc (p1 string(4000) result) RETURNS TABLE (xml_out xml)
OPTIONS ("REST:METHOD" 'GET', "REST:URI" 'test/{p1}')
AS
BEGIN
SELECT XMLELEMENT(NAME test, XMLFOREST(ProcedureModel.testProc.p1 AS elem1,
'elem2' AS elem2)) AS xml_out;
END;
{code}
expected DDL:
{code:java}
CREATE VIRTUAL PROCEDURE testProc (p1 string(4000)) RETURNS TABLE (xml_out xml) OPTIONS
("REST:METHOD" 'GET', "REST:URI" 'test/{p1}')
AS
BEGIN
SELECT XMLELEMENT(NAME test, XMLFOREST(ProcedureModel.testProc.p1 AS elem1,
'elem2' AS elem2)) AS xml_out;
END;
{code}