Hi,
I have simple c# codes as below about executing the creation of some volatile tables in Teradata.
In Teradata, Volatile tables only remain within a session hence I would like to dispose of them to clear up memory before creating other volatile tables.
The codes below don't work as table V1 already exists...
I have simple c# codes as below about executing the creation of some volatile tables in Teradata.
In Teradata, Volatile tables only remain within a session hence I would like to dispose of them to clear up memory before creating other volatile tables.
Code:
using (var connection = new TdConnection(TDconnString))
{
try
{
connection.Open();
query = @"
CREATE MULTISET VOLATILE TABLE V1 AS (
SEL
*
FROM TABLE
)WITH DATA ON COMMIT PRESERVE ROWS;
";
var command = new TdCommand(query, connection);
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
[highlight #FCE94F] finally
{
[/highlight] connection.Close();
connection.Dispose();
[highlight #FCE94F] }[/highlight]
}
The codes below don't work as table V1 already exists...
Code:
using (var connection = new TdConnection(TDconnString))
{
try
{
connection.Open();
query = @"
CREATE MULTISET VOLATILE TABLE V1 AS (
SEL
*
FROM TABLE
)WITH DATA ON COMMIT PRESERVE ROWS;
";
var command = new TdCommand(query, connection);
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
}