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.

'Load' not working from java (delimiter)???

2 posts in General Discussion Last posting was on 2002-10-21 15:38:14.0Z
Ronan_Molloy Posted on 2002-10-17 16:58:45.0Z
From: Ronan_Molloy
Date: Thu, 17 Oct 2002 12:58:45 -0400
Newsgroups: ianywhere.public.general
Subject: 'Load' not working from java (delimiter)???
Message-ID: <EFBF3CA8E41D52BB005D451B85256C55.005D452D85256C55@webforums>
Lines: 22
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:529
Article PK: 2348

Hi
I'm calling the load from java but it doesn't seem to recognise the
delimiter. I can run it fine from ISQL.

Is this a Driver problem or JDBC problem. (I'm using
com.sybase.jdbc2.jdbc.SybDriver)

Code is;

String delimiter = "'\\x09'";
String sql = "LOAD into table eAgentLoginStat from " + fileName + "
DELIMITED by " + delimiter + " FORMAT BCP QUOTES off";
System.out.println("SQL "+sql);
Statement stmt = con.createStatement();
int res = stmt.executeUpdate(sql);

it runs but tries to stuff all the fields into the first DB column.
(tried using '\t' for java tab delimiter but sql didn't recognise it)

thanks for any help
Ronan


Raymond_Kwong Posted on 2002-10-21 15:38:14.0Z
From: Raymond_Kwong
Date: Mon, 21 Oct 2002 11:38:14 -0400
Newsgroups: ianywhere.public.general
Subject: Re: 'Load' not working from java (delimiter)???
Message-ID: <DA32BB31571C47C60055E5D585256C59.0062539685256C55@webforums>
References: <EFBF3CA8E41D52BB005D451B85256C55.005D452D85256C55@webforums>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:517
Article PK: 2335

The 8.x documentation

Adaptive Server Anywhere SQL Reference Manual
4. SQL Statements
LOAD TABLE statement

actually gave an example of this using the clause

...DELIMITED BY '\x09' ...

Maybe you have one backslash too many?

Raymond Kwong
iAnywhere Solutions