1]);:=StrToDateTime(ParamsList[2]);:=ParamsList[3];E:Exception doEExternalException.CreateFmt ( Error ) ;;; TJobs.ExecQuery (const SqlCmd: WideString): WideString ;: string;, j, ColParam, L: integer ;: array of string;, ParamStr: string;.ModifyUserInfo(User,Host,PID);:=AnsiUpperCase(Trim(SqlCmd));:=CmdText;:=Pos(laquo;(raquo;,CmdText);i=0 then i:=Length (CmdText) +1;:= raquo ;; j:=i - 1 downto 1 do beginCmdText [j]= then break;:=CmdText[j]+ProcName;;(ProcName);(ParamStr,1,i);:=0;(TmpArray,ColParam);ParamStrlt;gt;laquo;raquo; then begin:=Pos(laquo;)raquo;,ParamStr);(ParamStr,i,Length(ParamStr)-i+1);ParamStrlt;gt;laquo;raquo; do begin (ColParam); (TmpArray, ColParam);:=Pos (, , ParamStr); L=0 then L:=Length (ParamStr) +1;:=Copy (ParamStr, 1, L - 1 ); (s lt; gt; ) and (s [1]= ) do Delete (s, 1,1); (s lt; gt; ) and (s [Length ( s)]= ) do Delete (s, Length (s), 1); s [1]= then Delete (s, 1,1); s [Length (s)]= then Delete (s, Length (s), 1); (ParamStr, 1, L); [ColParam - 1]:=s ;;;:=VarArrayCreate ([0, ColParam - 1], varVariant); i:= 0 to ColParam - 1 do begin[i]:=TmpArray[i];;(ParamsArray);:=laquo;OKraquo;;:=laquo;ERraquo;;;;TJobs.AppSrvConnect(const hostname, username, pwd:): WideString; not JobAppSrvForm.ServerReady then begin:= Can t connect raquo ;;;;:=HostName;:=UserName; DataBase1 do begin.Values ??[ SERVER NAME ] :=.MainDB.Params.Values ??[ SERVER NAME ] ;. Values ??[ USER NAME ]:=JobAppSrvForm.MainDB.Params.Values ??
[ USER NAME ] ;. Values ??[ PASSWORD ]:=JobAppSrvForm.MainDB.Params.Values ??
[ PASSWORD ] ;; not DataBase1.Connected then begin.Connected:=true;.UserDBConnectInfo(JobAppSrvForm.DBSERVER_NAM,User,Host,PID);:=JobAppSrvForm.DBSERVER_NAME;E:Exception do:=E.Message ;;; TJobs.RemoteDataModuleCreate (Sender: TObject);:=TMemoryStream.Create;:=TStringList.Create ;; TJobs.RemoteDataModuleDestroy (Sender: TObject) ;. Free; .Free; TJobs.SelectQuery ( const SqlCmd: WideString): OleVariant;, str: string;, j: integer;, CDSetFull: TClientDataSet; withoutGroupByFunc: OleVariant;, j: integer; .Position:=0; .LoadFromStream (TempStream) ;. EmptyDataSet;:=CDSetFull.FieldCount - 1; not CDSetFull.Eof do begin.Insert; i:=0 to j do.Fields [i] .Value:=CdSetFull.Fields [i] .Value; .Next ;;
Додаток 2
Лістинг файлу MemProc.dpr
MemProc ;, DB, Dialogs, DBClient, variants, SysUtils, Classes, windows;
{$ R * .res}=array of Variant;=record: string [64] ;: string [9] ;: longword ;;=record: string ;: double ;;: TDateTime;:array of TXMLFldDescr;: TStringList ;: TMemoryStream; Suspend (var CDSetBuf: TClientDataSet; var: DynArrayOfVariant) ;: integer; .Insert; j:=0 to CDSetBuf.FieldCount - 1 do (CDSetBuf.Fields [j] .DataType= ftInteger) or
(CDSetBuf.Fields [j] .DataType=ftSmallint) then.Fields [j] .asInteger:=TmpRecord [j] (CDSetBuf.Fields [j] .DataType=ftFloat) then.Fields [ j] .AsFloat:=TmpRecord [j] (CDSetBuf.Fields [j] .DataType=ftDateTime) then.Fields[j].asDateTime:=TmpRecord[j].Fields[j].AsString:=TmpRecord[j];.Post;(TmpRecord,0);;MakeRecordSet(var CDSetBuf: TClientDataSet);=' lt;? Xml version= 1.0 standalone= yes ? gt;
lt; DATAPACKET Version= 2.0 gt; lt; METADATA gt; lt; FIELDS gt; laquo ;;= lt; FIELD attrname=% s fieldtype=% s / gt; laquo ;;= lt; FIELD attrname=% s fieldtype= string =% d / gt; laquo ;;= lt; FIELD attrname=% s fieldtype= string = FixedChar WIDTH=% d / gt; laquo ;;= lt;/FIELDS gt; lt; PARAMS =laquo;0raquo;/gt;lt;/METADATAgt;lt;ROWDATAgt;laquo;;=raquo;lt;/ROWDATAgt;lt;/DATAPACKETgt;laquo;;,j,FieldsCount:Integer ;: string; DateTimeToXMLFmt (DT: TDateTime): string;(Result,raquo;yyyymmddhh:nn:sszzzlaquo;,DT);(raquo;Tlaquo;,Result,9);;VariantToStr(FldValue:Variant; FldType: string): string; FldType= i4 then Result:=IntToStr (Integer (FldValue)) elseFldType= r8 then Result:=FloatToStr (Extended (FldValue)) elseFldType= dateTime then:=DateTimeToXMLFmt (TDateTime (FldValue)) else:=String (FldValue) ;;. Clear; .Add (XMLMetaHeader);:=High (FldArr); i:=Low (FldArr) to FieldsCount do beginFldArr [i] dofieldtype = string then:=Format (XMLVarcharFld, [attrname, width]) fieldtype= FixedChar then:=Format(XMLCharFld,[attrname,width]):=Format(XMLNumFld,[attrname,fieldtype]);.Add(TmpStr);;.Add(XMLMetaEnd);:=raquo;lt;ROW laquo ;; j:=0 to FieldsCount doFldArr [j] do (fieldtype= string ) or (fieldtype= FixedChar ) then:=TmpStr + attrname + = fieldtype= dateTime 'then:=TmpStr + FldArr [j] trname +
= + VariantToStr (Now, FldArr [j] .fieldtype) + :=TmpStr + FldArr [j] trname + = 0 raquo;;:=TmpStr+laquo;/gt;raquo;;.Add(TmpStr);.Add(XMLDataEnd);.Clear;.SaveToStream(TempStream);.Position:=0;.LoadFromStream(TempStream);.EmptyDataSet;;XMLFieldDescription(FieldName,FieldType:String; Length:=0) ;...