Exception1: near "sh_id": syntax error
Exception2: SQL logic error or missing database
Code: Select all
procedure Test;
var
UniConnection1 : TUniConnection;
UniScript1 : TUniScript;
begin
UniConnection1 := TUniConnection.Create(nil);
with UniConnection1 do
begin
ProviderName := 'SQLite';
Database := 'test.sqlite';
LoginPrompt := False;
Connected := True;
end;
UniScript1 := TUniScript.Create(nil);
with UniScript1 do
begin
Connection := UniConnection1;
SQL.Text :=
'create table SYS_HISTORY('#13+
'SH_ID Numeric(12) NOT NULL,'#13+
'SH_NAME VarChar2(255) NOT NULL,'#13+
'SH_GROUP VarChar2(60),'#13+
'SH_PROGRAM VarChar2(60),'#13+
'SH_COMMENT VarChar2(255),'#13+
'SH_CREATED DATETIME DEFAULT CURRENT_TIMESTAMP,'#13+
'SH_CHANGED DATETIME'#13+
');'#13+
'create index SH_ID_KEY on Sys_History(sh_ID);'#13+
'create trigger tr_sh_id_Changed'#13+
'after update on Sys_History'#13+
'for each row'#13+
'begin'#13+
' update Sys_History set sh_Changed = current_timestamp where sh_id = new.sh_id;'#13+
'end;'#13+
'/';
Execute;
end;
end;