MetricSign
Start free
Medium severityexecutionSnowflake

Snowflake Error:
002139 (42883)

What does this error mean?

Snowflake cannot resolve the function name — either the function does not exist in the current database/schema, the argument types do not match any registered signature, or the executing role lacks USAGE privilege on the function.

Common causes

  • 1Calling a UDF or stored procedure that was created in a different schema without a fully-qualified name
  • 2Argument types do not match the function signature (e.g., passing VARCHAR where NUMBER is expected)
  • 3Using a built-in function name that is valid in another database (PostgreSQL, MySQL) but not in Snowflake
  • 4The executing role lacks USAGE privilege on the UDF
  • 5The function was dropped or belongs to a different Snowflake account

How to fix it

  1. 1Use a fully-qualified function name: database.schema.function_name(args).
  2. 2Run SHOW USER FUNCTIONS IN SCHEMA mydb.myschema to verify the function exists and its signature.
  3. 3Check argument types — Snowflake overloads functions by type; cast arguments explicitly if needed.
  4. 4Grant USAGE on the function to the executing role: GRANT USAGE ON FUNCTION mydb.myschema.my_func(NUMBER) TO ROLE my_role.
  5. 5For built-in function name mismatches, consult Snowflake's SQL function reference for the correct equivalent.

Frequently asked questions

Can I call a Snowflake UDF without knowing the exact schema?

Yes, if the schema is in the current search path. Use SHOW PARAMETERS LIKE 'SEARCH_PATH' to check the active search path, or qualify the function fully to avoid ambiguity.

Does granting USAGE on a schema automatically grant USAGE on UDFs in it?

No — UDF privileges are separate from schema privileges. You must explicitly GRANT USAGE ON FUNCTION for each UDF, or use GRANT USAGE ON ALL FUNCTIONS IN SCHEMA and FUTURE GRANTS.

Source · docs.snowflake.com/en/error-codes/error-002139

Other execution errors