03-28-2012، 11:05 AM
(آخرین تغییر در ارسال: 03-28-2012، 11:07 AM توسط Amin_Mansouri.)
کد:
procedure TForm1.Button2Click(Sender: TObject);
var text: String;
CmdStr,Thread_CMD : String;
x: integer;
Adostoredproc1 : TADOStoredProc ;
Param : TParameter;
begin
Adostoredproc1:=TADOStoredProc.Create(Self);
CmdStr:='-DISPLAY THREAD(*) LOCATION(*)' ;
with ADOStoredProc1 do
Begin
Connection := DataModule1.ADOConnection1;
ProcedureName := 'SYSPROC.ADMIN_COMMAND_DB2';
Param:= Parameters.AddParameter;
Param.Name :='DB2_CMD';
Param.DataType := ftString;
Param.Direction := pdInput;
Param.Size := 32700;
Param:= Parameters.AddParameter;
Param.Name :='LEN_CMD';
Param.DataType := ftInteger;
Param.Direction := pdInput;
Param:= Parameters.AddParameter;
Param.Name :='PARSE_TYPE';
Param.DataType := ftString;
Param.Direction := pdInput;
Param.Size := 3;
Param:= Parameters.AddParameter;
Param.Name :='DB2_MEMBER';
Param.DataType := ftString;
Param.Direction := pdInput;
Param.Size := 8;
Parameters.ParamByName('DB2_CMD').Value:=CmdStr;
Parameters.ParamByName('LEN_CMD').Value:=length(CmdStr);
Parameters.ParamByName('DB2_CMD').Value:='THD';
Parameters.ParamByName('DB2_CMD').Value:='';
Active:=True;
ExecProc ;
end;
if ADOStoredProc1.Parameters.ParamByName('RETURN_CODE').Value = 0 Then
begin
For x:=0 to ADOStoredProc1.RecordCount do
begin
Text := ADOStoredProc1.FieldByName('NAME').AsString;
ShowMessage(text);
end;
end;
end;