GARANTIR DESCONTO

Fórum auto incremento - SQLConnection.Execute(SQLstmt, nil, @ResultSet) depreciate #425803

09/10/2012

0

No help do Delphi XE3 diz
function Execute(const SQL: string; Params: TParams): Integer; overload;
function Execute(const SQL: string; Params: TParams; var ResultSet: TDataSet): Integer; overload;
function Execute(const SQL: string; Params: TParams; ResultSet: Pointer): Integer; overload; deprecated 'Use overloaded method instead';

rotina de auto incremento

procedure TDMCustomer.cds_customerNewRecord(DataSet: TDataSet);
var
ResultSet: TCustomSQLDataSet;
SQLstmt: string;
begin
SQLstmt := 'SELECT gen_id(GCUSTOMER,1)' + 'as VALOR from RDB$DATABASE;';
ResultSet := nil;
try
DMCustomer.SQLConnection.Execute(SQLstmt, nil, @ResultSet);
if Assigned(ResultSet) then
begin
cds_customer.FieldByName('CUSTOMERID').AsInteger :=
ResultSet.FieldByName('VALOR').AsInteger;
end;
finally
ResultSet.Free;
end;
end;

Mas, o valor de CUSTOMERID não pega? Por favor, alguem pode me ajudar?
Celso Saito

Celso Saito

Responder

Posts

09/10/2012

Alisson Santos

Chamado fechado está em duplicidade
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar