All Apps and Add-ons

DBConnect MS SQL reuse same field names in query

anthonyfry
Explorer

I have an issue where a field in the database I connect to has quotation characters. Previously I have used Replace function in the sql editor:
Replace ("Closure Text", '"', '%') AS "Closure Text",
this works for Oracle SQL database.

When I come to use the same command for an MS SQL database I get an error:

"java.lang.IllegalStateException: Column name conflicted, please set shortnames option to false and retry"

The query below works if I give new field names but I really want to use the same field names.

SELECT *,
isnull(Workgroup, 'Blank') as Workgroup2,
Replace (last_action, '"', '%') AS last_action,
Replace (Problem, '"', '%') AS Problem
FROM "OSMQ"."dbo"."OSMQ_TicketData"

where (Ticket_Status='Cancelled'or Ticket_Status='Closed' or Ticket_Status = 'Solved/Not Closed') and (Date_Closed >= CONVERT(DATETIME, CONVERT(DATE, getdate()))-1 and Date_Closed < CONVERT(DATETIME, CONVERT(DATE, getdate())));

Any advice would be greatly appreciated.
I am using SPLUNK Enterprise 8.0.3 & DBConnect 3.2.0

0 Karma

PavelP
Motivator

Hello @anthonyfry,

I hope somebody can help you here. In the same time you can try to ask your question on https://dba.stackexchange.com/

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...