Can't query a table with the table name containing "ALL"

Database

Can't query a table with the table name containing "ALL"

I can't query a table named: CHURN_IBM_TBLS.CHURNSEG_MODEL_INPUT_ALL

I'm guessing that Teradata is interpreting the ALL keyword in some way.

Even a simple query such as:

select * from churn_ibm_tbls.churnseg_model_input_all

Results in:

DatabaseError: (3807, u"[42S02] [Teradata][ODBC Teradata Driver][Teradata Database] Object 'CHURN_IBM_TBLS.CHURNSEG_MODEL_INPUT_JUL' does not exist. ")

Where is "JUL" coming from?!

If quoted using double quotes:

select * "from churn_ibm_tbls.churnseg_model_input_all"

I get a slightly different error (querying other tables with double quotes results in the same error):

DatabaseError: (3807, u"[42S02] [Teradata][ODBC Teradata Driver][Teradata Database] Object 'churn_ibm_tbls.churnseg_model_input_all' does not exist. ")

1 REPLY
N/A

Re: Can't query a table with the table name containing "ALL"

CHURNSEG_MODEL_INPUT_ALL is a view and one of the base tables doesn't exist (probably a UNION ALL of monthly tables), submit a SHOW VIEW CHURNSEG_MODEL_INPUT_ALL.

If you double quote you must quote database and table name induvidually:

"churn_ibm_tbls"."churnseg_model_input_all"