!

" # "
$
% & ' (

!"
"
##$$$% &! % %& # ' ( % ) *+ ' %

, - . / 0 1
' % 1 2
3 ' 3 "

456 7
456 4 7
4565 7
4564 8 7
4569 & 7
456:
456 4 %

9 ; ; .
456 4 < & = 3
%, < & 4 4 %

: '
%

> ' %

? 1 3 <
= &
@%' & % A ? 3 &
B & ?< C %
D 3 456 "

% . < 3 1 & % 6' 8 < 3 1 % 8 @ & " " < 3 & % F< C 3 F 8 & .K < C 456 % > " . 8 " *D 7 I 4 ? ' & % 456 4 4 8 4 8 3 & J = & & 4 8 & % 456 4 ? 4 2 ' J 2 ' ? E . 2 . < 1 & % > . " G & & H % < . % . % " < 3 1 & % ? & % I 0 % " < 3 1 1 % " < 1 % J &? C / 3 1 456 % @8 < J . " 456 +%8 %. " 3 ? 1 3 E & F & 3 & 1 1 ' .

456% 4 " > < 4565 1 % 456 A < 3 456 1 5 % 456 < 3 1 9456 3 1 & % 4564 8 ? = < . % 9 &? ? %> .K 456% 8 " .> < 1 9 ' & % 9 < ' ' 456 %8 K %% 9 < 3 < 9 %4 5 4 8 9& % 4 < 3 1 & 9 4 3 1 456 4 % 456 < 3 1 9456 3 1 & % 4565 456 & K K %% 4565 &? ? 2 . & %8 3 .

< J % 4569 & & & % 94569 & & < &? ? .K K %% 8 " > < 4569 & 1 L & < % 456 < 3 1 9456 3 1 & % 9& . ' %9 & B & .> < 4564 8 1 % 456 < 3 1 9456 3 1 & % 4 8 . & % ' ' 456 L ' % 8 " . . . A < 3 & % 456: ? < .

< 3 1 3 3 & 1 ' % 456 < 3 1 9456 3 1 & % 9 6 A ' %A ' %> ? 3 ' ' & % 456 4 ? 9456 4 9 4 8 & % & & & . %8 .> < 456: 1 ' & % > 4 < & ' 3 % E .K '. < . % B 2 .K % & < 2 %8 ? % 9 < 456 % 9 < 3 < 9 %4 5 4 8 9& % < 3 1 3 1 & % .K ' 1C & %A = 9 M % 8 456 4 " > < 1 456 < .

!" # "$ % 4 4 < ' 456 4 .K < % 8 " > < 1 456 < .% < .K % & < 2 %8 ? % < 3 1 3 1 & % 4 < C 4 4 4 %4 & " " < 1 % " < 3 1 456 % " < 3 ? 9 %4 5 4 8 9& % > 3 1 456 4 % . &1 456 4 < .

% : " R # R # $# % . Funcao varchar(50).txt’. . connect 'Testedb. E & + .gdb'. +%N%/%ONP % 1 .gdb'. 4 3 E & # F & 1 F3% ' 3 Q& .K %8 & & 3 %" % ' 456" create database 'Testedb. create table Comandos(Sintaxe varchar(30) not null.>' 3 1 3 ' < .K . [Enter] S TL ' 3 & 1 % exit. ' % 8 & B & ' < . < . F3 & ? ! < < < :4C R & 1 %. & 456 1 ? %8 & & E & "## $$$% % %& # > % U > 1 E & % >' 3 & 1 1 . constraint Sint_Chave primary key(Sintaxe)). :4C & C 3 R " QE & Q& Q &' % " C:\Firebird\Bin###BOT_TEXT###gt;isql –u SYSDBA – p masterkey 5 F3 ' " SQL> input ‘c:\pasta\Banco.

K K 4565 % . < ' " % #F %F & ! %E < % 3 & < 3 ! % > & ' 456 +% I 456 4 K .8 3 6V> )8 3 & & % : < 1 ' " .

