Home | Forums | Contact | Search | Syndication  
 [login] [create account]   Sunday, July 14, 2024 
slxdeveloper.com Community Forums  
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Data & Imports Forums - SSIS/DTS
Forum to discuss using SQL SSIS or DTS to perform SalesLogix imports. View the code of conduct for posting guidelines.
Forums RSS Feed

 Back to Forum List | Back to SSIS/DTS | New ThreadView:  Search:  
 Author  Thread: Importing Text Files Into A SLX Table
Antony Currington
Posts: 15
Importing Text Files Into A SLX TableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Mar 06 3:46 PM

viagra cena apoteka

Hi all,

SLX 6.2.3

I have a directory that contains 69 individual text files that I'd like to import directly into a SalesLogix table.

I really only want to specify a directory, and have a DTS to go ahead and import all the files for me, without any user intervention. I'm happy to hard code the directory (as it's not likely to change once set up), but I'm at a loss as to how to cycle through the files and import the info into my table.

Any suggestions? What's the best way to proceed?

Also, is there anything special I need to do have the OLEDB Provider Auto-generate the record ID's for me? Will it also auto-create the CreateUser/Date and ModifyUser/Date field data, or do I need to do that myself?

Antony Currington
Technical Consultant
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
Re: Importing Text Files Into A SLX TableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Mar 06 5:09 PM
First of all, unless you're able to use SSIS (which can traverse files in a directory quite nicely) then you'll need to write some VBScript/JScript in a DTS ActiveXScript task to get all the files in the dir.

Basically you'll create a package with a Text File connection in the package and set it up to go to the right target table(s) and the rest of your package. The difference here is that you need to dynamically set the connection (text connection) source at runtime and have it do it's work then start again with the next source. To do that you'll need to use the FileSystemObject to run through the files in the directory. However as each file is found you will need to set the text connection source, like this (We'll say your text connection is named "Text Source"):

Set oConn = DTSGlobalVariables.Parent.Connections("Text Source")
oConn.DataSource = sFilename

Then you set the workflow to continue and then make the flow of the package loop back to itself so you can get the next file and continue like that. Once you've traversed all files in the directory you set the task status to break the loop and continue with the normal workflow of the package. There are many ways to accomplish that, but that is the long and short of it.

I checked one of my favorite DTS sites and there happens to be an example showing just what you need to do:


Also, SLX will not create values for createdate/user and modifydate/user, you'll need to populate those. Actually you will need to populate everything. You can turn on auto-increment for the id value on the tables you'll be importing to (see the field properties in the administrator), but that can also be set at execution time (you can just update the table that stores whether autoincrement is on for your table - I think it is the autoincrement field on the sectabledefs table).

 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!

 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
page cache (param): 7/14/2024 1:57:35 AM