ScriptFolder vs Database
fabianafsampaio
Posts: 6
Hi,
How can I compare a script containing DDL from multiple tables with a database? It is possible?
Currently only can make the comparison when the file contains only one table DDL.
Thanks
How can I compare a script containing DDL from multiple tables with a database? It is possible?
Currently only can make the comparison when the file contains only one table DDL.
Thanks
Comments
Thank you for your forum post.
Yes you will be able to compare a scripts folder containing DDL scripts for multiple objects against a live schema
I am unsure on how you created the scripts folder you are using as a data source in your comparison. This help ARTICLE contains advice on working with script folders.
Schema Compare for Oracle will not operate using existing scripts folders unless to was created using either Schema Compare for Oracle or Source Control for Oracle which contains a DatabaseInfomation.xml file. The scripts folder will then contain sub-folder of the schema which then contains further sub-folders for the object type (for example Tables, Views, Types) along with a SchemaInformation.xml file. Using the Tables sub-folder as an example, there will be scripts one for each table in the schema.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Yes, the script was created using Schema Compare. We already have a DatabaseInfomation.xml file, with folder and sub-folder like you said.
I posted the images here: http://myoraclelife.blogspot.com.br/2016/02/redgate-images.html
Thank you!
Thank you for your reply.
Looking at the screen shots, it appears that you have two CREATE TABLE statements when just the one should exist. In my experience, Schema Compare for Oracle creates a script for each table and not one script with multiple CREATE TABLE statements.
Was the script edited outside of Schema Compare for Oracle to add the second CREATE TABLE statement? Or the product generated this particular script containing the two CREATE TABLE statements?
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
The script was generated by Schema Compare. I already tried put a escape character "" before second CREATE TABLE, but didn't work.
Thank you!
Thank you for your reply.
I suspect that you have misunderstood.
The .sql file, can only contain the DDL for one CREATE TABLE statement.
For example, you have a schema that contains 20 tables. In the scripts folder, Tables sub folder, you will have 20 .sql files one for each of the 20 tables. Each .sql file will be named with the same name as the table name included in the DDL. You cannot reduce this to a single .sql file, that has the CREATE TABLE DDL for each of the 20 tables. Schema Compare for Oracle will not parse a single .sql file containing multiple CREATE TABLE statements.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com