Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM Binaries » View Thread |
Messages 1 to 1 of 1 total |
Generic Server-Side SQL Processor |
Tue, May 2 2006 1:28 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Here is a generic server-side SQL processor for executing large scripts that
don't return result sets. It could handle result sets with the addition of another return parameter for saving the result set stream back to the client via a parameter. Also, it could be improved to send back query progress information via the TDBISAMSession.SendProcedureProgress method. You can call this procedure using a remote session like this: with MyRemoteSession do begin with RemoteParams do begin CreateParam(ftString,'DatabaseName').AsString:='MyDatabase'; CreateParam(ftString,'SQL').AsString:=MySQLScript; CallRemoteProcedure('ServerSideSQLProcessor'); end; end; Also, be sure to set up the proper rights, etc. for the server-side procedure using the Server Administration Utility or the TDBISAMSession administrative methods. procedure TForm1.DBISAMEngineServerProcedure(Sender: TObject; ServerSession: TDBISAMSession; const ProcedureName: String); var TempQuery: TDBISAMQuery; TempDescription: string; TempPath: string; begin if AnsiSameText(ProcedureName,'ServerSideSQLProcessor') then begin TempQuery:=TDBISAMQuery.Create(nil); try with ServerSession do begin Engine.GetServerDatabase(RemoteParams.ParamByName('DatabaseName'), TempDescription,TempPath); with TempQuery do begin SessionName:=ServerSession.SessionName; DatabaseName:=TempPath; SQL.Text:=RemoteParams.ParamByName('SQL').AsString; ExecSQL; RemoteParams.Clear; RemoteParams.CreateParam(ftInteger,'RowsAffected').AsInteger:=RowsAffected; end; end; finally TempQuery.Free; end; end; end; -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |