How to populate TEXT column with file data
Posted in 2010
Topics: Data Types & Schema Design
Hi Team, I am planning to use the "Text" data type first time. I am not sure whether or not following is doable..if yes, please let me know how..example would be great. As always thanks in advance.. --IDS 9:40 and higher.... Per requirement, I need to store file contents into a table. We have few text files with 100+ lines, including blank and spaces. I would like to store each of these files as a separate records into a table along with other data like filename, date, etc etc. I am trying to understand the concept on how to pull data from a file into the text column and also populate other columns having regular data type, like char, serialno etc etc. So far, the examples I have seen talk about load from a file...assumine there is only one text column in the table.. Let's consider following table schema... serialno serial, file_name char(40) -- to store file name file_text text in table -- to store file content createDate date -- current date and if there are 10 files in /test/xyz/ directory...how would you approach to populate the above table with values in all the columns for each file in /test/xyz... Please let me know if the above state requirement is not very clear or need more information from me... Regards, Dharmendra
What are you going to be using as a front-end to: 1. Load the data? 2. Access the data? 3. Access the file contents? FYI, you are aware that Informix v9.40 went out of support this past September, right? You really should consider upgrading your servers to v11.50xC6 or later. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jul 20, 2010 at 7:43 PM, DHARMENDRA SHARMA < dharmendrasharma@hotmail.com> wrote: > Hi Team, > > I am planning to use the "Text" data type first time. I am not sure whether > or > not following is doable..if yes, please let me know how..example would be > great. As always thanks in advance.. > > --IDS 9:40 and higher.... > Per requirement, I need to store file contents into a table. We have few > text > files with 100+ lines, including blank and spaces. I would like to store > each > of these files as a separate records into a table along with other data > like > filename, date, etc etc. > > I am trying to understand the concept on how to pull data from a file into > the > text column and also populate other columns having regular data type, like > char, serialno etc etc. So far, the examples I have seen talk about load > from > a file...assumine there is only one text column in the table.. > > Let's consider following table schema... > serialno serial, > file_name char(40) -- to store file name > file_text text in table -- to store file content > createDate date -- current date > > and if there are 10 files in /test/xyz/ directory...how would you approach > to > populate the above table with values in all the columns for each file in > /test/xyz... > > Please let me know if the above state requirement is not very clear or need > more information from me... > > Regards, > > Dharmendra > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --000325575ffa6322f7048bda7b20
Hi Art, Thanks for your quick response..Yes, we are aware about v9.40 out of support and will be upgrading to 11.5 soon... About uploading the data, at this point I am trying with C Shell script. Per my requirement, I think this is the quickest way to read the data from file system and store into database...I am open with any suggestion that you might have.. I had done this way to populate other information..and works great...my only concern and lack of knowledge at this point is "how to use TEXT datatype?, specially, when other datatype columns exist in the table too...".. Please let me know if you need further information from me on this...Once again, thanks for your quick response... Regards, Dharmendra > To: ids@iiug.org > From: art.kagel@gmail.com > Subject: Re: How to populate TEXT column with file data [20600] > Date: Tue, 20 Jul 2010 20:00:07 -0400 > > What are you going to be using as a front-end to: > > 1. Load the data? > > 2. Access the data? > > 3. Access the file contents? > > FYI, you are aware that Informix v9.40 went out of support this past > September, right? You really should consider upgrading your servers to > v11.50xC6 or later. > > Art > > Art S. Kagel > Advanced DataTools (www.advancedatatools.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions and > do not reflect on my employer, Advanced DataTools, the IIUG, nor any other > organization with which I am associated either explicitly, implicitly, or by > inference. Neither do those opinions reflect those of other individuals > affiliated with any entity with which I am affiliated nor those of the > entities themselves. > > On Tue, Jul 20, 2010 at 7:43 PM, DHARMENDRA SHARMA < > dharmendrasharma@hotmail.com> wrote: > > > Hi Team, > > > > I am planning to use the "Text" data type first time. I am not sure whether > > or > > not following is doable..if yes, please let me know how..example would be > > great. As always thanks in advance.. > > > > --IDS 9:40 and higher.... > > Per requirement, I need to store file contents into a table. We have few > > text > > files with 100+ lines, including blank and spaces. I would like to store > > each > > of these files as a separate records into a table along with other data > > like > > filename, date, etc etc. > > > > I am trying to understand the concept on how to pull data from a file into > > the > > text column and also populate other columns having regular data type, like > > char, serialno etc etc. So far, the examples I have seen talk about load > > from > > a file...assumine there is only one text column in the table.. > > > > Let's consider following table schema... > > serialno serial, > > file_name char(40) -- to store file name > > file_text text in table -- to store file content > > createDate date -- current date > > > > and if there are 10 files in /test/xyz/ directory...how would you approach > > to > > populate the above table with values in all the columns for each file in > > /test/xyz... > > > > Please let me know if the above state requirement is not very clear or need > > more information from me... > > > > Regards, > > > > Dharmendra > > > > > > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > --000325575ffa6322f7048bda7b20 > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > _________________________________________________________________ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en -US:WM_HMP:042010_1