home *** CD-ROM | disk | FTP | other *** search
- unit mainp;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- fcOutlookList, fcButton, fcImgBtn, fcShapeBtn, Menus, ExtCtrls,
- fcClearPanel, fcButtonGroup, fcOutlookBar, OraScript, Db, MemDS,
- DBAccess, Ora, StdCtrls, Grids, DBGrids, ComCtrls,
- Buttons, DBCtrls, FileCtrl;
-
- type
- TfrmMain = class(TForm)
- OraSession1: TOraSession;
- OraQuery1: TOraQuery;
- OraScript1: TOraScript;
- MainMenu1: TMainMenu;
- Output1: TMenuItem;
- Screen1: TMenuItem;
- Panel2: TPanel;
- Panel3: TPanel;
- fcOutlookBar1: TfcOutlookBar;
- GeneralBTN: TfcShapeBtn;
- TableSpaceBTN: TfcShapeBtn;
- RollbackBTN: TfcShapeBtn;
- Users: TfcShapeBtn;
- TableIndex: TfcShapeBtn;
- Objects: TfcShapeBtn;
- HitMiss: TfcShapeBtn;
- DiskIO: TfcShapeBtn;
- FullTable: TfcShapeBtn;
- Datadict: TfcShapeBtn;
- CursorSQL: TfcShapeBtn;
- Locks: TfcShapeBtn;
- SessionStats: TfcShapeBtn;
- SharedPool: TfcShapeBtn;
- RedoLogs: TfcShapeBtn;
- TwoPhaseCommits: TfcShapeBtn;
- Miscellaneous: TfcShapeBtn;
- fcOutlookBar1OutlookList1: TfcOutlookList;
- fcOutlookBar1OutlookList2: TfcOutlookList;
- fcOutlookBar1OutlookList3: TfcOutlookList;
- fcOutlookBar1OutlookList4: TfcOutlookList;
- fcOutlookBar1OutlookList5: TfcOutlookList;
- fcOutlookBar1OutlookList6: TfcOutlookList;
- fcOutlookBar1OutlookList7: TfcOutlookList;
- fcOutlookBar1OutlookList8: TfcOutlookList;
- fcOutlookBar1OutlookList9: TfcOutlookList;
- fcOutlookBar1OutlookList10: TfcOutlookList;
- fcOutlookBar1OutlookList11: TfcOutlookList;
- fcOutlookBar1OutlookList12: TfcOutlookList;
- fcOutlookBar1OutlookList13: TfcOutlookList;
- fcOutlookBar1OutlookList14: TfcOutlookList;
- fcOutlookBar1OutlookList15: TfcOutlookList;
- fcOutlookBar1OutlookList16: TfcOutlookList;
- fcOutlookBar1OutlookList17: TfcOutlookList;
- Panel1: TPanel;
- Panel4: TPanel;
- Splitter1: TSplitter;
- Memo1: TMemo;
- Connection1: TMenuItem;
- Oracleclient1: TMenuItem;
- Direct1: TMenuItem;
- Disconnect1: TMenuItem;
- N2: TMenuItem;
- Exit2: TMenuItem;
- StatusBar1: TStatusBar;
- OraDataSource1: TOraDataSource;
- ConnectDialog1: TConnectDialog;
- Help1: TMenuItem;
- About1: TMenuItem;
- Usage1: TMenuItem;
- fcOutlookBar1OutlookList18: TfcOutlookList;
- Partitions: TfcShapeBtn;
- Panel5: TPanel;
- Panel6: TPanel;
- DTLabel: TLabel;
- ServerLabel: TLabel;
- QryLabel: TLabel;
- SpeedButton1: TSpeedButton;
- ToTextBTN: TSpeedButton;
- ToHTMLBTN: TSpeedButton;
- DBNavigator1: TDBNavigator;
- DBGrid1: TDBGrid;
- Batch1: TMenuItem;
- SQLbtn: TSpeedButton;
- SpeedButton2: TSpeedButton;
- procedure fcOutlookBar1OutlookList1ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure Oracleclient1Click(Sender: TObject);
- procedure Exit2Click(Sender: TObject);
- procedure Direct1Click(Sender: TObject);
- procedure Disconnect1Click(Sender: TObject);
- procedure fcOutlookBar1OutlookList2ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList3ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList4ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList5ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList6ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList18ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList7ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList8ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList9ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList10ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList11ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList12ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList13ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList14ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList15ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList16ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure fcOutlookBar1OutlookList17ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- procedure SpeedButton1Click(Sender: TObject);
- procedure ToTextBTNClick(Sender: TObject);
- procedure ToHTMLBTNClick(Sender: TObject);
- procedure Batch1Click(Sender: TObject);
- procedure OraScript1Error(Sender: TObject; E: Exception; SQL: String;
- var Action: TErrorAction);
- procedure SQLbtnClick(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure About1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
-
-
-
- var
- frmMain: TfrmMain;
- explainSlist : TStringList;
- query_no : integer; // the nr of the current query
- batch : boolean; // is this a batch process?
-
- procedure ExportToAscii;
- procedure ExportToHTML;
-
- implementation
-
- uses snapsql, batchp, aboutp;
-
-
- {$R *.DFM}
-
- procedure CheckOutputDir;
- begin
- if not DirectoryExists('output') then
- if not CreateDir('Output') then
- raise Exception.Create('Cannot create output directory');
-
- end;
-
-
- procedure TfrmMain.Oracleclient1Click(Sender: TObject);
- begin
- OraSession1.Connected := True;
- If OraSession1.Connected then
- begin
- CheckOutputDir;
- OracleClient1.Enabled := False;
- Direct1.Enabled := False;
- Disconnect1.Enabled := True;
- fcOutLookBar1.Visible := True;
- Batch1.Enabled := True;
- end;
- end;
-
- procedure TfrmMain.Direct1Click(Sender: TObject);
- begin
- OraSession1.ConnectDialog := Nil;
- OraSession1.Options.Net := True;
- OraSession1.Connected := True;
- If OraSession1.Connected then
- begin
- CheckOutputDir;
- OracleClient1.Enabled := False;
- Direct1.Enabled := False;
- Disconnect1.Enabled := True;
- fcOutLookBar1.Visible := True;
- Batch1.Enabled := True;
- end
- else
- begin
- OraSession1.Options.Net := False;
- OraSession1.ConnectDialog := ConnectDialog1;
- end;
- end;
-
- procedure TfrmMain.Disconnect1Click(Sender: TObject);
- begin
- OraSession1.Connected := False;
- OraSession1.Options.Net := False;
- OraSession1.ConnectDialog := ConnectDialog1;
- OracleClient1.Enabled := True;
- Direct1.Enabled := True;
- Disconnect1.Enabled := False;
- fcOutLookBar1.Visible := False;
- Batch1.Enabled := False;
- end;
-
- procedure TfrmMain.Exit2Click(Sender: TObject);
- begin
- If OraSession1.Connected then
- begin
- Delete_Views;
- OraSession1.Disconnect;
- end;
- Halt;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList1ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
-
- begin
- // general
- // ShowMessage('Tag :'+IntToStr(Item.Tag));
- case Item.Tag of
- 0 : Snap_SQL(0,OraQuery1,Memo1);
- 1 : Snap_SQL(1,OraQuery1,Memo1);
- 2 : Snap_SQL(2,OraQuery1,Memo1);
- 3 : Snap_SQL(3,OraQuery1,Memo1);
- 4 : Snap_SQL(4,OraQuery1,Memo1);
- 5 : Snap_SQL(5,OraQuery1,Memo1);
- 6 : Snap_SQL(6,OraQuery1,Memo1);
- 7 : Snap_SQL(7,OraQuery1,Memo1);
- 8 : Snap_SQL(8,OraQuery1,Memo1);
- 9 : Snap_SQL(9,OraQuery1,Memo1);
- end;
-
- end;
-
-
- procedure TfrmMain.fcOutlookBar1OutlookList2ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // tablespaces
- // ShowMessage('Tag :'+IntToStr(Item.Tag));
- case Item.Tag of
- 0 : Snap_SQL(10,OraQuery1,Memo1);
- 1 : Snap_SQL(11,OraQuery1,Memo1);
- 2 : Snap_SQL(12,OraQuery1,Memo1);
- 3 : begin
- Create_View(1);
- Create_View(2);
- Snap_SQL(13,OraQuery1,Memo1);
- end;
- 4 : Snap_SQL(14,OraQuery1,Memo1);
- 5 : Snap_SQL(15,OraQuery1,Memo1);
- 6 : Snap_SQL(16,OraQuery1,Memo1);
- 7 : Snap_SQL(17,OraQuery1,Memo1);
- end;
- end;
-
-
-
-
- procedure TfrmMain.fcOutlookBar1OutlookList3ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // rollbacks
- case Item.Tag of
- 0 : Snap_SQL(18,OraQuery1,Memo1);
- 1 : Snap_SQL(19,OraQuery1,Memo1);
- 2 : Snap_SQL(20,OraQuery1,Memo1);
- 3 : Snap_SQL(21,OraQuery1,Memo1);
- 4 : Snap_SQL(22,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList4ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Users
- case Item.Tag of
- 0 : Snap_SQL(23,OraQuery1,Memo1);
- 1 : Snap_SQL(24,OraQuery1,Memo1);
- 2 : Snap_SQL(25,OraQuery1,Memo1);
- 3 : Snap_SQL(26,OraQuery1,Memo1);
- 4 : Snap_SQL(27,OraQuery1,Memo1);
- 5 : Snap_SQL(28,OraQuery1,Memo1);
- 6 : Snap_SQL(29,OraQuery1,Memo1);
- 7 : Snap_SQL(30,OraQuery1,Memo1);
- 8 : Snap_SQL(31,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList5ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Tables & indexes
- case Item.Tag of
- 0 : Snap_SQL(32,OraQuery1,Memo1);
- 1 : Snap_SQL(33,OraQuery1,Memo1);
- 2 : Snap_SQL(34,OraQuery1,Memo1);
- 3 : begin
- Create_view(3);
- Snap_SQL(35,OraQuery1,Memo1);
- end;
- 4 : begin
- Create_view(4);
- Snap_SQL(36,OraQuery1,Memo1);
- end;
- 5 : Snap_SQL(37,OraQuery1,Memo1);
- 6 : Snap_SQL(38,OraQuery1,Memo1);
- 7 : Snap_SQL(39,OraQuery1,Memo1);
- 8 : Snap_SQL(40,OraQuery1,Memo1);
- 9 : Snap_SQL(41,OraQuery1,Memo1);
- 10 : begin
- Create_View(5);
- Snap_SQL(42,OraQuery1,Memo1);
- end;
- 11 : Snap_SQL(43,OraQuery1,Memo1);
- 12 : Snap_SQL(44,OraQuery1,Memo1);
- 13 : Snap_SQL(45,OraQuery1,Memo1);
- 14 : Snap_SQL(46,OraQuery1,Memo1);
- 15 : Snap_SQL(47,OraQuery1,Memo1);
- end;
- end;
-
-
- procedure TfrmMain.fcOutlookBar1OutlookList18ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Partitions
- case Item.Tag of
- 0 : Snap_SQL(48,OraQuery1,Memo1);
- 1 : Snap_SQL(49,OraQuery1,Memo1);
- 2 : Snap_SQL(50,OraQuery1,Memo1);
- 3 : Snap_SQL(51,OraQuery1,Memo1);
- 4 : Snap_SQL(52,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList6ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Objects
- case Item.Tag of
- 0 : Snap_SQL(53,OraQuery1,Memo1);
- 1 : Snap_SQL(54,OraQuery1,Memo1);
- 2 : Snap_SQL(55,OraQuery1,Memo1);
- 3 : Snap_SQL(56,OraQuery1,Memo1);
- 4 : Snap_SQL(57,OraQuery1,Memo1);
- 5 : Snap_SQL(58,OraQuery1,Memo1);
- 6 : Snap_SQL(59,OraQuery1,Memo1);
- 7 : Snap_SQL(60,OraQuery1,Memo1);
- 8 : Snap_SQL(61,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList7ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Hit & Miss Ratio's
- case Item.Tag of
- 0 : Snap_SQL(62,OraQuery1,Memo1);
- 1 : Snap_SQL(63,OraQuery1,Memo1);
- 2 : Snap_SQL(64,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList8ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Disk I/O, Events & Waits
- case Item.Tag of
- 0 : Snap_SQL(65,OraQuery1,Memo1);
- 1 : Snap_SQL(66,OraQuery1,Memo1);
- 2 : Snap_SQL(67,OraQuery1,Memo1);
- 3 : Snap_SQL(68,OraQuery1,Memo1);
- 4 : Snap_SQL(69,OraQuery1,Memo1);
- 5 : begin
- Create_view(6);
- Snap_SQL(70,OraQuery1,Memo1);
- end;
-
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList9ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Full Table Scans
- case Item.Tag of
- 0 : Snap_SQL(71,OraQuery1,Memo1);
- 1 : Begin
- Create_view(7);
- Snap_SQL(72,OraQuery1,Memo1);
- End;
- 2 : Begin
- Create_view(7);
- Snap_SQL(73,OraQuery1,Memo1);
- End;
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList10ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Data Dictionary
- case Item.Tag of
- 0 : Snap_SQL(74,OraQuery1,Memo1);
- 1 : Snap_SQL(75,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList11ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Cursor & SQL processing
- case Item.Tag of
- 0 : Snap_SQL(76,OraQuery1,Memo1);
- 1 : Snap_SQL(77,OraQuery1,Memo1);
- 2 : Snap_SQL(78,OraQuery1,Memo1);
- 3 : Snap_SQL(79,OraQuery1,Memo1);
- 4 : Snap_SQL(80,OraQuery1,Memo1);
- 5 : Begin
- Create_view(8);
- Snap_SQL(81,OraQuery1,Memo1);
- end;
- 6 : Begin
- Create_view(8);
- Snap_SQL(82,OraQuery1,Memo1);
- End;
- 7 : Begin
- Create_view(8);
- Snap_SQL(83,OraQuery1,Memo1);
- End;
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList12ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Locks
- case Item.Tag of
- 0 : Snap_SQL(84,OraQuery1,Memo1);
- 1 : Snap_SQL(85,OraQuery1,Memo1);
- end;
-
- end;
-
-
-
- procedure TfrmMain.fcOutlookBar1OutlookList13ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Session statistics
- case Item.Tag of
- 0 : Snap_SQL(86,OraQuery1,Memo1);
- 1 : Snap_SQL(87,OraQuery1,Memo1);
- 2 : Snap_SQL(88,OraQuery1,Memo1);
- 3 : Snap_SQL(89,OraQuery1,Memo1);
- 4 : Snap_SQL(90,OraQuery1,Memo1);
- 5 : begin
- Create_view(9);
- Snap_SQL(91,OraQuery1,Memo1);
- end;
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList14ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Shared Pool
- case Item.Tag of
- 0 : Snap_SQL(92,OraQuery1,Memo1);
- 1 : Snap_SQL(93,OraQuery1,Memo1);
- 2 : Snap_SQL(94,OraQuery1,Memo1);
- 3 : Snap_SQL(95,OraQuery1,Memo1);
- 4 : Snap_SQL(96,OraQuery1,Memo1);
- 5 : Snap_SQL(97,OraQuery1,Memo1);
- 6 : Snap_SQL(98,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList15ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Redo Logs
- case Item.Tag of
- 0 : Snap_SQL(99,OraQuery1,Memo1);
- 1 : Snap_SQL(100,OraQuery1,Memo1);
- 2 : Snap_SQL(101,OraQuery1,Memo1);
- 3 : Snap_SQL(102,OraQuery1,Memo1);
- end;
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList16ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Two phase commits
- case Item.Tag of
- 0 : Snap_SQL(103,OraQuery1,Memo1);
- 1 : Snap_SQL(104,OraQuery1,Memo1);
- end;
-
- end;
-
- procedure TfrmMain.fcOutlookBar1OutlookList17ItemClick(
- OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
- begin
- // Miscellaneous
- case Item.Tag of
- 0 : Snap_SQL(105,OraQuery1,Memo1);
- 1 : Snap_SQL(106,OraQuery1,Memo1);
- 2 : Snap_SQL(107,OraQuery1,Memo1);
- end;
-
- end;
-
- procedure TfrmMain.SpeedButton1Click(Sender: TObject);
- begin
- Snap_SQL(Query_no,OraQuery1,Memo1);
- end;
-
- Procedure ExportToAscii;
- var f: Text;
- i,j : integer;
- begin
- // filename : queryno.txt
- AssignFile( F,'output\'+IntToStr(query_no)+'.txt' );
- Rewrite( f );
- j := frmMain.OraQuery1.Fields.Count - 1;
- for i := 0 to j do
- begin
- write( f, frmMain.OraQuery1.Fields.Fields[i].DisplayName );
- if i<>j then write( f,' , ');
- end;
- writeln( f );
- frmMain.OraQuery1.First;
- repeat
- for i := 0 to j do
- begin
- write( f, frmMain.OraQuery1.Fields.Fields[i].DisplayText );
- if i<>j then write( f,' , ');
- end;
- writeln( f );
- frmMain.OraQuery1.Next;
- until frmMain.OraQuery1.Eof;
- Close(F);
- end;
-
- Procedure ExportToHTML;
- var f: Text;
- i,j : integer;
- begin
- // filename : queryno.txt
- AssignFile( F,'output\'+IntToStr(query_no)+'.html' );
- Rewrite( f );
- writeln(f,'<HTML>');
- writeln(f,'<HEAD>');
- writeln(f,'<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">');
- writeln(f,'<META HTTP-EQUIV="Pragma" CONTENT="no-cache">');
- writeln(f,'<TITLE>'+qry_label[query_no]+'</TITLE>');
- writeln(f,'</HEAD>');
- writeln(f,'<BODY BGCOLOR="#C0C0C0">');
- writeln(f,'<CENTER><FONT FACE="Arial" SIZE="2">');
- writeln(f,'<TABLE WIDTH="100%">');
- writeln(f,'<TR>');
- writeln(f,'<TD><B><FONT FACE="Arial" SIZE="2">'+DateTimeToStr(Now)+'</FONT></B></TD>');
- writeln(f,'<TD ALIGN="RIGHT"><B><FONT FACE="Arial" SIZE="2">'+frmMain.OraSession1.Server+'</FONT></B></TD>');
- writeln(f,'</TR>');
- writeln(f,'</TABLE><BR>');
- writeln(f,'<TABLE BORDER=1 CELLPADDING=5>');
- writeln(f,'<TR>');
- writeln(f,'<TD ALIGN="CENTER" BGCOLOR="#FFFFFF" COLSPAN='+IntToStr(frmMain.OraQuery1.Fields.Count)+'>');
- writeln(f,'<FONT SIZE="4"><B>'+qry_label[query_no]+'</B></FONT>');
- writeln(f,'</TD>');
- writeln(f,'</TR>');
- writeln(f,'<TR>');
- j := frmMain.OraQuery1.Fields.Count - 1;
- for i := 0 to j do
- begin
- writeln( f,'<TD ALIGN="RIGHT" BGCOLOR="#CCCC99"><FONT FACE="Arial" SIZE="2"><B>'+ frmMain.OraQuery1.Fields.Fields[i].DisplayName+'</B></FONT></TD>' );
- end;
- writeln( f, '</TR>' );
- frmMain.OraQuery1.First;
- repeat
- writeln(f,'<TR>');
- for i := 0 to j do
- begin
- writeln( f, '<TD><FONT FACE="Arial" SIZE="2">'+ frmMain.OraQuery1.Fields.Fields[i].DisplayText+'</FONT></TD>' );
-
- end;
- writeln( f, '</TR>' );
- frmMain.OraQuery1.Next;
- until frmMain.OraQuery1.Eof;
- writeln(f,'</TABLE>');
- writeln(f,'<BR><BR><BR><BR>');
- writeln(f,'</TABLE>');
- writeln(f,'<b>OraSnapper version 1.0</b><br>');
- writeln(f,'based upon <a href="http://www.stewartmc.com/oracle/orasnap/">Orasnap 2.4.0</a>');
- Close(F);
- end;
-
-
- procedure TfrmMain.ToTextBTNClick(Sender: TObject);
- begin
- ExportToAscii;
- end;
-
- procedure TfrmMain.ToHTMLBTNClick(Sender: TObject);
- begin
- ExportToHTML;
- end;
-
- procedure TfrmMain.Batch1Click(Sender: TObject);
- begin
- Application.CreateForm(TfrmBatch, frmBatch);
- frmBatch.ShowModal;
- Batch := False;
- end;
-
- procedure TfrmMain.OraScript1Error(Sender: TObject; E: Exception;
- SQL: String; var Action: TErrorAction);
- begin
- Action := eaContinue;
- end;
-
- procedure TfrmMain.SQLbtnClick(Sender: TObject);
- begin
- if OraQuery1.Active then
- begin
- Memo1.Clear;
- Memo1.Text := OraQuery1.SQL.Text;
- end;
- end;
-
- procedure TfrmMain.SpeedButton2Click(Sender: TObject);
- begin
- if OraQuery1.Active then
- Begin
- Memo1.Clear;
- if query_no < 100 then
- Memo1.Text := Create_explain(query_no).text
- else
- Memo1.Text := Create_explain2(query_no).Text;
- end;
- end;
-
- procedure TfrmMain.FormCreate(Sender: TObject);
- begin
- Batch := False;
- end;
-
- procedure TfrmMain.About1Click(Sender: TObject);
- begin
- Application.CreateForm(TAboutBox, AboutBox);
- AboutBox.ShowModal;
- end;
-
- end.
-
-