0
votes

In some Snowflake databases I can run SELECT GET_DDL('Database', 'MyDatabase'); without problem but in another one, I get the following error message

SQL compilation error: Invalid object type: 'EXTERNAL_TABLE'

There might be an external defined in that database but I would still like to extract the DDL recursively on the database...

Is there any trick I could use?

2

2 Answers

0
votes

You could try using DESCRIBE EXTERNAL TABLE which describes the virtual columns on the table. DESCRIBE EXTERNAL TABLE

0
votes

5.8 Release Notes - March 15-18, 2021

GET_DDL Function: External Table Support

With this release, the GET_DDL function supports returning a DDL statement that can be used to recreate a specified external table.

Note that currently, the GET_DDL output for a specified database or schema does not include any external tables contained in the schema.