Question Michael Lundberg · Aug 15, 2022

SQL insert/update removes spaces

Hi!

I have a question regarding SQL insert/update from the mananger portal's SQL window.

I am trying to do an insert with a value that contains multiple spaces ($32) between two words. This is needed for a comparative reason. But the spaces are automatically trimmed away all the time. How should I write to keep these?

Example:

Insert into TableA
(MyColumn) Values('xxxx    yyyy')

then the spaces are trimmed away and it becomes: 'xxxx yyyy'

But I want to keep the spaces. How do I get around the problem?

Regards,
Michael

Product version: IRIS 2022.1

Comments

Julius Kavay · Aug 15, 2022

Did you check this or are you just saying that? What does this query show?

select MyColumn, length(MyColumn) from TableA
0
Michael Lundberg  Aug 15, 2022 to Julius Kavay

Thanks for reply.

This was tricky. Maybe I'm being visually deceived.

The text I am trying to enter is 24 characters long. If I take the selected value after and paste it into notepad, it shows the length 21.

But your suggestion to try SQL select length on that column/value shows the value 23

/Michael

0
Julius Kavay  Aug 15, 2022 to Michael Lundberg

The only tricky thing is the (web)management portal. Put the following few lines into a "test.html" file and the open it with your favorite browser.

<html>
<head></head>
<body>
A   simple  text     with    some spaces<br>
<pre>A   simple  text     with    some spaces</pre>
</body>
</html>

You see the difference?

0
Michael Lundberg  Aug 15, 2022 to Julius Kavay

Hey!

You are absolutely right! I was also starting to think it was the html presentation. But I initially thought it would be like wysiwyg in the SQL window of the portal.

Thank you so much and you explained the "conundrum" for me :O)

Regards, Michael

0