Subject | Substring gives odd result |
---|---|
Author | rvellacott@passfield.co.uk |
Post date | 2001-11-28T18:07:49Z |
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
CREATE PROCEDURE TESTPROC
RETURNS
(RESULT VARCHAR(12))
AS
BEGIN
RESULT = SUBSTRING('123456789' FROM 1 FOR 5);
END
EXECUTE PROCEDURE TESTPROC