cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Escaping special characters in Oracle - Execute

elise_henschen
New Contributor III

We have an Oracle table that weโ€™re trying to use an Execute snap on. The column names contain $ (t$field is the actual name), which seems to be throwing it off. Iโ€™ve tried the following ways, but the snap continues to look for an object, rather than treating it as a string. Is there another way I could try this out?

With the expression toggle enabled:

'SELECT table.t$field FROM owner.tableName table'

'SELECT table.t\$field FROM owner.tableName table'

'SELECT table.t\\$field FROM owner.tableName table'

'SELECT table.t\$$field FROM owner.tableName table'

'SELECT table.t$$field FROM owner.tableName table'

'SELECT table.' + $['T$FIELD'] + ' FROM owner.tableName table'

With the expression toggle disabled:

SELECT table.t$field FROM owner.tableName table

SELECT table.t\$field FROM owner.tableName table

SELECT table.t\\$field FROM owner.tableName table

I keep getting the same error on the snap:

om.snaplogic.jsonpath.UnexpectedTypeException: Expecting object for JSON-Path field reference โ€˜fieldโ€™, found: null

Does it just not support having $ in the field names? Anyone know of the proper way to do this or a workaround?
Thanks in advance

2 REPLIES 2

sriram
Former Employee

If your Oracle table has columns whose names contain a โ€˜$โ€™ (or any other special character) in it, hereโ€™s how the execute query needs to look like:

Query: select โ€œUSER$IDโ€ from testtable1

3c8ebed92999643a5773160547948020c3186c81.png
11d43268b1b7b17cac283e1622a592b73db20883.png

Note: Expression should not be enabled on the โ€œOracle Executeโ€ snap

Thank you! That did the trick.