AnsweredAssumed Answered

Issue: Creating a query in a Clarity with oracle database via XOG API

Question asked by kovairsoftware on Apr 23, 2019
Latest reply on Apr 23, 2019 by Dave_3.0

I am trying to create a clarity query via XOG API:

 

<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_contentPack.xsd">
<Header action="write" externalSource="NIKU"
objectType="contentPack" version="8.0"/>
<contentPack update="true">
<queries update="true">
<query code="ABC" source="customer">
<nls languageCode="en" name="xyz"/>
<nsql dbId="Niku" dbVendor="all">
Select @Select:DIM:USER_DEF:IMPLIED:PRJ:srm_projects.unique_name:CODE@
,@Select:DIM:USER_DEF:IMPLIED:PRJ1:srm_projects.ID:ID@
,@Select:srm_projects.NAME:NAME@
,@Select:srm_projects.LAST_UPDATED_DATE:LAST_UPDATED_DATE_FILTER@
,@Select:to_char(srm_projects.LAST_UPDATED_DATE, 'HH24:MI:SS.FF3'):LAST_UPDATED_DATE@
,@Select:to_char(srm_projects.CREATED_DATE, 'HH24:MI:SS.FF3'):CREATED_DATE@
FROM srm_projects
WHERE @FILTER@
</nsql>
</query>
</queries>
</contentPack>
</NikuDataBus>

 

But getting the following error after posting:

 

Error - Error:XOG-3052: Query record has not been inserted com.niku.union.persistence.nsql.NSQLSyntaxException: NSQL Syntax exception: NSQL_SYNTAX_ERROR_UNKNOWN_CONSTRUCT, Info: @Select:to_char(srm_projects.LAST_UPDATED_DATE, 'HH24:MI:SS.FF3') AS VARCHAR):LAST_UPDATED_DATE@ at com.niku.union.persistence.nsql.NSQLStatementSet.checkRemaingNSQLConstructs(NSQLStatementSet.java:762) at com.niku.union.persistence.nsql.NSQLStatementSet.parseNSQL(NSQLStatementSet.java:741) at com.niku.union.persistence.nsql.NSQLStatementSet.(NSQLStatementSet.java:228) at com.niku.union.persistence.nsql.NSQLStatementSet.(NSQLStatementSet.java:132) at com.niku.union.persistence.nsql.NSQLQuery.initialize(NSQLQuery.java:268) at com.niku.union.persistence.nsql.NSQLQuery.setNSQL(NSQLQuery.java:792) at com.niku.union.persistence.nsql.NSQLQuery.(NSQLQuery.java:328) at com.niku.union.persistence.nsql.NSQLController.createQuery(NSQLController.java:173) at com.niku.union.persistence.nsql.NSQLController.createQuery(NSQLController.java:184) at com.niku.npt.xblhandlers.GGNSQLHandler.xogStoreQuery(GGNSQLHandler.java:768) at com.niku.npt.xblhandlers.GGNSQLHandler.postProcess(GGNSQLHandler.java:124) at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1417) at com.niku.union.xml.dom.DOMWalker.postProcess(DOMWalker.java:210) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:94) at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51) at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:388) at com.niku.xql2.handlers.LoopHandler.processSet(LoopHandler.java:259) at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:216) at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1383) at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92) at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51) at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:388) at com.niku.xql2.handlers.LoopHandler.processSet(LoopHandler.java:259) at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:216) at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1383) at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74) at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51) at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:388) at com.niku.xql2.handlers.LoopHandler.processSet(LoopHandler.java:259) at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:216) at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1383) at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74) at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51) at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:388) at com.niku.xql2.handlers.LoopHandler.processSet(LoopHandler.java:259) at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:216) at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1383) at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194) at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74) at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51) at com.niku.xql2.handlers.TryHandler.preProcess(TryHandler.java:54) at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1383) at com.

 

 

It seems that the error is with the NSQL. 

I have used the 'to_char' for converting datetime value to a specified format.

 

Can anyone provide me with a correct solution?

Outcomes