Migrating Existing MySQL Tables

Questions and answers regarding general SQL and backend databases

Migrating Existing MySQL Tables

Postby jbieley » Fri Jun 06, 2003 10:47 pm

I thought I had this worked ou t but I guess not because now I can't add data to tables.

I am running on Windows XP and have the latest MySQL installed. The mysqld is running, and I created some tables. The auto setup server worked fine and I can see my tables once I created a new solution and copied the tables in from the mysql/data directory. Creating forms went fine, and I can select New Record from the Select menu (the primary key increments fine) but when I click out of the first field I get the following:

"java.sql.SQLException: General error: Table handler for 'products' doesn't have this option General error: Table handler for 'products' doesn't have this option"

Of course this problem doesn't arise when the solution and associated tables were created via Servoy itself. What am I missing? Thanks,


Jon
jbieley
 
Posts: 2
Joined: Fri Jun 06, 2003 10:30 pm
Location: New York

Postby jcompagner » Wed Jun 11, 2003 12:18 am

Does that table has a PK
And does servoy reconize those keys?
(what does the dataprovider dialog of that table say?)

If you create a table with servoy it works just fine? With the exact same mysql version and jdbc driver?

If you click outside a field it tries to insert the record
it seems that that insert is somehow going wrong (it generates the wrong insert statement)

maybe you can change the servoy_developer.bat like this:
java -DSTACKTRACE=true -jar servoy_developer.jar

(so start it with java instead of javaw en use the -DSTACKTRACE setting to get some more info)

Then you will see something like this in the command window:

sql insert into test( testid, naam, naam2) values ( ? , ? , ? )
questiondata[0] 1
questiondata[1] NullValue with type: 12
questiondata[2] NullValue with type: 12

look what kind of sql is generated for youre tables.
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby jcompagner » Wed Jun 11, 2003 10:01 pm

Do those already existing tables have PK's that are auto increment?

Currently servoy doesn't see or know that and tries to insert a pk anyway. But i have tested this yet and my mysql version 4.0.12 doesn't seem to care about servoy inserting there own PK (it just takes that one if it not violates the current PK and after that it just increments from that one)
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby jbieley » Wed Jun 18, 2003 3:37 pm

Yes the tables had autoincrement primary keys, I created the tables with a GUI tool called SQLyog (not at the command line, and I haven't tested that option yet).

You are right, after a bit Servoy just accepts it. I wanted to dig into Servoy (love it) but will test it out more and report back. Thanks,

Jon
jbieley
 
Posts: 2
Joined: Fri Jun 06, 2003 10:30 pm
Location: New York

Postby automazione » Wed Jun 18, 2003 4:35 pm

Probably this is not the case but .... mysql is case sensitive while Servoy creates and uses field name in lowercase. Check the field name formatting and change the field name in lowercase.

bye
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 7 guests