Last active
December 22, 2021 01:51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sql_command1 = `show views in database BIRD_DEMO;`; | |
var stmt1 = snowflake.createStatement({sqlText : sql_command1}); | |
var rs1 = stmt1.execute(); | |
var objectReferences = []; | |
while (rs1.next()) { | |
// Snowflakeが提供するViewは対象外 | |
if (rs1.schema_name == "INFORMATION_SCHEMA") { | |
continue; | |
} | |
var sql_command2 = `select * from table(get_object_references( | |
database_name => '` + rs1.database_name + `' | |
, schema_name => '` + rs1.schema_name + `' | |
, object_name => '` + rs1.name + `'));`; | |
var stmt2 = snowflake.createStatement({sqlText : sql_command2} | |
); | |
var rs2 = stmt2.execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment