SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DatabaseImport Error

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
DatabaseImport Error
Author Message
Gennadiy



Joined: 13 Jun 2002
Posts: 18

Post DatabaseImport Error Reply with quote

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.

Fri Jul 23, 2004 9:31 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: DatabaseImport Error Reply with quote

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.

Fri Jul 23, 2004 9:48 am View user's profile Send private message
Gennadiy



Joined: 13 Jun 2002
Posts: 18

Post Re: DatabaseImport Error Reply with quote

Thanks for your quick and helpful answer.
Gennadiy

: 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

Fri Jul 23, 2004 9:53 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.