Maybe I'm reading your statement wrong, but no I don't think that's what you 
wanted to do.  Did you want to do this?

UPDATE transx SET trxnum = (SRPL(trxnum, 'V0', 'v0', 0))


 


Karen

 

 

-----Original Message-----
From: Bruce Chitiea <[email protected]>
To: rbase-l <[email protected]>
Sent: Sun, Jan 14, 2018 12:11 pm
Subject: [RBASE-L] - Disaster Avoidance: SRPL Syntax Question


Happy New Year to all!


Might this be the correct SRPL syntax for replacing a substring within a text 
column? If not, what?


SET VAR vTargetColumn TEXT = NULL
SET VAR vTargetColumn = 'ColumnNAME'
UPDATE TableNAME SET &vTargetColumn = 
(SRPL(&vTargetColumn,'SearchString','ReplaceString',0))


I ask because I attempted a SRPL on a column using a literal string in place of 
'&vTargetColumn', with an ugly result (Fortunately I had a backup. )


Target column 'transx' contained several thousand values [ V00xxxxxx | 
v00xxxxxx ] where 'x' might be any digit. For visual clarity-in-reporting's 
sake, I decided to replace the legacy capital 'V' with lower case 'v'.


UPDATE transx SET trxnum = (SRPL('V0','V','v',0)) WHERE trxnum LIKE 'V0%'


This produced a uniform value of 'v0'. No trailing digits. Disaster. Restore 
from backup.


???


Thanks very much,


Bruce Chitiea
SafeSectors, Inc.
909.238.9012 m

-- 
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].
For more options, visit https://groups.google.com/d/optout.


-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to