Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2025 01:32 AM
Hi @CHorton
The Databricks SQL engine does not support positional (?) parameters inside SQL UDF calls.
When Spark SQL parses GetCustomerData(?), the parameter is unresolved at analysis time, so you get [UNBOUND_SQL_PARAMETER]. This is not an ODBC bug, it’s a Spark/Databricks SQL limitation. Parameters work only in expressions like WHERE, JOIN, etc.
you can use Stored procedure which supports parameters and work correctly from ODBC.
1) Create a Stored procedure:
CREATE OR REPLACE PROCEDURE GetCustomerDataSP (cust_id INT)
RETURNS TABLE
LANGUAGE SQL
AS
BEGIN
RETURN
SELECT *
FROM Customer
WHERE CustomerId = cust_id;
END;
2) Call it from SQL
CALL GetCustomerDataSP(123);
or Call it via ODBC (parameterized)
CALL GetCustomerDataSP(?);