Toad World® Forums

How to change information block of schema SQL scripts?


#1

Hi,

I wonder, if it’s possible to change the starting creating information of create/drop schema scripts.

The default is for example this:

— SNIP —
/*
Created: 27.01.2010
Modified: 17.01.2011
Model: MyModelName
Database: MS SQL Server 2005
*/

– Drop relationships section -------------------------------------------------

— SNAP —

The problem is, if I try to run the script, so the “/" up to "/” is invalid SQL. But the information is a good hint to ensure I use the correct script.

So I would prefere to change this information block to something like this:
— SNIP —
– Created: 27.01.2010
– Modified: 17.01.2011
– Model: MyModelName
– Database: MS SQL Server 2005

– Drop relationships section -------------------------------------------------

— SNAP —

Is there any chance to do this?

Message was edited by: Berthold


#2

Program files\Quest Software\Toad Data Modeler 3\Packages\System\Generations*.txg!?

Message was edited by: AndreasL


#3

Thanks a lot.

The problem is, in all (my) generators it’s the same hardcoded script:
— SNIP —
function BeforeGeneration()
{
var text = “”;

text = “/" + “\r\n”
+ “Created: " + Instance.Model.ModelTitle.CreatedDateAsText + “\r\n”
+ “Modified: " + Instance.Model.ModelTitle.ModifiedDateAsText + “\r\n”
+ ((Instance.Model.ModelTitle.Project != “”)?(“Project: " + Instance.Model.ModelTitle.Project + “\r\n”):””)
+ ((Instance.Model.ModelTitle.ModelName != “”)?(“Model: " + Instance.Model.ModelTitle.ModelName + “\r\n”):””)
+ ((Instance.Model.ModelTitle.Company != “”)?(“Company: " + Instance.Model.ModelTitle.Company + “\r\n”):”")
+ ((Instance.Model.ModelTitle.Author != “”)?(“Author: " + Instance.Model.ModelTitle.Author + “\r\n”):”")
+ ((Instance.Model.ModelTitle.Version != “”)?(“Version: " + Instance.Model.ModelTitle.Version + “\r\n”):”")
+ "Database: " + Instance.Model.ModelDef.Name + “\r\n”
+ "
/” + “\r\n”;
— SNAP —

Perhaps this could be configurable or better choose to the behavior of each database. MySQL supports “/* … */”. Oracle does not.


#4

Hi,

you can change terminator character on tab Detail Settings of the DDL Script Generation dialog, but it really doesn’t affect the header, only code below the header.
I will create new change request for this.

Regards,

Vaclav