Subject | Re: [ib-support] Substring gives odd result |
---|---|
Author | Robert F. Tulloch |
Post date | 2001-11-28T18:31:04Z |
rvellacott@... wrote:
12345
>Perhaps is should be 0 for 5. SUBSTR('123456789',1,5) would return
> Why does this procedure return '23456' when it should return '12345'?
>
> CREATE PROCEDURE TESTPROC
> RETURNS
> (RESULT VARCHAR(12))
> AS
> BEGIN
> RESULT = SUBSTRING('123456789' FROM 1 FOR 5);
> END
>
> EXECUTE PROCEDURE TESTPROC
12345