Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: volatile tables with Stata and Teradata
From
"Dimitriy V. Masterov" <[email protected]>
To
Statalist <[email protected]>
Subject
st: volatile tables with Stata and Teradata
Date
Tue, 12 Feb 2013 12:11:04 -0800
TL;DR Summary:
Is there a way to tweak odbc to work with volatile tables? I gather
these are a special Teradata feature. They are materialized in spool
and are unknown in the DD, but unlike a derived table, a volatile
table may be used in more than one SQL statement throughout the life
of a session.
Longer Explanation:
Currently, these seem to go poof with Stata (but work with SQL Assistant):
odbc load, exec("create volatile table new_usr as
(select distinct user_id from dw_users where cast(date_confirm as
date) > '2011-09-15') with data primary index(user_id) on commit
preserve rows;
select * from new_usr;") clear dsn("mozart") lowercase;
The ODBC driver reported the following diagnostics
[Teradata][ODBC Teradata Driver][Teradata Database] Only an ET or null
statement is legal after a DDL Statement.
SQLSTATE=25000
r(682);