cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

scalar function in databricks

Shree23
New Contributor III

Hi Expert,

here is sql server scalar function how to convert in databricks function

SQL
CREATE function [dbo].[gettrans](@PickupCompany nvarchar(2),
@SupplyCountry int, @TxnSource nvarchar(10),
@locId nvarchar(50), @ExternalSiteId nvarchar(50))
RETURNS INT
AS

BEGIN
DECLARE @worldSiteid INT
SET @worldSiteid = 0

If (@TxnSource = 'CDX')
BEGIN

3 REPLIES 3

Shree23
New Contributor III

Suggestion pls

Kaniz_Fatma
Community Manager
Community Manager

Hi @Shree23, Certainly! To convert your SQL Server scalar function to a Databricks function, you can create a user-defined scalar function (UDF) in Databricks.

 

UDFs are user-programmable routines that act on one row of data.

Kaniz_Fatma
Community Manager
Community Manager

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 
 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!