Posted by: the_hareeb July 23, 2008
SQL help please
Login in to Rate this Post:     0       ?        

inputfilename= xxxx/yyyyyyy/zzzzzzzzz/sample.txt

I have to just print out sample.txt. Another inputfilename can have value such as

xxxxxxxxxxx/yyyyyyyyyy/zzzzzzzzzzzzzzzz/sample2.in

As you can see, the letters preceding file can be varied, so we cannot use

SELECT substr(inputfilename,24)

FROM table;

because the letters preceding the file is varied.

What I am thinking is going from backwards and stop at the first'/'. so it will get sample.txt and sample2.txt.

Any help would be really appriciated.

Read Full Discussion Thread for this article