DatabaseImport supports tab-separated files only. To convert you file from comma-separated to tab-separated format you can use FileReplaceEx command before the import. Also you need to remove header row from the file Example script to replace commas with tabs: Dim count_changes, number FileReplaceEx "my file name her", ",", "\t", false, count_changes To get rid of the header row either modify the program that creates this file or use our FileCopy utility that can copy files from a fixed position (skip first x number of characters). The idea is to copy the file with header into a temp file and then import that temp file. For more info about FileCopy see tips and script archive at http://www.softtreetech.com/24x7/script.htm : Hello, : I am trying to insert data from file to Sybase using function DatabaseImport : and received following message. : The table structure is (see below) : CREATE TABLE dbo.temp_kcp_comm : ( : col1 varchar(50) NOT NULL, : col2 varchar(50) NULL, : col3 varchar(50) NULL, : col4 varchar(50) NULL, : col5 varchar(50) NULL, : col6 varchar(50) NULL, : col7 varchar(50) NULL, : col8 varchar(50) NULL, : CONSTRAINT pr_key : PRIMARY KEY NONCLUSTERED (col1) : ) : LOCK ALLPAGES : go : GRANT DELETE ON dbo.temp_kcp_comm TO public : go : GRANT INSERT ON dbo.temp_kcp_comm TO public : go : GRANT SELECT ON dbo.temp_kcp_comm TO public : go : GRANT UPDATE ON dbo.temp_kcp_comm TO public : go : File content is: : TradeDate,Currency,Security,Broker,Fund,Commission,Giveup_Flag,Add : 20040504,EUR,TEST,TESTB,FFFF,,N, : Thanks in advance.
|