]
Barry LaFond commented on TEIIDDES-2688:
----------------------------------------
[~mmakovy] Can you verify if the view model in the VDB is *old*? if the procedure in the
VDB contains SQL that starts with CREATE VIRTUAL PROCEDURE, then the issue you logged will
probably occur. Any NEW procedure will NOT have the CREATE VIRTUAL PROCEDURE in the SQL..
just a simple statement or one wrapped in BEGIN...END
Dynamic VDB Generation - Problem with DDL generated for procedure
-----------------------------------------------------------------
Key: TEIIDDES-2688
URL:
https://issues.jboss.org/browse/TEIIDDES-2688
Project: Teiid Designer
Issue Type: Bug
Affects Versions: 9.0.4
Reporter: Matus Makovy
I have a VDB that was created for consumption of REST Web Service.
There is a procedure named getProgrammes(). DDL generated for dynamic VDB is:
{quote}
CREATE VIRTUAL PROCEDURE getProgrammes ()
AS
CREATE VIRTUAL PROCEDURE
BEGIN
DECLARE STRING VARIABLES.qp = '';
SELECT
A.pid AS pid, A."start" AS "start", A."end" AS
"end", A.title AS title
FROM
(EXEC
SourceModel.invokeHttp(action=>'GET',endpoint=>VARIABLES.qp,stream=>'TRUE'))
AS f, XMLTABLE('/schedule' PASSING XMLPARSE(DOCUMENT f.result) COLUMNS pid string
PATH 'day/broadcasts/broadcast/pid/text()', "start" string PATH
'day/broadcasts/broadcast/start/text()', "end" string PATH
'day/broadcasts/broadcast/end/text()', title string PATH
'day/broadcasts/broadcast/programme/title/text()') AS A;
END;
{quote}
Obviously, there is one extra "CREATE VIRTUAL PROCEDURE".
Even after fixing this issue there is another error:
{quote}
VDB: REST State: INACTIVE ERROR: TEIID31080 ViewModel.getProgrammes validation
error: TEIID31118 Element "f.result" is not defined by any relevant group.
ERROR: TEIID31080 ViewModel.getProgrammes1 validation error: TEIID31118 Element
"f.result" is not defined by any relevant group. Models: SourceModel
ViewModel
{quote}
"f" should be a refrence to "EXEC
SourceModel.invokeHttp(action=>'GET',endpoint=>VARIABLES.qp,stream=>'TRUE'))"
as descibed in the SQL