--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
--
So the result I want is:result = "This_is_an_example."
Or even delete the string:result2 = "Thisisanexample."
You can use CONVERT only if the substring is 1 character long,
I usually use CHANGE( "this is a test","is","was")
will change this is a test to thwas was a test
And CHANGE will allow replaceing one string that is a different length, so "FOUR" can be changed to "SIX"
I think most of the PICKS have CHANGE
--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com
You can use CONVERT only if the substring is 1 character long, though true is a little miss leading.
CONVERT can be multiple characters as well, it is just a one for one whereas CHANGE is by word
For Prime, Universe and Unidata, A = CONVERT(A,”ABCDE”,”12345”) will convert A to 1 and B to 2 and C to 3 and D to 4 and E to 5, just not ONLY the complete word “ABCDE” to “12345” Others the syntax would be A = CONVERT(“ABCDE”,”12345”,A).
I prefer the statement over the function CONVERT “ABCDE” TO “12345” IN A, but not all MV platforms support that.
Dan Ell jBASE Technical Engineer 949-383-2429 | 866‑582‑8447 da...@jbase.com | www.jbase.com 9245 Research Drive , Irvine , 92618
Sent: Wednesday, February 7, 2018 2:51 PM
To: Pick and MultiValue Databases <mvd...@googlegroups.com>
Subject: Re: [mvdbms] How can I replace or delete a substring in a string?
--
The EREPLACE() function should do what you want with substrings of any length.
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200
From: mvd...@googlegroups.com [mailto:mvd...@googlegroups.com] On Behalf Of Steve Douglas
Sent: 07 February 2018 17:40
To: Pick and MultiValue Databases
--
If you want to remove all spaces from the front and back of field 1, you could do
UPDATE.RECORD filename ALL 1,EVAL “TRIM(@RECORD<1>)”
Cleber
--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
If you want to remove all spaces from the front and back of field 1, you could do
UPDATE.RECORD filename ALL 1,EVAL “TRIM(@RECORD<1>)”
Cleber
2018-02-07 15:20 GMT-02:00 Rodrigo Zanatta Silva <rodrigoza...@gmail.com>:
I have a variable with a string:example = "This is an example."How can I replace all space with underscore "_"? The most obvious function was the basic.replace. But, it look like to replace the string itself. I didn't understand how to use it. How can I use it?So the result I want is:result = "This_is_an_example."Another example with substring:result1 = "This<space>is<space>an<space>exemple".Or even delete the string:result2 = "Thisisanexample."What function I use to have this result?
--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
Hi Chandru,
Although I think that Cleber's response to the original posting mis-understood the requirement and has been followed by a variety of alternative solutions, you asked about UPDATE.RECORD…
The UPDATE.RECORD command originated in Prime Information and allowed updates to selected records or all records in a file from the command line. For example, you could give everyone a 10% pay rise (nice!) with something like
UPDATE.RECORD PAYROLL ALL SALARY, EVAL "SALARY * 1.1"
where the qualifying information to the command is the file name, record id(s) or ALL, name or position of the field to be updated and new value which, in this case, is an evaluated expression.
UPDATE.RECORD was carried forward into PI/open but was missing from UniVerse. I recall being at a VMark user group meeting many years ago when the lack of this useful command was raised. Because at that time VMark didn't give the impression that it would be added anytime soon, we (Ladybridge Systems) took the version that has always been part of QM and added it to our UniVerse Toolkit which was used by a good number of UV sites in the UK. Our version extended the command to have a "visual mode" but that takes us down a whole new path that we probably don't need to explore in answering your question.
I forget exactly when it happened, but somewhere along the way, UPDATE.RECORD was added to UV. Looking at the source code in the APP.PROGS file suggests that this was done by Informix in 2000. For some reason, the relevant VOC item was only added in the Information flavour of UV and the command also appears to be undocumented.
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200
From: mvd...@googlegroups.com [mailto:mvd...@googlegroups.com] On Behalf Of chandru murthi
Sent: 13 February 2018 15:26
To: Pick and MultiValue Databases
Subject: Re: [mvdbms] How can I replace or delete a substring in a string?
> UPDATE.RECORD filename ALL 1,EVAL “TRIM(@RECORD<1>)”
Late to this party, but what benighted system's syntax is that?! I've seen neither UPDATE.RECORD nor EVAL in BASIC (it's a retrieval function.)
On Thursday, February 8, 2018 at 5:30:43 PM UTC-5, Cleber wrote:
If you want to remove all spaces from the front and back of field 1, you could do
UPDATE.RECORD filename ALL 1,EVAL “TRIM(@RECORD<1>)”
Cleber
Livre de vírus. www.avast.com. |
UPDATE.RECORD AArrrrggghh! The UPDATE verb was the worst idea that Dick ever had. It was simply UPDATE in the original Reality code - I started on Reality 2.4D - It renders a safe user-friendly report environment totally disastrous. I cannot for the life of me see why anybody would put it back. There is no database cross validation of what is happening. Any clown can just crash the system irretrievably - and yes there are plenty of them in the user arena, plus a few programmers I have met. We actually used to rename ED where the half-educated users were around. A few days course on ENGLISH without UPDATE was perfect for them.