Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mariusmans
New Member

Power BI Custom ODBC driver data paging not working as expected

I am testing my ODBC Driver using ODBCTest app. ODBC V3
When I use this test app the Driver returns all the selected data I query. Ex select * from table.

However I have an issue with my custom ODBC driver when it is used by Apps like PowerBi or Excel. Ill be using PowerBi for this post.
The problem is when I query data the SQLExecDirect will be called.
This seems to work fine returning the first 100 records.

Problem is when I do a select on a table with more than 100 record it doesn't seem to finish the sequence of calls to actually get the rest of the data.
Currently the function calls that do happen are
SQLExecDirect
SQLNumResultCols
SQLColAttribute //This is being called a couple of times
SQLGetData //Called until 100 results are proccessed
SQLFetch //Gets called mostly with SQLGetData

/*Once all returned rows from SQLExecDirect the next function is called.*/

SQLMoreResults

/*This is where the trouble starts*/

The problem starts because even though the next 100 rows are fetched and packaged for the App to use, neither SQLFetch or SQLGetData is being called from the Apps side.
I have implemented SQLFetchScroll, SQLExtendedFetch, SQLBulkoperation and None of them seem to get called either.

I have tried returning both SQL_SUCCESS_WITH_INFO and SQL_SUCCESS but the app still seems to not call anything else after SQLMoreResult.
Interesting thing however is that it does seem to call SQLMoreResult again and again until the records in that table are all processsed.

It just seems like the APP does not know that there are records/data ready for it to "FETCH" or "GET".

I have tried setting the sizes of this piointer
SQL_ATTR_ROW_ARRAY_SIZE although this always seems to be reset to 1

SQL_ATTR_ROW_STATUS_PTR -> The pointer to the data buffer should remain the same since I only change the data inside.

The GetEnvAttr() function never seems to be called by PowerBi:

This is the STM Attrs being set upon connection:
GetStmtAttr: 10010 out_value=000001E532809870 out_value_max_length=-4
GetStmtAttr: 10011 out_value=000001E532809978 out_value_max_length=-4
GetStmtAttr: 10012 out_value=000001E532809A80 out_value_max_length=-4
GetStmtAttr: 10013 out_value=000001E532809B88 out_value_max_length=-4

But none of these are being called
SQLSetEnvAttr
SQLSetStmtAttr
SQLSetStmtOption
SQLSetConnectAttr

 

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @mariusmans ,

Please review the following documentation and check whether it hit any limitation:

Getting Long Data

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This deals with the ODBC driver, we have that working. Our issue is that Power BI and Excel does not call this inteface.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.