Thanks a lot, Peter! How stupid of me to count the string length
incorrectly.
By the way, another question. Is there a way to ensure correct storage
and retrieve of special german characters (e.g. "Ö", "Ä", "Ü") in
InstantDB? Would be nice!
Thanks again!
Juergen
Peter Hearty schrieb:
>
> Juergen
>
> kz_text is declared as CHAR(50), but the imported text is 55 characters
> long (i.e. too big for the field).
>
> Pete
>
> ----- Original Message -----
> From: juergen-roeder@t-online.de (Jürgen Röder)
> Date: Wednesday, January 3, 2001 11:36 am
> Subject: InstantDB: java.sql.SQLException
>
> > Hi Peter!
> > I got a java.sql.SQLException error trying to import same data
> > from a
> > txt-file into a instantdb database.
> > You will find all data and declarations used in the attached files.
> > What's going wrong?
> > Thanks in advance!!!
> > Juergen
> >
> > --
> > Juergen Roeder
> > Stettiner Strasse 8
> > D-61348 Bad Homburg v.d.H.
> > Hessen, Germany
> > ---------------------------------------
> > Fon +49 6172 969948
> > Fax +49 6172 969913
> > Mobile +49 173 3162452
> > ---------------------------------------
> > Natl. eMail: juergen-roeder@t-online.de
> > Intl. eMail: juergen_roeder@hotmail.com
> > ---------------------------------------
>
> ------------------------------------------------------------------------
> E:\InstantDB\Tarifbuch>java -Xms16m -Xmx32m org.enhydra.instantdb.ScriptTool import_kz.txt
> Enhydra InstantDB - Version 3.25
> The Initial Developer of the Original Code is Lutris Technologies Inc.
> Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies, Inc.
> All Rights Reserved.
>
> Connected to jdbc:idb:tarifbuch.prp
> Driver InstantDB JDBC Driver
> Version Version 3.25
>
> import_kz.txt IMPORT Kz FROM "./import/kz.dat" BUFFER 4096
> Error importing line 1
> 9,"07","Lastschrift 2. Bankverbindung (noch nicht programmiert)"
> java.sql.SQLException: java.sql.SQLException: Column kz_text cannot accept value Lastschrift 2. Bankverbindung (noch nicht program
> miert)
> at org.enhydra.instantdb.db.Table.addRowAtRow(Table.java, Compiled Code)
> at org.enhydra.instantdb.db.SQLProg.compile_import(SQLProg.java, Compiled Code)
> at org.enhydra.instantdb.db.SQLProg.execute(SQLProg.java:238)
> at org.enhydra.instantdb.jdbc.idbStatement.execute(idbStatement.java, Compiled Code)
> at org.enhydra.instantdb.jdbc.idbStatement.executeUpdate(idbStatement.java:103)
> at org.enhydra.instantdb.SampleThread.run(ScriptTool.java, Compiled Code)
> at java.lang.Thread.run(Thread.java:479)
> Database tarifbuch is shutting down...
> Database tarifbuch shutdown complete.
>
> ------------------------------------------------------------------------
> ; ==============================================================
> ; First load the JDBC driver and open a database.
> ; ==============================================================
> d org.enhydra.instantdb.jdbc.idbDriver;
> o jdbc:idb=tarifbuch.prp;
>
> ; ==============================================================
> ; Record all results
> ; ==============================================================
> e SET EXPORT "./export/Kz.dat" FIXEDLENGTH COLNAMEHEADER ROWNUMBERS CONTROLCOL SUMMARYHEADER;
>
> ; ==============================================================
> ; Drop the table and its index
> ; ==============================================================
> e DROP INDEX kz_nr_idx;
>
> e DROP TABLE Kz;
>
> ; ==============================================================
> ; Create the table and its index
> ; ==============================================================
> e CREATE TABLE Kz (
> kz_nr INTEGER NOT NULL PRIMARY KEY
> FOREIGN KEY REFERENCES Kzname (kzn_nr),
> kz_inhalt CHAR(3) NOT NULL PRIMARY KEY,
> kz_text CHAR(50) NOT NULL
> );
>
> e CREATE INDEX kz_nr_idx ON Kz ( kz_nr ASC );
>
> ; ==============================================================
> ; Close
> ; ==============================================================
> c close;
>
> ------------------------------------------------------------------------
> ; ==============================================================
> ; First load the JDBC driver and open a database.
> ; ==============================================================
> d org.enhydra.instantdb.jdbc.idbDriver;
> o jdbc:idb=tarifbuch.prp;
>
> ; ==============================================================
> ; Import some initial data in the table
> ; IMPORT <table> FROM [URL] <filename> [USING <schema>] [BUFFER <rows>];
> ; ==============================================================
> e IMPORT Kz FROM "./import/kz.dat" USING "import_schema_kz.txt" BUFFER 4096;
> ;e IMPORT Kz FROM "./import/kz.dat" BUFFER 4096;
>
> ; ==============================================================
> ; Close
> ; ==============================================================
> c close;
>
> ------------------------------------------------------------------------
> [Kz.dat]
> ColNameHeader=False
> CharacterSet=ANSI
> Format=CSVDelimited
> Col1=kz_nr Integer
> Col2=kz_inhalt Char
> Col3=kz_text Char
--
Juergen Roeder
Stettiner Strasse 8
D-61348 Bad Homburg v.d.H.
Hessen, Germany
---------------------------------------
Fon +49 6172 969948
Fax +49 6172 969913
Mobile +49 173 3162452
---------------------------------------
Natl. eMail: juergen-roeder@t-online.de
Intl. eMail: juergen_roeder@hotmail.com
---------------------------------------
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
|