I wrote a simple UDF that needs to draw graphics and save it to disk. In fact, I use UDF as a proxy between SQL SERVER and R, so UDF passes the R script to the R engine from SQL SERVER via DCOM. Everything works fine until I try to build graphics or save it to disk. I created an assembly with UNSAFE permissions.
So, this happens as follows: SQL Engine β UDF β (D) COM SERVER β R β (D) COM SERVER β UDF β SQL Engine.
So, my first problem: can I create a GUI from UDF? Probably not, but worth asking.
The second problem is why an assembly with UNSAFE permission cannot access the file system. I do not get any error, just nothing happens.
The R environment is in a different address space, so I see no reason why SQL Server permissions for the CLR would affect it.
thanks
Edit:
I tried to do the same with the procedures. Now an empty file is created. This is my test code R:
jpeg("C:\\test1.jpg"); x <- rnorm(100); hist(x); dev.off()
Any idea what is going on here?
sql-server r clr sqlclr user-defined-functions
Klark
source share