Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Import CSV into Sybase

4 posts in General Discussion Last posting was on 2009-08-04 14:43:53.0Z
Hod Posted on 2009-08-04 13:30:14.0Z
Sender: 1c0c.4a78365c.1804289383@sybase.com
From: Hod
Newsgroups: sybase.public.ase.general
Subject: Import CSV into Sybase
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a7837e6.1d33.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-3-dub.sybase.com4a7837e6"
NNTP-Posting-Host: forums-3-dub.sybase.com
X-Original-NNTP-Posting-Host: forums-3-dub.sybase.com
Date: 4 Aug 2009 06:30:14 -0700
X-Trace: forums-3-dub.sybase.com 1249392614 10.22.241.188 (4 Aug 2009 06:30:14 -0700)
X-Original-Trace: 4 Aug 2009 06:30:14 -0700, forums-3-dub.sybase.com
Lines: 819
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28099
Article PK: 77343

Hello all,
I have a CSV file i would like to import into my ASE 15.0.3
I log in into Sybase Central, open the relevant database,
over it with my right mouse i choose 'Open interactive SQL',
then Data -> Import.
I choose the CSV and manage to see preview of the CSV.
But when import starts it fails immediately.
See attached error.

Do you have an idea what's wrong?
Thanks

sybase error.jpg

Rob V [Sybase] Posted on 2009-08-04 13:43:41.0Z
Reply-To: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
From: "Rob V [Sybase]" <robv@DO.NOT.SPAM.sypron.nl.REMOVE.THIS.DECOY>
Newsgroups: sybase.public.ase.general
References: <4a7837e6.1d33.1681692777@sybase.com>
Subject: Re: Import CSV into Sybase
Lines: 42
Organization: Sypron BV / TeamSybase / Sybase Inc
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a783b0d$4@forums-3-dub.sybase.com>
Date: 4 Aug 2009 06:43:41 -0700
X-Trace: forums-3-dub.sybase.com 1249393421 10.22.241.152 (4 Aug 2009 06:43:41 -0700)
X-Original-Trace: 4 Aug 2009 06:43:41 -0700, vip152.sybase.com
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28100
Article PK: 77344

I have no idea what's wrong, but I would use BCP to import the CSV file,
using a comma as the column separator (i.e. -t ",").
of course, prior to this you need to define the table with corresponding
columns to your csv file contents.
The downside of using GUI tools is that it canbe a lot harder to debug
what's going on.

HTH,

Rob V.
-----------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 15.0/12.5/12.0/11.5/11.0
and Replication Server 15.0.1/12.5 // TeamSybase

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (ASE 15 edition)
"The Complete Sybase ASE Quick Reference Guide"
"The Complete Sybase Replication Server Quick Reference Guide"

mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., Amersfoort, The Netherlands
Chamber of Commerce 27138666
-----------------------------------------------------------------

<Hod> wrote in message news:4a7837e6.1d33.1681692777@sybase.com...
> Hello all,
> I have a CSV file i would like to import into my ASE 15.0.3
> I log in into Sybase Central, open the relevant database,
> over it with my right mouse i choose 'Open interactive SQL',
> then Data -> Import.
> I choose the CSV and manage to see preview of the CSV.
> But when import starts it fails immediately.
> See attached error.
>
> Do you have an idea what's wrong?
> Thanks
>


Hod Posted on 2009-08-04 14:43:53.0Z
Sender: 28e7.4a784764.1804289383@sybase.com
From: Hod
Newsgroups: sybase.public.ase.general
Subject: Re: Import CSV into Sybase
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a784929.2a49.1681692777@sybase.com>
References: <4a783b0d$4@forums-3-dub.sybase.com>
NNTP-Posting-Host: forums-3-dub.sybase.com
X-Original-NNTP-Posting-Host: forums-3-dub.sybase.com
Date: 4 Aug 2009 07:43:53 -0700
X-Trace: forums-3-dub.sybase.com 1249397033 10.22.241.188 (4 Aug 2009 07:43:53 -0700)
X-Original-Trace: 4 Aug 2009 07:43:53 -0700, forums-3-dub.sybase.com
Lines: 50
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28104
Article PK: 77350

Works
Thanks

> I have no idea what's wrong, but I would use BCP to import
> the CSV file, using a comma as the column separator (i.e.
> -t ","). of course, prior to this you need to define the
> table with corresponding columns to your csv file
> contents. The downside of using GUI tools is that it canbe
> a lot harder to debug what's going on.
>
> HTH,
>
> Rob V.
> ----------------------------------------------------------
> ------- Rob Verschoor
>
> Certified Sybase Professional DBA for ASE
> 15.0/12.5/12.0/11.5/11.0 and Replication Server
> 15.0.1/12.5 // TeamSybase
>
> Author of Sybase books (order online at
> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
> ASE" (ASE 15 edition) "The Complete Sybase ASE Quick
> Reference Guide" "The Complete Sybase Replication Server
> Quick Reference Guide"
>
> mailto:rob@YOUR.SPAM.sypron.nl.NOT.FOR.ME
> http://www.sypron.nl
> Sypron B.V., Amersfoort, The Netherlands
> Chamber of Commerce 27138666
> ----------------------------------------------------------
> -------
>
> <Hod> wrote in message
> > news:4a7837e6.1d33.1681692777@sybase.com... Hello all,
> > I have a CSV file i would like to import into my ASE
> > 15.0.3 I log in into Sybase Central, open the relevant
> > database, over it with my right mouse i choose 'Open
> > interactive SQL', then Data -> Import.
> > I choose the CSV and manage to see preview of the CSV.
> > But when import starts it fails immediately.
> > See attached error.
> >
> > Do you have an idea what's wrong?
> > Thanks
> >
>
>


Neal Stack [Sybase] Posted on 2009-08-04 14:05:22.0Z
From: "Neal Stack [Sybase]" <nstack@nospam.com>
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Import CSV into Sybase
References: <4a7837e6.1d33.1681692777@sybase.com>
In-Reply-To: <4a7837e6.1d33.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a784022$1@forums-3-dub.sybase.com>
Date: 4 Aug 2009 07:05:22 -0700
X-Trace: forums-3-dub.sybase.com 1249394722 10.22.241.152 (4 Aug 2009 07:05:22 -0700)
X-Original-Trace: 4 Aug 2009 07:05:22 -0700, vip152.sybase.com
Lines: 15
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28102
Article PK: 77345

Hello,

I think there is a bug in Interactive SQL's import functionality.

I would recommend using the bcp utility:

C:\temp>bcp tempdb..authors in authors.csv -Usa -P -t, -c

Starting copy...

23 rows copied.
Clock Time (ms.): total = 110 Avg = 4 (209.09 rows per sec.)

Regards,
Neal