validation - Stored Procedure for dynamically comparing the count between the source schema tables and target schema tables in S

I have written a stored procedure that will dynamically compare row counts between source and target ta

I have written a stored procedure that will dynamically compare row counts between source and target tables in two different schemas and databases and iterate over all tables in a schema, compare row counts, and log any discrepancies for review.

But when i tried to execute the procedure, it throws an error as ❌ Procedure failed: source_database is not defined

 `CREATE OR REPLACE PROCEDURE TEST1_validate_all_table_row_counts(
    source_database STRING,
    source_schema STRING,
    target_database STRING,
    target_schema STRING
)
RETURNS STRING
LANGUAGE JAVASCRIPT
AS
$$
try {
    var result_log = [];

    // Convert input parameters to uppercase for consistency
    var src_db = source_database.toUpperCase();
    var src_schema = source_schema.toUpperCase();
    var tgt_db = target_database.toUpperCase();
    var tgt_schema = target_schema.toUpperCase();

    result_log.push(`

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744805418a4594746.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信