Substring & Length

#1
Hey bros,

I have a little syntax problem. I am already searching for about 2 hours what string and count functions Progress has. But I'vent found enough. So I thought, maybe you can help me.

What is the real Progress Syntax of this:
SELECT SUBSTRING('12;3', 1, (SELECT CHARINDEX(';', '12;3')-1)) AS Column1,
SUBSTRING('12;3', (SELECT CHARINDEX(';', '12;3')+1), (SELECT LEN('12;3'))) AS Column2
FROM tablename

Explanation:
The Select should give me 2 columns. In the first column I wanna have '12' of the text '12;3'. In the second, I wanna have '3'. Is this possible?:confused:

best regards,
Daman
 
#4
hi bros,
does anyone know a function for counting a length of a word? or finding out a character in a word?
plz help me. i m already disapointed searching the whole day long :(
regards
 
#5
1) 9.1 is ancient, obsolete and unsupported.

2) Progress is not SQL. The longer you try to use SQL with Progress the more frustrated you will become.

Code:
for each tablename no-lock:
  display entry( 1, field1, ";" ) entry( 2, field2, ";" ).
end.
 
#6
yes unfortunatelly you re right. honestly, i would really wanna avoid working with this environment.
but i dont have no choice. it is still running on ones customers plattform. so i have to go through this.

thx for help bros
 
#7
I know this thread is old and dead, but just to document this commonly run in-to issue with OpenEdge for all of the web searching community to see, the issue is that Progress has 'array columns' so when, from SQL you run something like:

SELECT quarterlySales from PUB.MySales;

and you get something like:
102332.67;330002.77;443434.55;333376.50


you can select an array column individualy with the syntax below:
SELECT quarterlySales[1] from PUB.MySales;

which will yield:
102332.67
 
Top