Double Quotes around SQL field

8 views
Skip to first unread message

Bax Ter

unread,
Sep 14, 2018, 2:46:40 AM9/14/18
to InterSystems: Ensemble in Healthcare
I am trying to output the field Text with double quotes around the value.

I am currently trying to use CHAR_LENGTH({fn CONCAT('"',Text,'"')}) I have also tried {fn CONCAT('"',Text,'"')},  I have tried ('"',+ Text+, '"') and all of these are showing invalid with the red squiggly line not even alllowing me to attempt to compile...Any help would be greatly appreciated.
Thanks
Lou

Jose Sampaio

unread,
Sep 14, 2018, 10:53:13 AM9/14/18
to Ensemble-in...@googlegroups.com
Hi,

There's an example::
USER>Set tStrDoubleQuotes = "String with double quotes"
USER>Write """tStrDoubleQuotes"""

Hope it helps.

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony Beukes

unread,
Sep 14, 2018, 11:05:44 AM9/14/18
to ensemble-in...@googlegroups.com

I believe CONCAT only accepts two arguments.

 

Instead of using the CONCAT function, try using the SQL concatenation operator ||:

'"'||Text||'"'

--

sys...@sys-doc.com

unread,
Sep 14, 2018, 11:18:35 AM9/14/18
to Ensemble-in...@googlegroups.com

From https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_regexp#GCOS_C68836

The quote character does not take an escape prefix; to specify a literal quote character, double it "".

Try (' "” Text “" ')

 

Thank you,

 

Jason Bowen

Interface Engineer

Sys-Doc Integration Consulting

sys...@sys-doc.com

Cell: (760) 608-3888

Fax: (760) 463-1345

The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. This email document may contain information covered under the Privacy Act, 5 USC 552(a), and/or the Health Insurance Portability and Accountability Act (PL 104-191) and its various implementing regulations, and must be protected in accordance with those provisions. Healthcare information is personal and sensitive and must be treated accordingly. This correspondence, which may contain healthcare information, is being provided to you after appropriate authorization from the patient or under circumstances that don't require patient authorization. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Re-disclosure without additional patient consent or as permitted by law is prohibited. Unauthorized re-disclosure or failure to maintain confidentiality subjects you to application of appropriate sanction. If you have received this correspondence in error, please notify the sender by return email at once and destroy any copies you have made.

 

From: ensemble-in...@googlegroups.com <ensemble-in...@googlegroups.com> On Behalf Of Bax Ter
Sent: Thursday, September 13, 2018 11:47 PM
To: InterSystems: Ensemble in Healthcare <Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] Double Quotes around SQL field

 

I am trying to output the field Text with double quotes around the value.

--

Reply all
Reply to author
Forward
0 new messages