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

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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