Thanks a lot Karen. Once again you have helped me. It worked perfectly. LAST 
LIKE or FIRST LIKE have probably got out of fashion. I can see the SQL logic in 
your syntax.


Y s

Bo Franzén

________________________________
Från: 'Karen Tellef' via RBASE-L <[email protected]>
Skickat: den 3 juli 2021 17:25:47
Till: [email protected]
Ämne: Re: [RBASE-L] - UPDATE a column WHERE a dot is missing in the end?

I've never heard of a function "LAST LIKE", is that valid?

What I would do is:
UPDATE johantab SET kalla2 = (kalla2 + '.') WHERE kalla2 NOT LIKE '%.'

Didn't test it, but I think that would work


Karen




-----Original Message-----
From: Bo Franzén <[email protected]>
To: R:BASE <[email protected]>
Sent: Sat, Jul 3, 2021 9:42 am
Subject: [RBASE-L] - UPDATE a column WHERE a dot is missing in the end?

Dear R:BASE!

I have a price database (Middle Ages) that is going to be printed in due time. 
A column, källa2, with the (often printed) source in a TEXT FORMAT often lacks 
a dot [.] in the end. How to UPDATE all rows that lack a dot? I have tried:

R>UPDATE johantab SET källa2 = LAST LIKE '%.' WHERE källa2 LAST NOT LIKE '%.'
-ERROR- Column källa2 must be a valid TEXT. ( 122)

Strange, since källa2 is a TEXT column. Operators change over time. Probably 
I'm behind. One way would be to add a dot to all rows in order to SRPL '..' 
with '.' But that did not work either:

R>UPDATE johantab SET källa2 = LAST LIKE '%.'
-ERROR- Column källa2 must be a valid TEXT. ( 122)

To UPDATE 7733 columns by hand seems like a terrible waste of time. But, as 
said, I am probably behind.

Bo Franzén
Department of Economic History
Stockholm University

R>COMPUTE ALL tran_id FROM johantab WHERE källa2 LAST NOT LIKE '%.'
tran_id            Count =           7733
                   Rows =            8008

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/28791a1702b0408da38541b47ad63903%40ekohist.su.se<https://groups.google.com/d/msgid/rbase-l/28791a1702b0408da38541b47ad63903%40ekohist.su.se?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1370059842.4903629.1625325947913%40mail.yahoo.com<https://groups.google.com/d/msgid/rbase-l/1370059842.4903629.1625325947913%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/88ee1a9c7a2b438f8e86634a25a61d3f%40ekohist.su.se.

Reply via email to