SPL-problem/question
Posted in 1998
--------------E55AF3A2D3108964DE41629B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
hello,
I try to create the known upper-prodedure from June Tong, but I'll get
an syntax-error already at the beginning.
I down know my mistake.
We are using SE and I try the statement with ISQL and
query-language selection.
--
-- Procedure: GetCharAt()
-- Get a character from a string at a specified position.
--
--DROP PROCEDURE GetCharAt;
CREATE PROCEDURE GetCharAt(str CHAR(255), pos INTEGER)
RETURNING CHAR(1); ^
| here is the error-cursor blinking
DEFINE i INTEGER;
IF pos > 1 THEN
FOR i = 2 TO pos
LET str = str[2,255];
END FOR;
END IF
RETURN str[1,1];
END PROCEDURE;
bye
Dirk Niemeier
--------------E55AF3A2D3108964DE41629B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
hello,
<P>I try to create the known upper-prodedure from June Tong, but I'll get
<BR>an syntax-error already at the beginning.
<BR>I down know my mistake.
<BR>We are using SE and I try the statement with ISQL and
<BR>query-language selection.
<P>--
<BR>-- Procedure: GetCharAt()
<BR>-- Get a character from a string at a specified position.
<BR>--
<BR>--DROP PROCEDURE GetCharAt;
<P><TT>CREATE PROCEDURE GetCharAt(str CHAR(255), pos INTEGER)</TT>
<BR><TT> RETURNING CHAR(1);</TT>
<BR><TT>
^</TT>
<BR><TT>
| here is the error-cursor blinking</TT><TT></TT>
<P><TT> DEFINE i INTEGER;</TT>
<BR><TT> IF pos > 1 THEN</TT>
<BR><TT> FOR i = 2 TO pos</TT>
<BR><TT> LET str = str[2,255];</TT>
<BR><TT> END FOR;</TT>
<BR><TT> END IF</TT>
<BR><TT> RETURN str[1,1];</TT>
<BR><TT>END PROCEDURE;</TT>
<P>bye
<BR> Dirk Niemeier
<BR> </HTML>
--------------E55AF3A2D3108964DE41629B--