Usage Note 18478: ORA-01400: cannot insert NULL into lib.OracleTable
Assign a Libname with the ODBC engine to Oracle.
Submit Proc SQL - Insert Into statements to insert rows into an
Oracle table with columns that cannot accept NULL values.
The following error is returned, although those columns that cannot
accept NULL values are not specified in the Proc SQL code:
proc sql;
INSERT INTO lib.Oracle_table (var1, var2, var3, var4,
var5, var6, var7)
values ('000000000000', '0000000', 'SAMPLE NAME 1', 9999999, 'READY',
'Y', 'XXXX', 'XXXX' );
ERROR: CLI execute error: [Oracle][ODBC][Ora]ORA-01400: cannot insert
NULL into ("lib"."Oracle_table"."var23")
NOTE: This insert failed while attempting to add data from VALUES clause
1 to the data set.
ERROR: ROLLBACK issued due to errors for data set LIB.ORACLE_TABLE.
quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.12 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
Memory 211k
The same code works in SAS 8.2, but fails in SAS 9.x.
In SAS 8.2, the engine bound to all the columns in the table to do an
INSERT.
For any columns that weren't in the insert list, SAS would set their
lengths to SQL_NULL_DATA if the column was nullable. If it wasn't, then
a space was included.
In SAS 9, the engine does not bind to all the columns in the table if
not necessary.
Oracle will insert the NULLs for the other columns, and if any are
defined as NOT NULL, the error will occur.
Operating System and Release Information
SAS System | SAS/ACCESS Interface to ODBC | Microsoft Windows XP Professional | 9.1 TS1M3 SP3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP3 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP3 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 SP3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 SP3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | medium |
Topic: | SAS Reference ==> LIBNAME Engines Third Party ==> Information Exchange ==> ODBC (Open Database Connectivity)
|
Date Modified: | 2008-03-04 15:58:04 |
Date Created: | 2006-09-11 10:25:13 |