Welcome to the new Schneider Electric Community

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

Close
Important Announcement: WELCOME to the new Schneider Electric Community! Community is now no longer part of Exchange, and is now rebranded under se.com. If you have any bookmarks and links saved, we request you to update them to ensure that you continue accessing our community from this new location. For any issues that you might encounter as part of this change, please reach out to SchneiderCommunity.Support@se.com, and the team will help to get your issues resolved.
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
82538members
350145posts

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
860

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
840

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".