Unsupported SQL Functions in Workbench
Is anyone aware of some SQL functions being unsupported in Workbench? I have been using a small query that contains both charindex and substring.
When I run it directly against our database in SSMS it works fine, but it seems Workbench is not interpreting correctly.
It would be helpful to know if there's a document existing somewhere with supported/unsupported SQL functions.
Answers
-
What's the query you're running and the error message you're getting? (anonymize it if necessary)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
SELECT DISTINCT MarketingClubLevel,
CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) = 0 THEN MarketingClubLevel
ELSE SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1)))
END AS ClubDescription
FROM vClub
Result in SSMS:
Result in Workbench:
Not necessarily getting an error, but as you can see as an example that "Diamond Premier" is not getting truncated to "Diamond" like in the result from SSMS above it.
0 -
what happens if you change the charindex check to be
>=
SELECT DISTINCT MarketingClubLevel, CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) >= 0 THEN MarketingClubLevel ELSE SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1))) END AS ClubDescription FROM vClub
What does `CHARINDEX(' ', MarketingClubLevel,1)` return between Workbench and SSMS?
Also, are you using the correct driver verison in your connection?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
translating 'what xyz platform is reading out of my odbc driver' can be a pain
to start troubleshooting, break your query into pieces.
SELECT DISTINCT MarketingClubLevel, -- is my query identifying the space? CHARINDEX(' ',MarketingClubLevel,1) as positionOfSpace, CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) >= 0 THEN MarketingClubLevel ELSE SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1))) END AS ClubDescription FROM vClub
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
It appears that Workbench is reading charindex and substring individually, but when you combine the two together it is having issues.
Here's the query I ran - took @jaeW_at_Onyx's version and added one for substring.
SELECT DISTINCT MarketingClubLevel, -- is my query identifying the space? CHARINDEX(' ',MarketingClubLevel,1) as positionOfSpace, SUBSTRING(MarketingClubLevel,1,8) as SubstringTest, --Set an abritray end point for substring CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) >= 0 THEN MarketingClubLevel ELSE SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1))) END AS ClubDescription FROM vClub
Result:
0 -
Luke ... i think your problem is your WHEN statement you've got it's ALWAYS grreater than or equal to zero so it will NEVER get to your ELSE clause.
CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) >= 0 THEN MarketingClubLevel ELSE SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1))) END AS ClubDescription
rewrite it
CASE WHEN CHARINDEX(' ',MarketingClubLevel,1) > 0 THEN SUBSTRING(MarketingClubLevel,1,(CHARINDEX(' ',MarketingClubLevel,1))) ELSE MarketingClubLevel END AS ClubDescription
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
Here's what I get when I run the that additional code. It's the "Club Description New" column. Tried tweaking a few things in the case to be <> 0 as well and still returning either the "club description" or "club description new" values.
0 -
Instead of Substring try LEFT(description, <positionOfSpace>)
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
Just as an FYI, I don't believe Workbench is ever limited in functions from what I've encountered. My impression is that Workbench is just relaying the query to the database, so the function usage is limited by the local database system and version.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 58 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 395 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive