Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

'WriteYXDBStreaming' Error using R node

8 - Asteroid

Has anyone ever seen this error before when trying to query to a database using an R node? 


My code runs in R, but not in Alteryx..and I get this 'WriteYXDBStreaming Error.


Also, my first call to the DB works, but not the rest. (first is: s_o <- sqlQuery(mxctl,s_o_query) ...see bottom of R code)


When I check the data types of the output, they are all of class data.frame.


I have attached my workflow. Thanks in advance!

15 - Aurora

Hi @ckestler

Something to try... towards the end of your R script, you have a few instances of, basically, this:


queryOutput <- sqlQuery(mxctl, queryText)

write.alteryx(queryOutput, 1)


Try castin your datasets to data frames prior to wrting them to Alteryx output... so you could do:


queryOutput <-, queryText))

write.Alteryx(queryOutput, 1)

 (or, equivalently)

 queryOutput <- sqlQuery(mxctl, queryText)

write.alteryx(, 1)





8 - Asteroid

Hi John,


Unfortunately I have already tried that, and it did not work. 

15 - Aurora


Other thougths include data embedded in the data table that doesn't write out nicely as character data; or simply a really large data frame that wants to be chunked...


Forcing to character data... you could try this prior to Write.Alteryx, where df is your data frame...


df[] <- lapply(df, as.character)

That way you should have a data frame that's all character data.



If it continues to fail, you could even try to write.csv manually from within tyour script, then using a Block Until Done tool, read in that output after the R tool has completed.  Hopefully it doesn't come to that, but it's something you could try.


8 - Asteroid

That worked! Thank you! 

5 - Atom

This suggestion worked for me too, with the only trivial difference being my use case called for as.numeric


Thanks for the help

6 - Meteoroid

Works for me!! Thank you!!!!

5 - Atom

HI There

I was also facing the same issue and tried lot of thing but only lapply worked well.

Thank for your advice.




6 - Meteoroid

That worked for me as well, thank you for sharing!

7 - Meteor

What was outlined by JohnJPS seems to work for most people, but that did not do the trick for me.


This is what my code looks like to write the data to Alteryx:



Using the lapply as.character trick outlined, I am still getting the following error:


You can tell there is data coming through from the resulting output of print(head(prediction)) shown in the screenshot above.


I'd be curious to hear anyone's thoughts as to why this didn't work for me and what is going on here,