sql:query tag does not work in a Gel Script
search cancel

sql:query tag does not work in a Gel Script

book

Article ID: 378627

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

A script such as the one below is being used:

<gel:script xmlns:core="jelly:core"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:sql="jelly.sql"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary">

    <gel:setDataSource dbId="Niku" />

    <sql:query escapeText="true" var="output">
    SELECT 1 as some_column from dual
    </sql:query>

    <gel:log>Count = ${output.rowCount}</gel:log>
</gel:script>

It does not fetch any results back.

Resolution

Notice that the namespace reference at 'jelly.sql' has a '.' (dot) instead of a ':' (colon) . Rectifying this as shown below is required, for the script to work.

<gel:script xmlns:core="jelly:core"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:sql="jelly:sql"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary">

    <gel:setDataSource dbId="Niku" />

    <sql:query escapeText="true" var="output">
    SELECT 1 as some_column from dual
    </sql:query>

    <gel:log>Count = ${output.rowCount}</gel:log>
</gel:script>