Importing data from a text file...
Gassett, Chris
Gassett@aavid.com
Thu, 22 Feb 2001 10:32:30 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C09CE4.AB684DB0
Content-Type: text/plain;
charset="iso-8859-1"
I need to update one of our Oracle tables with a flat text file. This is
what I did:
;* Step 1 sets up my dictionary
cancel clear
set default
set verify errors
access suppliers
set subfile name AVL keep
report summary supplierno
go
;* Step 2
I issue a UNIX command to strip any funky characters from the text file and
replace the data in the subfile with the data from the text file.
tr -d '\12' < avl.txt > AVL.sf
Ex. of the avl.txt file. There are 300+ records that will need to be
imported:
000001
00024
000345
692345
This works great, except that the fields are variable in width and those
that are narrower are filled in with zero characters, which I don't want
when I import.
>From the subfile I would import that data into the database with a qtp.
Anyone have any other ideas or suggestions? Is there an easier way?
PowerHouse 8.13
------_=_NextPart_001_01C09CE4.AB684DB0
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=429301015-22022001><FONT size=2>I need to update one of our
Oracle tables with a flat text file. This is what I
did:</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>;* Step 1 sets up my
dictionary</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>cancel
clear</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>set default</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>set verify
errors</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>access
suppliers</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>set subfile name AVL
keep</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>report summary
supplierno</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>go</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>;* Step 2</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>I issue a UNIX command to strip
any funky characters from the text file and replace the data in the subfile with
the data from the text file.</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>tr -d '\12' < avl.txt >
AVL.sf</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>Ex. of the avl.txt
file. There are 300+ records that will need to be
imported:</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>000001</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>00024</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>000345</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>692345</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>This works great, except that
the fields are variable in width and those that are narrower are filled in with
zero characters, which I don't want when I import.</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>From the subfile I would import
that data into the database with a qtp. Anyone have any other ideas or
suggestions? Is there an easier way?</FONT></SPAN></DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=429301015-22022001><FONT size=2>PowerHouse
8.13</FONT></SPAN></DIV></BODY></HTML>
------_=_NextPart_001_01C09CE4.AB684DB0--
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.