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.

Parsing string into temp table

2 posts in General Discussion Last posting was on 2011-06-03 16:34:20.0Z
Mark Pare Posted on 2011-06-03 12:07:17.0Z
Sender: 6bb4.4de7cd77.1804289383@sybase.com
From: Mark Pare
Newsgroups: sybase.public.ase.general
Subject: Parsing string into temp table
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4de8ce75.1e20.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 Jun 2011 05:07:17 -0700
X-Trace: forums-1-dub 1307102837 10.22.241.41 (3 Jun 2011 05:07:17 -0700)
X-Original-Trace: 3 Jun 2011 05:07:17 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30214
Article PK: 72393

Hi, I wanted to know if Sybase had some kind of function
that would take the contents of a comma-delimited string and
insert into a temp table?

We are currently doing it using a procedure to parse, but
wondering if there is a built-in function.

Let me know. Thanks


Jason L. Froebe [TeamSybase] Posted on 2011-06-03 16:34:20.0Z
From: "Jason L. Froebe [TeamSybase]" <jason.froebe@gmail.com>
Organization: TeamSybase
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Parsing string into temp table
References: <4de8ce75.1e20.1681692777@sybase.com>
In-Reply-To: <4de8ce75.1e20.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4de90d0c$1@forums-1-dub>
Date: 3 Jun 2011 09:34:20 -0700
X-Trace: forums-1-dub 1307118860 10.22.241.152 (3 Jun 2011 09:34:20 -0700)
X-Original-Trace: 3 Jun 2011 09:34:20 -0700, vip152.sybase.com
Lines: 20
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30215
Article PK: 72394


On 06/03/2011 07:07 AM, Mark Pare wrote:
> Hi, I wanted to know if Sybase had some kind of function
> that would take the contents of a comma-delimited string and
> insert into a temp table?
>
> We are currently doing it using a procedure to parse, but
> wondering if there is a built-in function.
>
> Let me know. Thanks

it might make more sense to use bcp or a shell script. Perl snippet
example:

$csv_data = '2345,2fdgg,4asfkg,2kHlasdf';

my $query = "insert into #test values (?,?,?,?)";
my $sth = $dbh->prepare($query);
$sth->execute( split(',', $csv_data) );

jason