Database migration problems

  • (2 Pages)
  • +
  • 1
  • 2

25 Replies - 801 Views - Last Post: 10 October 2013 - 02:17 AM Rate Topic: -----

#16 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 08 October 2013 - 06:21 AM

I think it's because I'm not that bright lol.

I was adding to the code to migrate further columns from other tables.. But the executeyquery{} method also ran for table Place everytime again.
And since there is unicity in the new database, i think he was trying to re-add already existing data which would violate the key?


I put commentary brackets around the previous code and now it works...the new database is getting filled. For now.


This is kinda embarassing, but I have to learn right?
thanks for the patience.
Was This Post Helpful? 0
  • +
  • -

#17 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 09 October 2013 - 04:16 PM

try { 
			sourceps = csource.prepareStatement("select dates, customernr");
	        goalps = cgoal.prepareStatement("insert into Job(`date start`, `customer`, `Nr/Date`) values (?,?,?)");
			ResultSet rs = sourceps.executeQuery();


org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 22
`at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:141)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:89)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:1187)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:942)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:896)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:324)
at Convert.main(Convert.java:234)
Caused by: org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 22
`
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2214)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2164)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1551)
at org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:190)
at org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1441)
at org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1282)
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:138)
... 11 more


Why?
Token unknown = backtick.
But without i can't insert into those tables that have spaces in them and other symbols.
How do I fix this?
(the table names to insert into are given in the assignment, i dont think im supposed to alter them)
Was This Post Helpful? 0
  • +
  • -

#18 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2720
  • View blog
  • Posts: 11,438
  • Joined: 20-September 08

Re: Database migration problems

Posted 09 October 2013 - 04:22 PM

Quote

"select dates, customernr"
FROM what?
Was This Post Helpful? 0
  • +
  • -

#19 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 09 October 2013 - 04:24 PM

from Customer

It's in the code, i can't always copy everything since it's in another language.

The error says there must be something wrong with the INSERT INTO. I just can't see what.
Was This Post Helpful? 0
  • +
  • -

#20 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2720
  • View blog
  • Posts: 11,438
  • Joined: 20-September 08

Re: Database migration problems

Posted 09 October 2013 - 04:26 PM

Try escaped double quotes instead of backticks
Was This Post Helpful? 0
  • +
  • -

#21 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 09 October 2013 - 04:35 PM

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -206
Column unknown
date start
At line 1, column 13
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:141)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:89)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:1187)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:942)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:896)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:324)
at Convert.main(Convert.java:237)
Caused by: org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -206
Column unknown
date start
At line 1, column 13
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2214)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2164)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1551)
at org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:190)
at org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1441)
at org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1282)
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:138)
... 11 more

And the column definitely exists, im looking at it right now.
It doesn't find any of the other columns either
Was This Post Helpful? 0
  • +
  • -

#22 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 09 October 2013 - 05:09 PM

Is there some other way to put in quotes or something? Anything? im really stuck here
Was This Post Helpful? 0
  • +
  • -

#23 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2720
  • View blog
  • Posts: 11,438
  • Joined: 20-September 08

Re: Database migration problems

Posted 10 October 2013 - 01:46 AM

Make doubly sure you're connecting to the right db - you could be looking at a quite different one if there have been other 'experiments'
Was This Post Helpful? 0
  • +
  • -

#24 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 10 October 2013 - 02:08 AM

I haven't touched those tables yet and all the rest has migrated. so i am connected, i haven't disconnected.
Was This Post Helpful? 0
  • +
  • -

#25 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2720
  • View blog
  • Posts: 11,438
  • Joined: 20-September 08

Re: Database migration problems

Posted 10 October 2013 - 02:15 AM

Please show latest problematic code
Was This Post Helpful? 0
  • +
  • -

#26 Random01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 06-October 13

Re: Database migration problems

Posted 10 October 2013 - 02:17 AM

Whew, ok I've got it.

Man, i hate these stupid mistakes.
So my problem was I was looking at the table names in Cathedron. There columns are written for example like "date start".
But when i search through them with IBExpert they are written as "date_start".

Pfffff.
Once again thanks for the patience.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2