我一直在从事一项 SAS 工作,该工作从 SQL Server 中提取表,然后将该表加载到 Oracle 表中。
SQL Server 中的字段之一是 blob,它们可以大到 1G。当我在 oracle 表上运行此 blob 时收到长度警告,似乎已被截断,因此文件已损坏。
我已经看到 SAS 声明字符变量可以最大为 32K,但 SAS 也声明它可以访问高达 2G 的 blob。
我们怎样才能做到这一点?
proc sql;
create view work.W2K3NU8 as
select
ID,
DNUMBER,
FILENAME,
FILE
format = $HEX2048.
informat = $HEX2048.,
(input(compress(DATEENTERED),YYMMDD10.)) as DATEENTERED length = 8
format = date.
informat = date.
label = 'DATEENTERED',
(input(compress(DATEADDED),YYMMDD10.)) as DATEADDED length = 8
format = date.
informat = date.
label = 'DATEADDED',
(input(compress(DATECHANGED),YYMMDD10.)) as DATECHANGED length = 8
format = date.
informat = date.
label = 'DATECHANGED',
TYPE
from &SYSLAST;
quit;
这是数据步骤
data trd.GAFILES
(dbnull = (
ID = NO
DNUMBER = YES
FILENAME = YES
GA_FILE = YES
DATEENTERED = YES
DATAADDED = YES
DATECHANGED = YES
TYPE = YES
ETL_CREATE = YES
ETL_UPDATE = YES));
attrib ID length = $255
format = $255.
informat = $255.
label = 'ID';
attrib DNUMBER length = $10
format = $10.
informat = $10.
label = 'DNUMBER';
attrib FILENAME length = $255
format = $255.
informat = $255.
label = 'FILENAME';
attrib GA_FILE length = $4096
format = $HEX2048.
informat = $HEX2048.
label = 'GA_FILE';
attrib DATEENTERED length = 8
format = DATETIME20.
informat = DATETIME20.
label = 'DATEENTERED';
attrib DATAADDED length = 8
format = DATETIME20.
informat = DATETIME20.
label = 'DATAADDED';
attrib DATECHANGED length = 8
format = DATETIME20.
informat = DATETIME20.
label = 'DATECHANGED';
attrib TYPE length = $100
format = $100.
informat = $100.
label = 'TYPE';
attrib ETL_CREATE length = 8
format = DATETIME20.
informat = DATETIME20.
label = 'ETL_CREATE';
attrib ETL_UPDATE length = 8
format = DATETIME20.
informat = DATETIME20.
label = 'ETL_UPDATE';
call missing(of _all_);
stop;
run;