Hello,
I'm using DOA 4.0.7.1 with Delphi 2007 on Windows 7 x64. I'm using a TOracleScript component to execute a script containing both DML and DDL commands such as the following:
-- Name = "type_dml Disabling triggers"
SELECT 'ALTER TABLE '||LOWER(table_name)||' DISABLE ALL TRIGGERS;'
FROM tabs
WHERE table_name LIKE 'AUTH%';
-- Name = "type_ddl Truncating dbo.callcycles table"
TRUNCATE TABLE dbo.callcycles;
-- Name = "type_ddl Analysing dbo.callcycles table"
ANALYZE TABLE dbo.callcycles COMPUTE STATISTICS;
The first statement in the script returns 9 ALTER TABLE
DISABLE ALL TRIGGERS;
statements, but I'm struggling to 'capture' these 9 statements and run them.
I'm using the TOracleScript's OnData event to output the statements to a memo:
procedure TfrmMain.scrSimmerDownData(Sender: TOracleScript);
begin
mmoOutput.Lines.Add(Sender.Query.FieldAsString(0));
end; How can I execute the 9 ALTER TABLE statements that are being generated?
Thanks!
/Neil
I'm using DOA 4.0.7.1 with Delphi 2007 on Windows 7 x64. I'm using a TOracleScript component to execute a script containing both DML and DDL commands such as the following:
-- Name = "type_dml Disabling triggers"
SELECT 'ALTER TABLE '||LOWER(table_name)||' DISABLE ALL TRIGGERS;'
FROM tabs
WHERE table_name LIKE 'AUTH%';
-- Name = "type_ddl Truncating dbo.callcycles table"
TRUNCATE TABLE dbo.callcycles;
-- Name = "type_ddl Analysing dbo.callcycles table"
ANALYZE TABLE dbo.callcycles COMPUTE STATISTICS;
The first statement in the script returns 9 ALTER TABLE
I'm using the TOracleScript's OnData event to output the statements to a memo:
begin
mmoOutput.Lines.Add(Sender.Query.FieldAsString(0));
end; How can I execute the 9 ALTER TABLE statements that are being generated?
Thanks!
/Neil