使用perl DBI从Snowflake检索存储过程信息

sc4hvdpw  于 2023-03-19  发布在  Perl
关注(0)|答案(1)|浏览(172)

我们在Snowflake中有很多存储过程,我可以运行get_ddl过程从SF工作表中提取信息,但是在使用perl的DBI时,我可以运行get_ddl的select,但是它没有显示本地声明,我使用fetchrow来提取数据。

while (my @row = $sth->fetchrow_array) {
       print "row is @row\n";
     }

这是从 snowflake 返回的消息

CREATE OR REPLACE PROCEDURE "SP_LOAD_AMT"("MASTER_ID" FLOAT, "TARGETING_PROFILES" VARCHAR(16777216), "DELIMITER" VARCHAR(1), "DEBUG" BOOLEAN)
RETURNS VARIANT
LANGUAGE JAVASCRIPT
EXECUTE AS OWNER
AS '
// Local function declarations --------------------------------------------------------
function createLogger(masterId, processType, functionName, debug) {
    var loggingContext, log;

    function LoggingContext(masterId, processType, functionName, debug) {
        var stmt, resultSet;

        if(Number.isInteger(masterId)) {
            stmt = snowflake.createStatement({
                sqlText: `SELECT CNTXT:CNTRL_STEP:MASTER_ID AS MASTER_ID, 
                            CNTXT:CNTRL_STEP:BATCH_ID AS BATCH_ID
                        FROM (SELECT METAPROC.GET_RUNTIME_CONTEXT(?) AS CNTXT);`,
                binds: [masterId]
            });

但是Perl脚本DBI fetchrow的唯一返回是顶部:

CREATE OR REPLACE PROCEDURE "SP_LOAD_AMT"("MASTER_ID" FLOAT, "TARGETING_PROFILES" VARCHAR(16777216), "DELIMITER" VARCHAR(1), "DEBUG" BOOLEAN)
RETURNS VARIANT
LANGUAGE JAVASCRIPT
EXECUTE AS OWNER
AS

有谁知道我怎样才能调出存储过程函数的其余部分吗?

y4ekin9u

y4ekin9u1#

结果我需要在snowflake中使用DBA角色。

相关问题