BookmarkSubscribeRSS Feed
gyambqt
Obsidian | Level 7

Hello expert,

 

I have two SAS transform, one is bulk load and one is table load

 

I have a SAS source table with column1 that contain blank value.

 

If I load the table into Oracle then the blank value will be treated as null value in Oracle.

 

However I want to keep it as blank character rather than null value in oracle.

 

so I set column1 in Oracle ="cannot be null"  

 

after I have done I run the table loader and bulk load transform in SAS Data Intergration

 

table loader is working perfectly(blank value from source table has been treated as blank in oracle) but bulk load failed (all the blank values from source table has failed to load into oracle).

 

I opened both table loader and bulk load code they are below:

 

column1 is varchar2 in oracle

 

table loader code:

/*Oracle is the  Oracle lib */
   data Orcacle.table
           (dbnull = (
                      CODE_CD = NO
            ));
      attrib CODE_CD length = $10
         format = $10.
         informat = $10.
         label = 'CODE_CD';
run;

   proc append base = oracle.table
      data = &etls_lastTable (&etls_tableOptions)  force ;
    run;

 

 

bulk load code:

 

Oracle is Oracle lib
   data Orcacle.table
           (dbnull = (
                      CODE_CD = NO
            ));
      attrib CODE_CD length = $10
         format = $10.
         informat = $10.
         label = 'CODE_CD';
run;

 

 proc append base = oracle.table (&G_BULKLOAD_DELETE_FILES_STMT.
   &G_BULKLOAD_DIRECT_PATH_STMT.  BULKLOAD = YES
   BL_LOAD_METHOD = replace )
      data = &etls_lastTable (&etls_tableOptions)  force ;
    run;

 

the warning message I was getting from bulk load is

 

WARNING: All or some rows were rejected/discarded!(or possibly there were other errors like Index maintenance errors) ********************************************************************** Please look in SQL*Loader log for the load results. SQL*Loader Log location(only if BL_DELETE_FILES=NO is set): -- /sasdata/data/project/work/DBMS/BL_TR_CO

 

 

I realised table loader can handle to problem and want to know why bulk load cannot handle the problem and how to use bulk load to handle the problem.

 

Thanks

2 REPLIES 2
LinusH
Tourmaline | Level 20

BL_PRESERVE_BLANKS=YES?

I have no idea what was going on in your other thread, so...

Data never sleeps
gyambqt
Obsidian | Level 7

I realised BL_PRESERVE_BLANKS=YES will create the trailing blank for all the columns which is not the desired outcome we are seeking for.

 

By setting DBnull cannot be null for the column in the target oracle table, the table load option allows inserting a blank value into Oracle table. But it didn't work for the bulk load transform and want to  find out reason behind that

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1612 views
  • 0 likes
  • 2 in conversation