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.

Need help with load statement

3 posts in General Discussion Last posting was on 2011-05-18 14:17:51.0Z
ggolub Posted on 2011-05-15 04:15:31.0Z
Sender: 6f39.4dcf3d96.1804289383@sybase.com
From: ggolub
Newsgroups: sybase.public.iq
Subject: Need help with load statement
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dcf5363.71c4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 May 2011 21:15:31 -0700
X-Trace: forums-1-dub 1305432931 10.22.241.41 (14 May 2011 21:15:31 -0700)
X-Original-Trace: 14 May 2011 21:15:31 -0700, 10.22.241.41
Lines: 46
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4365
Article PK: 246505

Hello All
I am loading row into employee table and get syntax error:
Syntx

which have column defined:
"start_date" datetime NULL ,

row of data:
-------------
102,501,'Fran ','Whitney
',100,'49 East Washington Street ','Needham
','MA ','02192 ','6175553985','A','017349033
',45700.000,'1984-08-28 00:00:00.000000',,'1958-06-05
00:00:00.000000','Y','Y','N','F'

Load statement:
-----------------
load table employee(
emp_id ','
, manager_id ','
, emp_fname ','
, emp_lname ','
, dept_id ','
, street ','
, city ','
, state ','
, zip_code ','
, phone ','
, status ','
, ss_number ','
, salary ','
, start_date ',' DATETIME('YYYY-MM-DD hh:mm:ssss')
, termination_date ','
, birth_date ','
, bene_health_ins ','
, bene_life_ins ','
, bene_day_care ','
, sek ','
)
from '/u/sybase/iqload/emp.txt'
format 'ascii'
row delimited by '\n'
escapes off
strip off
quotes off
with checkpoint on


queryplan_de Posted on 2011-05-18 14:17:51.0Z
Sender: 7958.4dd38cb7.1804289383@sybase.com
From: queryplan_de
Newsgroups: sybase.public.iq
Subject: Re: Need help with load statement
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd3d50f.54f.1681692777@sybase.com>
References: <4dcf5363.71c4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 18 May 2011 07:17:51 -0700
X-Trace: forums-1-dub 1305728271 10.22.241.41 (18 May 2011 07:17:51 -0700)
X-Original-Trace: 18 May 2011 07:17:51 -0700, 10.22.241.41
Lines: 21
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4369
Article PK: 246508

Hello,

additional to my previous answer
this is also possible:

LOAD TABLE datetimefile_load
(
[datetimefield] DATETIME('YYYY-MM-DD hh:nn:ss.ssssss')
)
from '/cluster/wasbes/fxplrd/datetimefile.csv'
escapes off
quotes on
with checkpoint on

but a input-format-string with 'YYYY-MM-DD hh:mm:ss.ssssss'
produces an error.
From documentation 12.7 IQ refernce guide on page 584 (table
6-9)
I understand hh:nn or hh:mm should be possible. But it's
not.
So use one of the working proposals.


queryplan_de Posted on 2011-05-18 10:07:18.0Z
Sender: 7958.4dd38cb7.1804289383@sybase.com
From: queryplan_de
Newsgroups: sybase.public.iq
Subject: Re: Need help with load statement
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd39a56.7b0b.1681692777@sybase.com>
References: <4dcf5363.71c4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 18 May 2011 03:07:18 -0700
X-Trace: forums-1-dub 1305713238 10.22.241.41 (18 May 2011 03:07:18 -0700)
X-Original-Trace: 18 May 2011 03:07:18 -0700, 10.22.241.41
Lines: 26
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4368
Article PK: 246509

Hi,

As your datetime format is standard I ommitted the
datetime('YYYY-MM-DD hh:mm:ss.ssssss')

For me it looks like it is a bug in Sybase or the
documentation is not worth any money.

I used that code for testing this. That worked.

Greets

-------------------
importfile .../datetimefile.csv contains:
'1984-08-28 00:00:00.000000'
-------------------
CREATE TABLE datetimefile_load (datetimefield DATETIME)

load table datetimefile_load
(
[datetimefield] '\n'
)
from '.../datetimefile.csv'
escapes off
quotes on
with checkpoint on