Arquivo para Stored Procedures

Executando SP’s com Delphi

Usando o componente TADOStoredProc:

ADOStoredProc1.ProcedureName := ‘GetAnimalWeight’;
ADOStoredProc1.Parameters.Refresh;
ADOStoredProc1.Parameters.ParamByName(‘@strName’).Value := ‘Boa’;
ADOStoredProc1.ExecProc;
ShowMessage(ADOStoredProc1.Parameters.ParamValues['@RETURN_VALUE']);

Usando o componente TADOCommand:

ADOCommand1.CommandType := cmdStoredProc;
ADOCommand1.CommandText := ‘CalcSum2′;
ADOCommand1.Parameters.Refresh;
ADOCommand1.Parameters.ParamByName(‘@intValue1′).Value := 10;
ADOCommand1.Parameters.ParamByName(‘@intValue2′).Value := 28;
ADOCommand1.Execute;
ShowMessage(ADOCommand1.Parameters.ParamValues['@RETURN_VALUE']);

Schema_ADO

Deixe um comentário

Stored Procedures – Reusable Business Processes

Stored procedures off-load common business tasks from the client to the server, causing major performance gains. Any InterBase application can use stored procedures. They encourage modular design, and make reuse and maintenance easier.

Deixe um comentário