我试图从SAS数据集创建Oracle表。在许多情况下我很成功,但我被困在一个特定的数据集中。我在下面提供日志文件。我在Linux上使用SAS 9和Oracle 11.2.0.1.0。
有什么建议吗?
1 libname dibsdata "/data2/dibyendu/Jan_9/on_demand/";
NOTE: Libref DIBSDATA was successfully assigned as follows:
Engine: V9
Physical Name: /data2/dibyendu/Jan_9/on_demand
2 libname myora oracle user=sasuser password=XXXXXXXXXX path=CIOEDATA ;
NOTE: Libref MYORA was successfully assigned as follows:
Engine: ORACLE
Physical Name: CIOEDATA
3 data myora.on_demand;
4 set dibsdata.on_demand;
5 run;
NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
ERROR: Error attempting to CREATE a DBMS table. ERROR: ORACLE execute error: ORA-00904: : invalid identifier..
NOTE: The DATA step has been abnormally terminated.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.
WARNING: The data set MYORA.ON_DEMAND may be incomplete. When this step was stopped there were 0 observations and 48 variables.
ERROR: ROLLBACK issued due to errors for data set MYORA.ON_DEMAND.DATA.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
ERROR: Errors printed on page 1.
2 The SAS System 17:00 Wednesday, January 9, 2013
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 1.24 seconds
cpu time 0.04 seconds
答案 0 :(得分:3)
Oracle错误 ORA-00904 表示您正在尝试创建包含无效列名的表。很可能你有一个SAS变量,其名称长度超过30个字符,或者是Oracle保留字。例如,此SAS数据集中的两个变量在Oracle中是非法的:
data a;
column_name_too_long_for_oracle = 1;
date = today(); /* This is a reserved word */
run;
这是the Oracle 11g Reserved Words list。检查SAS数据集中的变量名称,并将它们重命名为Oracle中合法的名称。例如,如果违规者是名为 DATE 的SAS变量,您可以尝试这样做:
data myora.on_demand;
set dibsdata.on_demand(rename=(DATE=PROJ_DATE));
run;