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条)