Re: A "Load from" question.
Posted in 1998
Topics: General Discussion
<HTML> Hi, <P>You can also edit the datafile to insert a blank space between the two consecutive pipes <BR>and to insert a blank space to the pipe at the beginning of the line. This will work. <P>In vi or sed, use: <BR>g/^|/s// |/;g/||/s/| |/g <BR> <P>Suhas Tembe wrote: <BLOCKQUOTE TYPE=CITE>Hi Guys, <P>Let me tell you what exactly I am looking for : <P>I have a temp table "temp_table" with say 3 columns as ; <P>col1 char(2); <BR>col2 char(2); <BR>col3 char(2); <P>I also have a delimited (|) flat file with 3 columns & I have to load <BR>data from the flat file into this "temp_table". <P>The flat file looks like this : <P>ab||cd --- line 1 <BR>|ab|cd --- line 2 <BR>ab|cd|| --- line 3 <P>I load data into the "temp_table" as follows : <P>load from "flat_file.txt" <BR>insert into temp_table; <P>Now, when I do this, row # 1 in the table would like : <P>col1 = ab <BR>col2 = null <BR>col3 = cd <P>Similarly, row # 2 & row # 3 as : <P>col1 = null <BR>col2 = ab <BR>col3 = cd <P>col1 = ab <BR>col2 = cd <BR>col3 = null <P>As you can see, a "null" is inserted into the column(s) if there is no data. <BR>(Note : There is no space between the pipes in the flat file). <P>My question is, what would I have to do if I wanted "spaces" & not "nulls" to <BR>be inserted into the table. ( I don't want to give an "update" statement for every <BR>column in the table). <P>Any help is appreciated. Thanks in advance. <P>Suhas <P>-------------------------------------------------------- <BR>Name : Suhas Tembe <BR>E-mail: <stembe@arrowshirt.com> <BR>Date : 09/28/98 <BR>Time : 17:45:14 <BR>Place : Atlanta, Georgia. <BR>--------------------------------------------------------</BLOCKQUOTE> </HTML>