Are there any BAQ tricks to return a tilde delimited list column?
For example, I believe this is valid SQL (being SaaS I cannot test) that should return tilde delimited column of VendorNums.
BAQ complains ‘possible sql injection’ probably because SELECT and or FOR XML are not supported in calculated columns.
SELECT
[VendPart].[Company] as [VendPart_Company],
[VendPart].[PartNum] as [VendPart_PartNum],
(STUFF
(
(
SELECT DISTINCT '~'+ CAST(V.VendorNum AS VARCHAR(MAX))
FROM Erp.VendPart as [V], Erp.Part as [P]
WHERE V.PartNum = P.PartNum AND P.PartNum = VendPart.PartNum
FOR XML PATH('')
),1,1,''
)) as [Calculated_VenNums]
FROM Erp.VendPart as [VendPart]
GROUP BY
[VendPart].[Company],
[VendPart].[PartNum]
Is there another way to return list columns in BAQ?
PS - I believe I’ve seen mentioned on here that SQL List functions exist in the database. If so, are these accessible in a BAQ?
Yeah, I don’t see anything like that, and I’m pretty sure it would break the BAQ engine. Adding in columns dynamically isn’t something historically that’s been a capability.
Probably won’t work, but a .dacpac is a file made by SQLPackage utility (built-into SSMS, SSDT, ADS, & MSSQL VSCode Extension) which can be used to create an empty database. Basically it’s the publish output of a VS Database Project.
It’d be swell if Epicor made, say EDU db backup available for SaaS customers to install on-prem. Some of us are at home in T-SQL (even if we forget the newish features like STRING_AGG [:rolls-eyes-at-self])
Hi Josh,
If I understand correctly what you are trying to achieve, there is actually a SQL function to extract one value in an Epicor ~-separated List.
This is PARSENAME(). It uses dot as default separator but you can easily replace the ~ symbol by dots before running PARSENAME(). So you will be able to easily extract one value (or more) in an Epicor list like this.
Sorry I’m French so if this isn’t clear, please let me know.
I often use this kind of syntaxes for BI analysis on Epicor with a third-party tool, it works like a charm.