Forum Discussion
Run a DDL statement before query getting data
- 9 years ago
Hi serda,
As the error message stated, it's not supported to use DDL and DML at the same time when connecting to Teradata database in desktop. In my opinion, SELECT statement will return records based on the entered credential which used to connect to Taradata database. So we can just set permission for this account on Teradata database side, and write SELECT statement in the query box.
In your scenario, please set proper permission for the account used to access Teradata database. Only write "SELECT * FROM the Table" in desktop query box.
Best Regards,
Qiuyun Yu
I have to run a DDL statement in order to have permissions to SELECT a table, I try the following statements:
SET ROLE theRoleIneed;
SELECT * FROM theTable;
But, Teradata do not let you write a DDL statement with a DML statement in the same transaction, my question is if there is a way to avoid this, for example, Power BI could perform two different sessions/conections independently. Or maybe with BTEQ you can avoid this although I tried with this excerpt:
BT;
SET ROLE theRoleIneed;
ET;
BT;
SELECT * FROM theTable;
ET;
Thank you for your try, I did not explain it well.
Hi serda,
As the error message stated, it's not supported to use DDL and DML at the same time when connecting to Teradata database in desktop. In my opinion, SELECT statement will return records based on the entered credential which used to connect to Taradata database. So we can just set permission for this account on Teradata database side, and write SELECT statement in the query box.
In your scenario, please set proper permission for the account used to access Teradata database. Only write "SELECT * FROM the Table" in desktop query box.
Best Regards,
Qiuyun Yu