r - SQL Server R sript 的结果集中的更多 VARBINARY 列
问题描述
在我的 MS SQL Server 的 R 脚本中,我尝试返回一列 VARBINARY() 和一列 VARCHAR()。但是,当返回 VARBINARY 时,服务器只允许一列:
There can be only one column in the result set when using the 'varbinary' data type.
示例代码:
EXEC sp_execute_external_script @language =N'R',
@script=N'R,
ff = tempfile();
png(filename=ff, width=800, height=800);
plot(...);
dev.off();
f1 = file(ff,"rb");
d1 = readBin(f1, what=raw(), n=1e6);
dd = data.frame(d1, c("plot1");
colnames(dd) = c("plot", "title");
OutputDataSet = dd;',
@input_data_1 =N'SELECT * FROM table_name'
WITH RESULT SETS ((plot varbinary(max)), (dsc varchar(20));
如何使用 VARBINARY 列返回附加列?
解决方案
推荐阅读
- mysql - 如何按列与过滤器组合结果
- html - 如何在表格每一行的开头设置一个按钮?
- javascript - 折线图的 React-Vis Legend 切换过滤器
- jquery - Photo Sphere 查看器使浏览器变慢
- django - Django ViewSet 中详细参数的含义是什么?
- java - 在不修改基类的情况下改变行为
- java - 如果有多行可用,如何按列标题区分行名
- testing - 我们可以用量角器自动化 Electron 应用程序吗?
- javascript - 来自 Object.entries 内存使用情况的 JS 映射
- python - 从列表中绘制的对象不留在屏幕上(pygame)