Happy 8th birthday to the Maveryx Community! Take a walk down memory lane in our birthday blog, and don't miss out on the awesome birthday present that all Maveryx Community members get to take advantage of!
CREATE PROCEDURE updatePrintStatus
@PassedTableName AS NVARCHAR(255)
DECLARE @ActualTableName AS NVarchar(255)
SELECT @ActualTableName = QUOTENAME( TABLE_NAME )
WHERE TABLE_NAME = @PassedTableName
DECLARE @sql AS NVARCHAR(MAX)
SELECT @sql = 'Update '+@ActualTableName+' set PrintStatus=''Y'' where PrintStatus=''N'''
and the flow is attached.
The funny thing is the column gets updated even though the flow throws an error.
I have followed every suggestion provided in the knowledge base and community but I am unable to resolve this error.
What can be the possible reason it is not working for me?
This procedure will update a table but not return any values to feed through the rest of the workflow. You can either have the function return something to alterx, or what I often do is use my database command line tools to call the procedure. Alteryx can dynamically build the call statement (including the needed parameters) and execute it with the command line tool.
Another option is to output your workflow table name to your database and use that value in your stored procedure. You could then simply call your proc as a post SQL statement.
Unfortunately the pre/post SQL statements and workflow events cannot accept input from a workflow.
The last suggestion worked for me but I want to understand for my knowledge that even after I changed the stored procedure and had it return value to alteryx but it's still giving error.
Could you also please explain the solution "use database command line tools to call the procedure. Alteryx can dynamically build the call statement (including the needed parameters) and execute it with the command line tool." as I am new to alteryx so not sure about this .Please correct me if I am wrong, are you suggesting that I run the procedure using command line tool wherein I will call sqlcmd.exe?