Cutting down a Char
425534Jul 29 2004 — edited Jul 30 2004I am new to Oracle so this is probably really easy (but maybe not).
I am working in Oracle Forms, and I have a list that is full of character strings that are up to 25 characters long. I take this value and try to use it somewhere else, but it seems to be padded on the right with white spaces that also get copied. Here is an example:
string_to_copy -> (actual value '12345')
new_string := string_to_copy || 'Hello'
What I see with the new string:
12345 Hello
I need a way to copy the original string into a temporary variable and cut down all the spaces on the right of it. I am a C++/C# programmer so this is kind of tough for me to figure out in PL/SQL.
I can not change the original value at all, and the original value can contain spaces between words, ie 12345 6789 10
So I think what I need to do is loop through the string with a 2 character look-ahead and find the first occurance of 2 whitespaces in a row. Once I find this I will take the Loop Control Variable and use that in declaring a new string of that length ????????
That is one idea and problably the wrong one, since you can not declare variables after "begin" in PL/SQL. Please give me some insight in how to best approach this. Thank You.