Toad World® Forums

When does copy'n'paste work?


#1

I like to copy tables from one physical model to another. This seems to work if both models have the same database target type. If types do not match, paste does not work. An error message would be helpful in this case.
It would be really helpful to be able to copy between different model types! An automatic type conversion as with the merge wizard would be sufficient to adopt the column datatypes.


#2

Hi Andreas,

It should work fine.
I’ve just copied several tables from Oracle 10g to MS SQL Server 2005 and vice versa.
There are many options how to do it, e.g.:

  • between two Model Explorers | Entities.
  • from the Entities dialog (Model menu) directly to WS
  • from Model Explorer to WS

Please see the Help file | Index tab and type ‘copy entities’. (See the Use notes for particular technique.)

Movie on this issue:
http://modeling.inside.quest.com/entry.jspa?externalID=1676&categoryID=158

How do you do it?

Regards,

Vladka

Message was edited by: vladka - added link to movie


#3

I tried from one workspace to another. Source was MS SQL and target MySQL 5.0. Nothing happened during paste. Workaround was to convert the complete MS SQL model to MySQL and copy the table from there…

I will play around with the different variants and give you feedback…

Andreas


#4

If you drag the entity from one WS and point the cursor at a WS tab of another model, it is not possible.
BUT you can:

  • Open e.g. Oracle model and make its Designer active.
  • Open e.g. MS SQL model and undock its Designer. Now you can see both Designers.

Drag and drop + CTRL key to copy tables between them.
See the attached screenshots.

You can also open the Entities dialog of MS SQL model (Model menu), activate the WS of Oracle model and copy the selected entities from Oracle model WS to the Entities dialog of MS SQL.
Etc…

Regards,

Vladka


#5

If you drag the entity from one WS and point the cursor at a WS tab of another model, it is not possible.
BUT you can:

  • Open e.g. Oracle model and make its Designer active.
  • Open e.g. MS SQL model and undock its Designer. Now you can see both Designers.

Drag and drop + CTRL key to copy tables between them.
See the attached screenshots.

You can also open the Entities dialog of MS SQL model (Model menu), activate the WS of Oracle model and copy the selected entities from Oracle model WS to the Entities dialog of MS SQL.
Etc…

Regards,

Vladka


#6

Andreas,

Please have a look at the Message Explorer whether there is any message written.
It can happen that the entity has some db specific properties that disallow copying of the entity. In this case, it should be written in Message Explorer.

Thanks for checking it out.

Sorry, I should have come out with this suggestion sooner…

Vladka

Message was edited by: vladka


#7

I tried with selecting the table and pressing Strg-C followed by Strg-V in the other model.

OK, the Message Explorer tells me ‘Objects can’t be copied!’, didn’t see that. But why does this method not work?

Tried from the Entities… dialog, so I can switch the workspace in background, same error.

How to undock a designer?

I managed to copy from MySQL to MS SQL Server, the problem seems to be from MS SQL Server to MySQL!

Removed all varchar(max) and timestamp columns, but the problem is the same!
I don’t understand the restriction…

What are the restrictions in this case and why is the error message not more clearly!?

Andreas

Message was edited by: AndreasL


#8

It often doesn’t happen but can. It occurs when some specific object properties that are in the source model do not exist in target model or it is impossible to copy them.

In this case, please use the Model Conversion feature.
Model | Simple Model Conversion.
You can also set up the Data Type Conversion Settings (Settings menu, Expert mode must be on - Settings | Options | General | Expert mode checkbox).

If you need to copy e.g. just a few entities to already existing model of another db platform, you can convert the source model to a new model of the particular db platform and then merge the two models - the new one + the already existing - or copy the items now when the models are of the same db platform.

If you do not understand, please write me back. Thanks.

How to undock a designer?
SHIFT + double-click the heading of the pane.
Movie:
http://modeling.inside.quest.com/entry.jspa?externalID=1665&categoryID=158

Regards,

Vladka


#9

I already used the model conversion workaround.

I just couldn’t imagine which “some specific object properties” should be the reason in my case. During paste the not convertable “some specific object properties” should just be thrown out.

Andreas


#10

O.K. E.g. Copy of entity from MS SQL 2005 to MySQL 5.1 - entity has Partition Schema. Or, entity has Fulltext Catalog. In these cases, the entity cannot be copied to MySQL.

There are not many examples, really. I wonder what entity you’re trying to copy… Any special SQL server properties as mentioned above?

Regards,

Vladka