Unix Technical Forum

IMPORT ASC

This is a discussion on IMPORT ASC within the DB2 forums, part of the Database Server Software category; --> Hi! I'm using IMPORT FROM FILE OF ASC import command. The FILE rows of fixed length and also columns ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:17 AM
Gregor =?ISO-8859-2?Q?Kova=E8?=
 
Posts: n/a
Default IMPORT ASC

Hi!

I'm using IMPORT FROM FILE OF ASC import command. The FILE rows of fixed
length and also columns are of fixed length. In the FILE I have a date
field that can have one special value (00000000) which should be
interpreted as null. How do I specify that?
Is it also possible to say "replace all space characters in strings with
character F"?

Best regards,
Kovi
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac | Gregor.Kovac@mikropis.si |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:17 AM
Artur
 
Posts: n/a
Default Re: IMPORT ASC

Kovi,

You can import data into staging table, and then transform it using
SELECT ... CASE statement and other functions (eg. REPLACE).

Import is just for importing data, not for transforming and cleansing.

Regards,

-- Artur Wronski

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 08:17 AM
Ian
 
Posts: n/a
Default Re: IMPORT ASC

Gregor Kovač wrote:
> Hi!
>
> I'm using IMPORT FROM FILE OF ASC import command. The FILE rows of fixed
> length and also columns are of fixed length. In the FILE I have a date
> field that can have one special value (00000000) which should be
> interpreted as null. How do I specify that?
> Is it also possible to say "replace all space characters in strings with
> character F"?
>
> Best regards,
> Kovi


With ASC format files, in order to import/load NULLs, you have to
specify a character value that signifies null, as well as positional
locations within the file for the null indicator.

Of course, your file format must include these null indicators to be
effective.

The alternative, as Artur described, would be to import into a staging
table and then use SQL modify the data during the insert to your "live"
table.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:59 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com