Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
DB2 null values (Read 5413 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
DB2 null values
11.09.06 at 12:53:55
DB2 null values
Tomi from Estonia asked the following question:
I did some testing again and one problem I found is that Null values are not accepted - the DB2 has Space on the field but if I SQL it to SQL*XL, the Excel converts space in to null and when I try to Insert it does not accept the null value... If I manually enter Space then it is ok (or at least skips the field and finds next "blank" field. Any ideas on how to keep the Space value in the Excel / SQL*XL?
I briefly considered building something into SQL*XL to automatically convert null values to another value you can specify. This could be done through a program setting or a new command. There is a SQL*Plus command for Oracle: set null value. In Oracle this only deals with output however and there is no way to differentiate behavior for different data types. You may want null dates to behave differently from null numbers.
I decided not going to make a change to accomodate this. If someone can persuade me to do facilitate this please send your remarks as a reply to this posting.
I suggest you use the Excel find and replace technique.
Select the data range you want to insert using SQL*XL's multiple rows insert facility.
Then go to Edit/Replace.
Leave the search field blank so Excel searches for empty cells
Put the value you want to use (0) in the field with the replace value.
This way you change the data before you do the insert. Furthermore, it is really easy to automate it by using Excel's macro recording.
Back to top

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1