[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hsqldb-user
Subject:    Re: [Hsqldb-user] Error with datetime while using text tables
From:       "Fred Toussi" <fredt () users ! sourceforge ! net>
Date:       2011-08-08 20:11:51
Message-ID: 1312834311.9917.2160886013 () webmail ! messagingengine ! com
[Download RAW message or body]

Your text source shouldn't contain the single quotes around timestamp
strings. The only accepted form of quote character in text files is the
double quote. But you don't normally need to have quoted fields unless
your text strings contains commas. See the Text Tables chapter of the
Guide.

Fred

On Mon, 08 Aug 2011 15:08 -0300, "Marcelo Sena"
<marceloslacerda@gmail.com> wrote:
> Hi members,
> I'm getting a error while loading a csv file to a text table, the file
> has this content:
> 
> '2008-08-08 20:08:08+8:00',25015003,10.150,0,18
> '2008-08-08 20:18:08+8:00',25015003,10.150,0,18
> '2008-08-08 20:28:08+8:00',25015003,10.150,0,18
> '2008-08-08 20:38:08+8:00',25015003,10.150,0,18
> '2008-08-08 20:48:08+8:00',25015003,10.150,0,18
> 
> and the table definition has this format:
> 
> create text table myschema.table4 (
>   field1 timestamp with time zone,
>   field2 numeric(8,0) references myschema.table1(t1key),
>   field3 numeric(8,3) not null,
>   field4 numeric(1,0) references myschema.table2(t2key),
>   field5 smallint references myschema.table3(t3key),
>   primary key (field1, field2, field5)
> )
> 
> The error is a
> org.hsqldb.HsqlException: data exception: invalid datetime format
> 
> However I'm able to insert the data manually to a normal table using
> the DatabaseManagerSwing using the following idiom:
> 
> insert into myschema.table4 values ('2008-08-08
> 20:08:08+8:00',25015003,10.150,0,18)
> 
> Why am I getting that, invalid datetime format, error?
> 
> --
> Marcelo Lacerda
> 
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts. 
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Hsqldb-user mailing list
> Hsqldb-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user
> 

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Hsqldb-user mailing list
Hsqldb-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic