sqlwidgetpolarion

Polarion widget table with sql query


What is the syntax for the sql query in the table block. I want to have this native sql query:

    Select CC.*from WORKITEM P, WORKITEM C, WORKITEM CC, STRUCT_WORKITEM_LINKEDWORKITEMS Link, STRUCT_WORKITEM_LINKEDWORKITEMS Link2, PROJECT Proj WHERE P.C_PK=Link.FK_WORKITEM AND Link.FK_P_WORKITEM = C.C_PK AND C.C_PK= Link2.FK_WORKITEM AND Link2.FK_P_WORKITEM= CC.C_PK AND P.FK_Project=Proj.C_PK AND P.C_type ='release' AND CC.C_type='task' AND Proj.C_ID ='$pageParameters.ProjectID.value()' AND P.C_ID='$pageParameters.ReleaseID.value()'

I tried it like this: enter image description here

but there is an error: Failed to parse SQL query: ERROR: syntax error at or near "select" Position: 23


Solution

  • You can't use SQL Query like that. Gray lines are static lines, you can't skip / ignore it.

    If you want use your SQL Query, choose Script - Block and use Velocity Syntax (+ HTML, CSS) with Polarion Shared API:

    sdk/doc/javadoc-rendering/com/polarion/alm/shared/api/model/ModelObjects.html

    @Edit

    For full custom widget documentation: https://almdemo.polarion.com/polarion/sdk/doc/widget-sdk.pdf