September 16, 2005

Misconducted by my VB experience on Substr

There is a Substr funciton in Oracle as well as in Visual Basic. To have the first 4 characters of a string in VB I usually write code like
first_4_char = Substr(some_string, 4)
and I followed this approach in PL/SQL programming, what a big mistake.

It should be
first_4_char = Substr(some_string, 1, 4)
in Oracle PL/SQL.

No comments: