db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian.Eugs...@kost.admin.ch
Subject readModelFromDatabase(string) no javadoc entry with string parame ter
Date Thu, 16 Feb 2006 12:11:14 GMT
Hi,

I tried to read the model from a database using the platforms
readModelFromDatabase() method. This method seems to need a single string
parameter the meaning of which is unknown to me. Has anybody a suggestion
what kind of parameter it is? In javadoc I could not find this method with a
single string parameter.

Thank you

Christian

-------------------------------------- 
Christian Eugster
Koordinationsstelle für die dauerhafte Archivierung elektronischer
Unterlagen
c/o Schweizerisches Bundesarchiv
Archivstrasse 24      
3003 Bern

T/ 031 324 17 94
F/ 031 322 78 32
E/ christian.eugster@kost.admin.ch
W/ www.vsa-aas.org/Koordinationsstelle.78.0.html



-----Ursprüngliche Nachricht-----
Von: Thomas Dudziak [mailto:tomdzk@gmail.com]
Gesendet: Donnerstag, 16. Februar 2006 12:12
An: ddlutils-user@db.apache.org
Betreff: Re: Insert SQL error in PostgreSQL 8.1


On 2/16/06, Vignesh Swaminathan <vswamina@cordys.com> wrote:

> I am trying to insert a row into a simple table like
>
> CREATE TABLE orders
> (
>   id int4 NOT NULL,
>   customerid int4,
>   orderdate timestamp,
>   shipdate timestamp,
>   CONSTRAINT orders_pkey PRIMARY KEY (id)
> )
>
> When I fire an insert using Platform.insert(Database, SQL) I get an
> exception message as follows. I tried printing the SQL using
> Platform.getInsertSQL which returned
>
> INSERT INTO "orders" ("id", "customerid", "orderdate", "shipdate")
> VALUES ('1000', '1000', '2006-03-16 00:00:00', '2006-04-21 00:00:00')
>
> However, when I fire this statement in the PostgreSQL query tool the
> insert goes ahead without problem. Please help.
>
<snip>

> Caused by: org.postgresql.util.PSQLException: ERROR: column "orderdate"
> is of type timestamp without time zone but expression is of type
> character varying

Looks like your database model has VARCHAR for the orderdate (and
possibly shipdate) column, and PostgreSql has no implicit default
conversion from string to timestamp. Is the model read from the
database or from an XML file ?

Tom

Mime
View raw message