Hi,
ich würde für den Test eine Procedure schreiben:
SQL-Code:
SET TERM ^ ;
CREATE PROCEDURE CHECK_BARCODE (
barcode varchar(20))
returns (
result char(1))
as
begin
/* check barcode */
result = 'F';
if (substring(:barcode from 1 for 1) <> 'F') then
begin
suspend;
exit;
end
if (substring(:barcode from 2 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
if (substring(:barcode from 3 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
if (substring(:barcode from 4 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
if (substring(:barcode from 5 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
if (substring(:barcode from 6 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
if (substring(:barcode from 7 for 1) not between '0' and '9') then
begin
suspend;
exit;
end
result = 'T';
suspend;
end^
SET TERM ; ^
das where sollte dann so aussehen:
where (select result from check_barcode(ScanCode)) = 'F'
Cu, Frank