lefts,vlefts

Declaration

cstring function lefts(cstring S, Integer I))

varchar function vlefts(varchar S, Integer I))

Description

Lefts returns the left I number of characters from string S. I must be greater than zero and less than or equal to the length of S.

Example Stored Procedure

CREATE PROCEDURE test_vlefts(s varchar(30), I smallint)

RETURNS (result varchar(30)) AS

BEGIN

result = vlefts(s,i);

END!!

WISQL - calling the example stored procedure

execute procedure test_vlefts("abcfg",5);

RESULT

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

abcfg

execute procedure test_vlefts("abcfg",3);

RESULT

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

abc

execute procedure test_vlefts("abcfg",0);

RESULT

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

Bad parameters in substring

execute procedure test_vlefts("abcfg",6);

RESULT

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

abcfg