My Oracle Support Banner

How to use an apostrophe when constructing a query within the query-database xpath function? (Doc ID 1345053.1)

Last updated on MARCH 13, 2019

Applies to:

Oracle Business Process Management Suite - Version 11.1.1.5.0 and later
Information in this document applies to any platform.
***Checked for relevance on 07-Jan-2013***

Goal

How to use an apostrophe when constructing a query within the query-database xpath function?

For example:


-> oraext:query-database(concat('select ', ora:addQuotes(' '), ' from dual'), false(), false(), 'jdbc/customNotificationDatabase' )
FAILS

-> oraext:query-database('select sysdate from dual', false(), false(), 'jdbc/customNotificationDatabase')
WORKS

-> oraext:query-database(string(bpmn:getDataObject('sla')), false(), false(), 'jdbc/customNotificationDatabase' ).
sla is a process variable of type string that contains the query to be executed
FAILS if sla contains "select ' ' from dual")
WORKS if sla contains "select sysdate from dual")




When it fails it will produce this exception:

oracle.fabric.common.xml.xpath.XPathFunctionException:
oracle.xml.sql.OracleXMLSQLException: Character ''' is not allowed in an XML tag name.



Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.