Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84562members
353832posts

Newline character in a SQL query in Clear SCADA?

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

mhayat
Ensign
Ensign
0 Likes
1
891

Newline character in a SQL query in Clear SCADA?

I'm trying to export data from one system to import into another using CSV and new line characters in notes are making it difficult. I have tried the following query to get the data but it isn't working. Is there a way to replace newline characters in a SQL query in ClearSCADA?
 
I have tried the following query and tried this "Replace( "Message", '\n', '{3}' )" in it but didnt work for me:
SELECT TOP( 100000 )
"RecordId", "SeverityDesc" AS "~SeverityDesc", "RecordTime" AS "~RecordTime", Replace( "Message", '\n', '{3}' ) AS "Message", "User", "Category", "Foreground", "SeqNo", "CommentNo"
FROM
CDBEVENTJOURNAL
WHERE
( "~RecordTime" BETWEEN { OPC 'H-23H' } AND { OPC 'H+1H' } ) AND ( "Id" = 772856 )
ORDER BY
"~RecordTime" DESC, "SeqNo" DESC, "CommentNo" ASC
1 Reply 1
Hardin4019
Lieutenant
Lieutenant
0 Likes
0
871

Re: Newline character in a SQL query in Clear SCADA?

If you are using the SQL Export object with that query, I wouldn't think that you need the /n for a new line at all. Maybe I'm missing what the Replace and {3} are for. But I would change  Replace( "Message", '\n', '{3}' ) AS "Message"  to "Message" AS "Message".