& # 4 % 3 & ' # 2 ' ' " . & & . ' ' .K . & < 2 ' & 3 # ' % 2 ' & 3 . <1 < .K 1 = " var Form1: TForm1. & % .K %A 3 .K % 5 . % ' .K ( )% 8 .xfm} >9 ? 3 < . & ! 8 & # 4 < . Transacao: TTransactionDesc.K .K < & < . 3 = ' 3 1 3 % 8 < . < . ' < .A < & . % I .K & % ' )>' & ' .K ? & # 4 ' ' & %D < " D ' < ' ' .K E & # F & % 9 . & &? %5 & . . implementation {$R *. %I ? 3 < . ' & < .K & % ? .K % .

begin try Transacao.ParamByName('Func').TransactionID := 1. 3 < 9 F " * +% B .AsString := EdSintaxe. SQLDataSet1. SQLDataSet1.ExecSQL. 456 %S & ! 9 ' & % .CommandType := ctQuery.StartTransaction(Transacao). < B .Text.K & = . except on Exc:Exception do begin ShowMessage('Ocorreu um erro na tentativa de inclusão do registro: ' + Exc. SQLConnection1.Commit(Transacao). 456 +%4 9 9 7 456 456 4 +% > " J 8 . % F 6 . Transacao. SQLDataSet1. end.IsolationLevel := xilREPEATABLEREAD.AsString := EdFuncao.procedure TForm1. 456 % 9 % ' 456 1 & & 1 2 ' .Close. %> 9 " *D 7 8 < 456 4 +% 456 < . % F . & 3 < % 6' & < F 6 .BtIncluirClick(Sender: TObject). '1 .Text. SQLDataSet1.Message).K J 3 & & %8 < . SQLConnection1.CommandText := 'insert into Comandos(Sintaxe. Funcao) values(:Sint. end. SQLDataSet1.Rollback(Transacao).K %F ? 1 3 . SQLConnection1. :Func)'. SQLDataSet1.ParamByName('Sint'). end. B .

CommandText := 'update Comandos set Sintaxe = :Sint.Rollback(Transacao). 3 & * ' # 2 ' ' " procedure TForm1.TransactionID := 1.StartTransaction(Transacao). SQLDataSet1. SQLConnection1. SQLConnection1. except . SQLDataSet1. 3 & # 2 ' ' " procedure TForm1.AsString := EdSintaxe. SQLDataSet1.BtAlterarClick(Sender: TObject).ParamByName('Sint'). SQLConnection1.CommandType := ctQuery. SQLDataSet1.Close. Transacao.Commit(Transacao).IsolationLevel := xilREPEATABLEREAD. SQLDataSet1. SQLDataSet1.ParamByName('Sint'). end.Text.AsString := EdSintaxe.ParamByName('Func').ExecSQL.TransactionID := 1.BtExcluirClick(Sender: TObject).Close.Message). SQLConnection1. SQLDataSet1. begin try Transacao.IsolationLevel := xilREPEATABLEREAD. SQLConnection1. Funcao = :Func where Sintaxe = :Sint'. SQLDataSet1.Commit(Transacao). SQLDataSet1. SQLDataSet1. Transacao. end.Text.CommandType := ctQuery. SQLDataSet1. end. begin try Transacao.AsString := EdFuncao.CommandText := 'delete from Comandos where Sintaxe = :Sint'.StartTransaction(Transacao). except on Exc:Exception do begin ShowMessage('Ocorreu um erro na tentativa de alteração do registro: ' + Exc.Text.ExecSQL.

