Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass C# array to UDTF in Snowflake as an array #2081

Open
vyeghikyan-st opened this issue Apr 29, 2024 · 0 comments
Open

Pass C# array to UDTF in Snowflake as an array #2081

vyeghikyan-st opened this issue Apr 29, 2024 · 0 comments

Comments

@vyeghikyan-st
Copy link

I have a parameter in C#

var selectedUsersIds = new long[]{1,2,3};

which I want to pass to a UDTF in Snowflake:

CREATE OR REPLACE FUNCTION GetUserInfo  ( pselectedUsersIds ARRAY)
  RETURNS TABLE ( 
  "Username" VARCHAR(1000), 
  "Age" NUMBER(38,0))
...

My sql query reads

SELECT * FROM TABLE(GetUserInfo(:SelectedUsers))

When I pass it via a DynamicParameters object

 var dynamicParams = new DynamicParameters();
 dynamicParams.Add("SelectedUsers", selectedUsersIds, (DbType?)null);

I get an error from Snowflake, saying that

Invalid argument types for function 'GetUserInfo': ( ROW(NUMBER(10,0), ROW(NUMBER(10,0), NUMBER(10,0))))

Is there a way to pass the C# array as a Snowflake array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant