Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#20

Re: Falsche Zeichen in einem DB-Feld per SQL finden

  Alt 17. Jul 2008, 00:23
SQL-Code:
SET TERM ^ ;
CREATE OR ALTER PROCEDURE CLEARNUMERIC (
  INPUTSTR Varchar(100)
)
RETURNS (Result Varchar(100)) AS
BEGIN
  Result = '';
  WHILE (InputStr <> '') DO BEGIN
    IF ('0123456789NOT LIKE '%' || SUBSTRING(InputStr FROM 1 FOR 1) || '%') THEN
    BEGIN
      Result = Result || SUBSTRING(InputStr FROM 1 FOR 1);
    END
    InputStr = SUBSTRING(InputStr FROM 2);
  END
  SUSPEND;
END^
SET TERM ; ^
SQL-Code:
SELECT *
FROM IDOC_REAL
WHERE (SELECT result FROM CLEARNUMERIC(ScanCode)) <> 'F'
  Mit Zitat antworten Zitat