distal-attribute
distal-attribute
distal-attribute
distal-attribute

create copy of table

User, date Message
Written by BubikolRamios
2 years ago
Category: General
327 posts since Thu, 14 Jan 10
1.right click on table: create copy --> cant get that anymore, I dont remember in which situation that was available - 30 seconds ago (-: , how to do that again ?
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10
Ok, forget upper, problem:

Want to copy auto inc column into new table. --> must be defined as a key error , not sure in which index it is, and a window that I'm looking at is modal.

Ok, if I look back to indexes, it is part of primary key, and the other fields in PK are not to be copyed to new table, so this is no go.

Mybe, if field is autoinc in source table, it should be , copying to new table be automaticaly converted to type of int ?

Otherwise even if all compatible I'm not suure what will happen.

if in source table auto inc are 6,8,10, will in new table be that or 1,2,3.
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10
To simplify - want to copy only structure,not all columns. No data. No indexes.

Can not do coz of auto inc beeing requested to be a key.

Same as above, mybe it shold be automatialy converteed from autoinc to int.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06

wrote: Can not do coz of auto inc beeing requested to be a key



Does that mean you get an error message or what? If yes which one is it?

wrote: mybe it shold be automatialy converteed from autoinc to int.



auto_increment is an attribute, not a data type, at least in MySQL. An auto_increment flagged column is always of type TINYINT/SMALLINT/INT/MEDIUMINT/BIGINT. So my guess is you want to remove the auto_increment attribute when copying? Or do you want to leave out the values for that column? In that case you can just uncheck the column in the "Copy table" dialog, and add a new id column afterwards.
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10


must be defined as a key error



yes error: 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

hence yes: I want to remove the auto_increment attribute (at new table ofcourse) when copying, othervise I can't copy table via HSQL create copy.

I mean, if I remove index from (include from souce table) autoinc field, HSQL should then automaticaly remove autoinc attribute from autoinc field that goes to target table.


No I don't want to leave out values for that column, nor column itself.
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10
I mean, if I remove index from (include from souce table) autoinc field, HSQL should then automaticaly remove autoinc attribute from autoinc field that goes to target table.

I hope that makes sence.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
I'm confused.

wrote: No I don't want to leave out values for that column, nor column itself.


wrote: if in source table auto inc are 6,8,10, will in new table be that or 1,2,3.



As said. You can uncheck that autoinc column and add a new one after the table is copied. What's wrong with that approach?
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10
BTW - it would be nice if complete error message popping up from HSQL could be copyed from message box. Can't be done now, you can only click OK.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Hm, I think I got it now. I'm trying to say in my own words: If you uncheck a primary key in the "Copy table" dialog, HeidiSQL does not yet remove an auto_increment attribute from the relevant column.
Right?
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
You can always press Ctrl+C in a message box - that's a Windows feature.
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10
Right.

Damn I did not know about that copy stuff (-:. Thanks.
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
Hehe, me too, a colleague told me not long ago about Ctrl+C in a message dialog. Well, having 20 years of computer experience does not say one knows each and every feature...
Written by ansgar
2 years ago
4936 posts since Fri, 07 Apr 06
r4204 now auto-removes the AUTO_INCREMENT attribute if you uncheck a primary key in the "copy table" dialog. Also, the table attribute "AUTO_INCREMENT=6" or whatever is auto-removed by Heidi then. Otherwise, if you add a primary key later, you would start at id "6" again (as an example).

BubikolRamios, I get the impression you are the top-bug/feature-requester here, and I responded to 80% of these with some code change, followed by a "Fixed in rXYZ". I'm curious: Do you use HeidiSQL the whole day for anything, or how is your job? Is your motivation for requesting features driven by "look at the great other client XYZ, should be in HeidiSQL too"? For the latter one - I don't have the impression that this is your motiviation, I only want to be sure here.
Written by BubikolRamios
2 years ago
327 posts since Thu, 14 Jan 10

"look at the great other client XYZ"



Yeah, I had two that type of request only.

First was something from TOAD as HSQL lets you think you imported all rows from csv, saying nothing and I used TOAD for a while for that.

Second I was playing with TOAD a while and it lets you edit data that are result of joined query. Sometimes that would come handy, doh not often. But I bet if that would be in HSQL people would get used to use that all the time.

All, the rest is pure HSQL usage all the time on developing my site agrozoo.net

Doh I doubt I'm the top requester (-:



 

Please login to leave a reply, or register at first.