You are right Mike. The Stored Procedure that follows get var pon text as
input and check for the existence of special chars except (Greek,) English,
numeric and '-' chars. If there is, it returns the position of 1st
occurrence and the character. If not it returns null.

I had to change the Greek part of the code because I could not see my reply
to the list.

*(ElOn1.STP: Stored Procedure for checking names for special chars)
--pon: name parapeter text (30)
--stp: string of error
--chars allowed 0-9,A-Z,'-'

CLEAR VAR stp_return

SET V stp TEXT,plen INTEGER,p1t TEXT,pi INTEGER

--initial values
SET V stp = NULL,pi = 0

SET V plen = (SLEN(pon))
IF plen = 0 THEN
  GOTO LOUT
ENDIF

WHILE pi < .plen THEN
  SET V pi = (.pi + 1)
  SET V p1t = (SGET(.pon,1,.pi))
  IF (p1t BETWEEN 'A' AND 'Z') OR (p1t BETWEEN '0' AND '9') THEN
    CONTINUE
  ENDIF
  IF p1t = '-' THEN
    CONTINUE
  ENDIF
  IF p1t = ' ' THEN
    SET V p1t = '[blank]'
  ENDIF
  SET V stp = ('Position:' + (CTXT(.pi)) + ', No allowed char:' + .p1t)
  BREAK
ENDW

LABEL LOUT
CLEAR VAR p%
RETURN .stp

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of MikeB
> Sent: Friday, January 03, 2003 4:49 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: Stored Procedure in Where Clause
>
>
> We need to see the contents of your Stored Procedure....
>
> ----- Original Message -----
> From: "ELOEN" <[EMAIL PROTECTED]>
> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, January 03, 2003 1:41 AM
> Subject: [RBASE-L] - Stored Procedure in Where Clause
>
>
> > Hello brotherhood of R!
> >
> > could someone confirm this?
> >
> > If I use a stored procedure in a WHERE clause, it returns all
> the rows in
> > the table.
> > For example:
> >
> > SELE ... WHERE (CALL stp_name(stp_prmtrs)) IS NOT NULL
> >
> > returns all the rows, where as
> >
> > SELE (CALL stp_name(stp_prmtrs)) FROM ...
> >
> > returns null and not null values.
> >
> > OS: win2k
> > Rbase Vers:1.862 x RT03 Win
> >
> > TIA
> > Polychronis T. Kontos
> > Athens, Greece
> >
> >
>

Reply via email to