rights, vrights
Declaration
cstring function rights(cstring S, Integer I)
varchar function rights(varchar S, Integer I)
Description
Rights returns the right I number of characters from string S. I must be
greater than 0 and less than or equal to the length of S.
Example Stored Procedure
CREATE PROCEDURE test_vrights(s varchar(30), I smallint)
RETURNS (result varchar(30)) AS
BEGIN
result = vrights(s,i);
END!!
WISQL - calling the example stored procedure
execute procedure test_vrights("abcfg",3);
RESULT
==============================
cfg
execute procedure test_vrights("abcfg",5);
RESULT
==============================
abcfg
execute procedure test_vrights("abcfg",6);
RESULT
==============================
Bad parameters in substring
execute procedure test_vrights("abcfg",0);
RESULT
==============================
Bad parameters in substring