BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VALLY
Fluorite | Level 6

good day experts,

 

am connecting to Teradata using the below methods, however I get the above error

ERROR: Teradata execute: Object 'BRAC_ALL_FEES' does not exist.

 

can someone spot my error and provide feedback

 

 

PROC SQL;

CONNECT TO TERADATA(USER="xxxxxx@xxx" PASS="xxxxxx" SERVER=SBSA4 MODE = TERADATA CONNECTION=GLOBAL);

EXECUTE

 

(

CREATE MULTISET VOLATILE TABLE BRAC_ALL_FEES, NO LOG AS

(

SELECT *

 

FROM BRAC_ALL_FEES

)

WITH DATA PRIMARY INDEX (KEY_FIELD)

ON COMMIT PRESERVE ROWS;

) BY TERADATA;

CREATE TABLE LIBRARY.BRAC_ALL_FEES

AS

SELECT *

FROM CONNECTION TO TERADATA

 

(

SELECT *

FROM

 

BRAC_ALL_FEES

);

DISCONNECT FROM TERADATA;

QUIT;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JBailey
Barite | Level 11

Hi @VALLY,

 

Here is the portion of code I believe is causing the issue. At least, this is the first place I would look. 

 

CREATE MULTISET VOLATILE TABLE BRAC_ALL_FEES, NO LOG AS
(
SELECT *
   FROM BRAC_ALL_FEES  -- Can Teradata find this table?
)

 

One point of confusion is that the table name BRAC_ALL_FEES is used twice - once for the volatile table and again for the source table. This is fine if the tables reside in different Teradata database (really schemas). I believe the error is coming from SELECT statement that is included in your CREATE TABLE AS (CTAS) statement. Teradata has no way of knowing which database that table lives in (unless it lives in your default database. But that would have caused a duplicate table type of error). 

 

Because you are using EXPLICIT SQL Pass-Through, you can prepend the database name to the table name. Here is what it would look like.

 

CREATE MULTISET VOLATILE TABLE BRAC_ALL_FEES, NO LOG AS
(
SELECT *
   FROM SOMEDB.BRAC_ALL_FEES -- Teradata can find this table.
)

 

You can use the DATABASE= option to point to the database where BRAC_ALL_FEES lives.

 

Trivia: When a DBA creates a Teradata user account, they typically set a default database. So, it is possible that the DBA set your default database so that it can find this table automatically. This is unlikely because the general practice is to let it default to the user's database.

 

If you have problems with the VOLATILE table portion of your program, this doc may help.

http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677096.htm

 

Best wishes,
Jeff

 

View solution in original post

1 REPLY 1
JBailey
Barite | Level 11

Hi @VALLY,

 

Here is the portion of code I believe is causing the issue. At least, this is the first place I would look. 

 

CREATE MULTISET VOLATILE TABLE BRAC_ALL_FEES, NO LOG AS
(
SELECT *
   FROM BRAC_ALL_FEES  -- Can Teradata find this table?
)

 

One point of confusion is that the table name BRAC_ALL_FEES is used twice - once for the volatile table and again for the source table. This is fine if the tables reside in different Teradata database (really schemas). I believe the error is coming from SELECT statement that is included in your CREATE TABLE AS (CTAS) statement. Teradata has no way of knowing which database that table lives in (unless it lives in your default database. But that would have caused a duplicate table type of error). 

 

Because you are using EXPLICIT SQL Pass-Through, you can prepend the database name to the table name. Here is what it would look like.

 

CREATE MULTISET VOLATILE TABLE BRAC_ALL_FEES, NO LOG AS
(
SELECT *
   FROM SOMEDB.BRAC_ALL_FEES -- Teradata can find this table.
)

 

You can use the DATABASE= option to point to the database where BRAC_ALL_FEES lives.

 

Trivia: When a DBA creates a Teradata user account, they typically set a default database. So, it is possible that the DBA set your default database so that it can find this table automatically. This is unlikely because the general practice is to let it default to the user's database.

 

If you have problems with the VOLATILE table portion of your program, this doc may help.

http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677096.htm

 

Best wishes,
Jeff

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1645 views
  • 2 likes
  • 2 in conversation