Hallo Bechti, 8)
Probiere vielleicht so...:
Code:
datamodule1.Query1_Todo.SQL.Clear;
statement := 'SET TERM^;' +
' ALTER PROCEDURE RESET_GEN_IDX RETURNS (MAXVALUE Integer,CURVALUE Integer,NEXTVALUE Integer)'+
' AS begin Select max(maidx), gen_id(gen_idx,0)'+
// ab hier
' from mitarbeiter into `maxvalue`, `curvalue`; nextvalue = gen_Id(gen_idx, -(:curvalue-maxvalue)); '+
' end' +
' SET TERM;^';
datamodule1.Query1_Todo.SQL.Add(statement);
datamodule1.Query1_Todo.ExecSQL;
Gruß
Paul Jr.