try Transacao.Clear. SQLQuery1. Transacao. //No campo: if RadioCampo.Text) <> '' then begin Consulta := 'select Sintaxe.SQL. SQLConnection1.Text + '%''' else Consulta := Consulta + 'like ''%' + EdBusca.Close.BtProcurarClick(Sender: TObject).ItemIndex = 1 then Consulta := Consulta + 'like ''%' + EdBusca. begin if Trim(EdBusca. SQLQuery1.Text + ''''.ItemIndex = 0 then begin Consulta := Consulta + 'starting with ''' + EdBusca. on Exc:Exception do begin ShowMessage('Ocorreu um erro na tentativa de exclusão do registro: ' + Exc. end.SQL. Funcao from comandos where '.Text + ''''. //Que: if RadioTipo.IsolationLevel := xilREPEATABLEREAD. var Consulta: string. . SQLConnection1. end else if RadioTipo. end. end. 3 & ' 2 ' ' " procedure TForm1. SQLQuery1.Rollback(Transacao).StartTransaction(Transacao).ItemIndex = 0 then Consulta := Consulta + 'Sintaxe ' else Consulta := Consulta + 'Funcao '.Message).TransactionID := 1.Append(Consulta).

SubItems.AsString). > < ' " . end.Rollback(Transacao).Commit(Transacao).Clear.Fields. ListView1. while true do begin ListView1.Items. SQLQuery1.Item[ ListView1.First.Item[ ListView1.Add(SQLQuery1.Message).Items.Count . end. end. end. ListView1.Caption := SQLQuery1. begin SQLQuery1.Open. except on Exc:Exception do begin ShowMessage('Ocorreu um erro na consulta: ' + Exc.AsString. 1 4565 % > 456 4565 ? ' 3 ? % 6 B 456 4565 456% < L % 1 < 1 < S M %8 < . try SQLQuery1.Fields.1 ].Next. except break. end.Fields[0].K & 456 < & E & % >2 '6 3 6 D $ S 4 & 2 ' ? ' " procedure TForm1. end.Add.Items. end.Fields[1]. SQLConnection1.Items.Items. CarregaLista.1 ]. SQLConnection1.Count .Items.CarregaLista. ListView1.

begin try SQLConnection1. 1 . 1 & % + < ' " procedure TForm1.Text := ListView1. % 3 < 1 ' 2 ' " procedure TForm1.Connected := true. end.Connected := false.Text := ListView1. ' & ! % .FormClose(Sender: TObject. begin EdSintaxe. var Action: TCloseAction).ListView1DblClick(Sender: TObject).'). end. except ShowMessage('Erro ao tentar conectar-se ao banco.>2 4565 4 ' 4565 +%E % 3 . + ) 3 6 D $+ ' " procedure TForm1. begin SQLConnection1.K & % 42 0 L % .Text.FormCreate(Sender: TObject). end. > 3 < < .Caption. end.K < . 3 < < < % >' 1 < 1 &1 .ItemFocused. E WNX E W +X% 6' 3 4 ' B ' 4565 %. EdFuncao. < $ ? ' ' 4 1C 6 D $ 4565 %.SubItems.ItemFocused. F <1 3 3 ' B < .

2 4 '1 3 < %8 4565 Y6 D $ L ' % : .% I 456 4 : < 1 <' 6V > " <' 3 % . 4[ 3 & % 5 % . 456 +% 8 Z @< :>. ! & '(& . 1 %8 3 4 1 '1 ? M % < %8 456 4 . 4 4 = . ! 4 K % ' & M % .K 4 '1 < 1 . ' 456 4 +% .

8 4 4 < & 456 4 4 4 % .S . # 4 4 '1 3 % ' ?& < 3 ?3 < .K 456 < E % I 4 4 . 3 . & K . & L3 . ' % 9 4 '1 1 % 456 4 ? 2 ' & . 456 K # . < .K 456 1 \ & 3 ' %: 3 < E & ? . 2 ' 3 < L . 1 & ' . & % 3 ' < < % . 4[ 3 & % 5 ' ' &% > 4 4 456 & ' M % S . .K 3 < < %> . ' ? % 1 . < & & 2 %8 & # 4 < < . ' % . % ? 3 ' ' % 456 4 & & #4 & ! < < L & J 456 E % 5 < & . &% >& Z @< :>.K < '. < ? ' %: ? &1 ? .