substring, vsubstring

Declaration

cstring function substring(cstring S, Integer start,Integer end)

varchar function substring(varchar S, Integer start,Integer end)

Description

substring, vsubstring return a sub string from string S starting at position start and ending at position end. If the input parameter are incorrect then you will get "Bad parameters in substring" returned.

Example Stored Procedure

CREATE PROCEDURE test_vsubstring(S varchar(30), I smallint,J smallint)

RETURNS (result varchar(30)) AS

BEGIN

result = vsubstring(S,I,J);

END!!

WISQL - calling the example stored procedure

execute procedure test_vsubstring("this and that",6,9);

RESULT

==============================

and

execute procedure test_vsubstring("this and that",6,2);

RESULT

==============================

Bad parameters in substring