Robert
Follow / 5 Oct 2017 at 4:08pm / Toad Data Modeler
Latest post by on 23 Oct 2017 at 11:43am

Object permission

Expand content
Hi, please can You help me: how setting Toad Data Modeler for SQL Preview including object permission? I need view SQL script with grants, for examle: CRATE TABLE xyz ( ... ) go GRANT SELECT...

Hi, please can You help me: how setting Toad Data Modeler for SQL Preview including object permission? I need view SQL script with grants, for examle:

CRATE TABLE xyz (

...

)

go

GRANT SELECT on xyz to user_a

go

(I have defined users and groups in fold 'Permissions', but in SQL Script aren't), thanks.

Unanswered 124 8 / Create an account to join the discussion.
SAinCA
Follow / 5 Oct 2017 at 1:44am / Toad Data Modeler
Latest post by on 6 Oct 2017 at 6:22am

Macro - how to get the schema property for an Entity

Expand content
I have a macro that gives 99% of the information I need to work through a list of entities NOT painted on a Workspace. I need the SCHEMA so I can emit schema.entityName to the Message pane. This doesn't...

I have a macro that gives 99% of the information I need to work through a list of entities NOT painted on a Workspace.

I need the SCHEMA so I can emit schema.entityName to the Message pane.

This doesn't work:

Log.Information (iteratedEntity.Schema + "." + iteratedEntity.Name);

It gives: undefined.entityName

Can someone please point me to a usable scripting reference?  I have open the TDMReference.chm, but it's full of not really usable information on "how to get a schema name for an entity..."  Likewise the Toad Data Modeler Help.chm file - nothing of any use.

Here's hoping...  Thanks!

105 3 / Create an account to join the discussion.
greg long
Follow / 9 Dec 2016 at 5:18am / Toad Data Modeler
Latest post by on 27 Sep 2017 at 12:38pm

Seeking advice on how to prevent creation of field captions when generating...

Expand content
I've looked but haven't found any option or guidance on how to prevent the generation of field captions when creating an Access database. Use of captions in Access is a nightmare - no matter...

I've looked but haven't found any option or guidance on how to prevent the generation of field captions when creating an Access database.

Use of captions in Access is a nightmare - no matter what alias you choose to give a field in a query, Access persists in using the field's 'caption' value, if one exists. This then allows two or more query columns to have the same name - which for the unwary (like my clients) can be a  confusing show-stopper.

(Yes - I can create code that removes them once I've built the database...but happy not to explore that option. And yes, I could modify the DDL (VBA) before I run it to prevent the caption from being created.  But, I'd rather a toggle option in TOAD.)

Thanks for any advice

Greg

933 3 / Create an account to join the discussion.
thastings
Follow / 11 Jul 2017 at 2:31am / Toad Data Modeler
Latest post by on 14 Jul 2017 at 7:16am

Can someone help me with a macro to set database space

Expand content
I have reverse engineered one of our existing datbases and made a change. But now I have a validation error as the database space has not defaulted to system. Is there a way I can do this without editing...

I have reverse engineered one of our existing datbases and made a change. But now I have a validation error as the database space has not defaulted to system. Is there a way I can do this without editing every entity.

Thanks

Terry

Unanswered 458 5 / Create an account to join the discussion.
3digits - Desarrollo
Follow / 5 Jun 2017 at 5:05pm / Toad Data Modeler
Latest post by on 7 Jun 2017 at 3:41pm

Macro for adding entities and sequences to PostgreSQL model ends with...

Expand content
Hi! TDM Version 5.4, PostgreSQL 9.2 model. I'm developing a macro that adds an Entity and its related sequence to PostgreSQL model. After macro ends I launch a model test and I get this message...

Hi!

TDM Version 5.4, PostgreSQL 9.2 model.

I'm developing a macro that adds an Entity and its related sequence to PostgreSQL model. After macro ends I launch a model test and I get this message:

Nonpaired objects "TPERCustomObject.<name_of_seq>" and"TPEREntity.<name_of_entity>", property "OwnedByTable". Back link is missing.

Macro for adding tables:

Entity = Model.CreateNewObject(2002); // add new entity
Entity.Name = "...";
Entity.Caption = "...";
//...code for adding attributes, PK, ..., and other table stuff

Macro for adding sequences:

var seq = Model.CreateNewObject(51000); //sequence
seq.Name = "...";
if (seq.SupportsProperty("OwnedByTable")) {
  seq.OwnedByTable = Entity;
  seq.OwnedByColumn = prefix + "_CODE";
  var atr = Entity.Attributes.GetObjectByName(seq.OwnedByColumn);
  atr.DefaultValue = "nextval('" + nomSeq + "')";
}
if (seq.SupportsProperty("StartWith")) {
  seq.StartWith = "1";
}
if (seq.SupportsProperty("IncrementBy")) {
  seq.IncrementBy = "1";
}
if (seq.SupportsProperty("Cache")) {
  seq.Cache = "10";
}
if (seq.SupportsProperty("Comments")) {
  seq.Comments = "Secuencia para " + Entity.Name + "." + prefix + "_CODIGO";
}

What does it means "Back link is missing."? Some kind of "link" in the table or attribute?

Am I missing some step in my code? 

Thanks in advance.

Regards!

Answered 561 5 / Create an account to join the discussion.
eric.tobias_812
Follow / 19 May 2017 at 7:19pm / Toad Data Modeler
Latest post by on 22 May 2017 at 7:44am

How many relations match a string?

Expand content
I'd like to get a count of relations in a physical model that match a particular string. I see a "GetObjectByName" function, but it doesn't seem to return a count. I'd like to be...

I'd like to get a count of relations in a physical model that match a particular string. I see a "GetObjectByName" function, but it doesn't seem to return a count. I'd like to be able to do something like:

  • Model.Relations.GetObjectByName("MyRelationName").Count

How would I achieve this?

338 1 / Create an account to join the discussion.
3digits - Desarrollo
Follow / 7 Sep 2012 at 3:23pm / Toad Data Modeler
Latest post by on 25 Apr 2017 at 7:49am

Model remains unchanged after macro execution

Expand content
Hi, This is. Model remains unchanged after macro execution, and for example, a table is added. I have to make a "dummy" change to model and then I can save it. Regards, Biel B.
Hi,

This is. Model remains unchanged after macro execution, and for example, a table is added. I have to make a "dummy" change to model and then I can save it.

Regards,

Biel B.
12205 4 / Create an account to join the discussion.
Nicola Clement
Follow / 27 Feb 2017 at 9:44am / Toad Data Modeler
Latest post by on 28 Feb 2017 at 12:35pm

How to call Toad Data Modeler from C# application?

Expand content
I generated a TXP model using Toad Data Modeler 6.1 I launched the command: TDM.exe /regserver I written and executed automation script to perform various Toad Data Modeler tasks. How to call TDM from...

I generated a TXP model using Toad Data Modeler 6.1
I launched the command: TDM.exe /regserver
I written and executed automation script to perform various Toad Data Modeler tasks.

How to call TDM from C# application? I tried to execute the following csharp code:

{

Type toadType = System.Type.GetTypeFromProgID("TDM.App");
 dynamic App = System.Activator.CreateInstance(toadType);

while (!App.Application.IsPackagesLoaded)
 {
         Thread.Sleep(1000);
 }

var Model = App.OpenModelFromFile("C:\MyProject.txp");

 // TO DO...

}

but The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)).

How can I solve this problem, anyone knows?  Thanks very much!

Regards,
Nicola

Unanswered 645 3 / Create an account to join the discussion.
Nicola Clement
Follow / 28 Feb 2017 at 10:47am / Toad Data Modeler

Where's Toad Object Library (API COM) ?

Expand content
How to automate Toad Data Modeler from Microsoft Visual C# .NET ? I need to create an Automation Client for Toad in C#. How can I do it? Thanks a lot in advance for any help, Nicola

How to automate Toad Data Modeler from Microsoft Visual C# .NET ? I need to create an Automation Client for Toad in C#.

How can I do it?

Thanks a lot in advance for any help,

Nicola

Unanswered 411 0 / Create an account to join the discussion.
sigmond
Follow / 20 Dec 2016 at 4:37am / Toad Data Modeler
Latest post by on 20 Dec 2016 at 8:39am

Workspace Properties > Select Children > Not Working?

Expand content
I am trying to add the children of an Entity to the Workspace. This is what I am doing: Right-click Workspace Click Edit Select the parent Entity Right-click the parent Entity Click Select...

I am trying to add the children of an Entity to the Workspace.  This is what I am doing:

  • Right-click Workspace
  • Click Edit
  • Select the parent Entity
  • Right-click the parent Entity
  • Click Select Children
  • Click OK

Only the original Entity that was selected is added to the Workspace.  It's children are not.

Q: What am I missing here?

707 1 / Create an account to join the discussion.
mail8mz
Follow / 31 Oct 2016 at 6:04pm / Toad Data Modeler
Latest post by on 2 Nov 2016 at 3:29pm

Database development procedure

Expand content
Hello, We are using the Toad modeler and Oracle as our database development environment. There are several enviornments(development, testing, production), we have multiple release working in parallel...

Hello,

We are using the Toad modeler and Oracle as our database development environment. There are several enviornments(development, testing, production), we have multiple release working in parallel. For example, there may several drops for each Release in development environment, we need to consolidate these into one drop to testing environment. Meanwhile,  we would like the keep the consistence between the model and the production database. We are using SVN as the version control system.

Toad modeler has the function of reverse enginnering, generate DDL, merge model and etc, which makes it a good tool for such development. Is there any best practice of the procedure or toturial for such database development using Toad modeler, version control and database system?

Thanks,

1146 4 / Create an account to join the discussion.
Danny Torres
Follow / 1 Nov 2016 at 1:32pm / Toad Data Modeler

We are now on Twitter!!! Contact a Technical Support expert today...

Expand content
Do you have a quick support question and short of time? Contact us Via Twitter @ QuestExperts and we will take care of you. #Jointheinnovation #WeareQuest

Do you have a quick support question and short of time? Contact us Via Twitter  @QuestExperts and we will take care of you. #Jointheinnovation #WeareQuest

712 0 / Create an account to join the discussion.
andre.furtado
Follow / 31 Aug 2016 at 2:17am / Toad Data Modeler
Latest post by on 31 Aug 2016 at 2:40pm

How to generate a TXP model from a SQL file by Automation Script?

Expand content
How to generate a TXP model from a SQL file by Automation Script? Javascript or VBScript. Cheers.

How to generate a TXP model from a SQL file by Automation Script?

Javascript or VBScript.

Cheers.

Unanswered 1494 1 / Create an account to join the discussion.
robertsg62
Follow / 21 Jul 2016 at 7:16pm / Toad Data Modeler
Latest post by on 25 Jul 2016 at 6:41am

Attempting to assign Schema to Indexes

Expand content
Hello, I have multiple workspaces under one model, where each workspace is a separate schema with tablespaces. I have been able to write a script that iterates through the indexes of an entity and assign...

Hello,

I have multiple workspaces under one model, where each workspace is a separate schema with tablespaces.  I have been able to write a script that iterates through the indexes of an entity and assign the tablespace for each based on the entities schema.  However I haven't been able to assign the schema to each index.  It is available in the drop down box on each index, but I have been unable to access it through scripting.

I have attempted to use the Scripting Reference Guide and have had some success, but not in this instance.

Database: Oracle 12c

Toad Data Model: version 5.4.6.12

Any and all assistance would be greatly appreciated.

Unanswered 1707 3 / Create an account to join the discussion.
Tommaso Sala
Follow / 15 Jul 2016 at 9:56am / Toad Data Modeler
Latest post by on 19 Jul 2016 at 9:50am

Using combobox in customized form

Expand content
Hi, I created some custom string properties in MetaModel. These properties are applied on class PERDomainOR (object type: 2006). Note: I had to use PERDomainOR (and not PERDomain) because Domain Edit...

Hi,

I created some custom string properties in MetaModel. These properties are applied on class PERDomainOR (object type: 2006).

Note: I had to use PERDomainOR (and not PERDomain) because Domain Edit Form is already customized in "Database Oracle" package, so I had to create a new package extending this one.

Then I tried to edit them via a customized form. Using a simple DataEdit textbox, they are saved and loaded correctly from my ERD model.

But If I try to use a DataStaticComboBox (in dropdown list mode, to only accept a predefined set of string values) they completely stop working.

In fact, when I select a value from the combo and then click "Apply", the value disappears.

Saving and opening my ERD model in a text editor, I can see custom property tags within each <PERDomain> node, but they are empty.

Even if I try to manually write a valid value in the XML file, when opened, the combo does not load the value.

Combo's DataSource and DataField are set the same as (working) DataEdit textbox, and StoreDirectly property is set to true.

What can I do?

If of any help, we're currently still on Toad 5.3.

1734 4 / Create an account to join the discussion.
LALIT KUMAR B
Follow / 11 Jul 2016 at 11:45am / Toad Data Modeler
Latest post by on 11 Jul 2016 at 2:38pm

Macro to rename index on foreign key

Expand content
Hi, TDM version : 6.0 Requirement: My requirement is to rename foreign key indexes with suffix based on following condition: tablename_columnname(s)_fk_i What I tried so far: I searched...

Hi,

TDM version : 6.0

Requirement:

My requirement is to rename foreign key indexes with suffix based on following condition: tablename_columnname(s)_fk_i

 

What I tried so far:

I searched the PERIndex and PERIndexItem properties, but I couldn't find the property to check the condition Index.Foreign similar to Index.Unique.

 

if (Index.Unique)
{
suffix = "_uk_i";
}

// How to rename foreign index


else if (Index.Foreign)
{
suffix = "_fk_i";
}

else

{

suffix = "_i";

}

 

Question:

How to rename the foreign index as per above code. I need to implement following rule : tablename_columnnames(s)_fk_i

 

Regards,

Lalit

Unanswered 1861 3 / Create an account to join the discussion.
LALIT KUMAR B
Follow / 7 Jul 2016 at 9:34am / Toad Data Modeler
Latest post by on 11 Jul 2016 at 6:58am

Relationships naming convention macro

Expand content
Hi, TDM version : 6.0 I am writing a macro to enforce naming conventions. I could successfully implement it for Primary keys, alternate keys, unique keys etc. I could also implement it for Relationships...

Hi,

TDM version : 6.0

I am writing a macro to enforce naming conventions. I could successfully implement it for Primary keys, alternate keys, unique keys etc. I could also implement it for Relationships, however, I am stuck on how to find the column name of the parent table it is referring to.

Let me show an example of Emp-Dept tables to explain clearly. Let's say I have the following relationship for which I am checking the naming convention as "dept_deptno_emp_deptno_fk

Example :

ALTER TABLE "scott"."dept" ADD CONSTRAINT "dept_deptno_emp_deptno_fk" FOREIGN KEY ("deptno") REFERENCES "scott"."emp" ("deptno");

The foreign key and the column name it references are same "deptno". But let's say the names are different, in such case I need the foreign key as well as the column name it is referring to, since the naming convention rule for relationships I need is:

ChildEntity_ForignKey_ParentEntity_ParentKey_FK

 

Macro:

for (i = 0; i < model.Relations.Count; i++)
{
obj = model.Relations.GetObject(i);
relationship = null;
if (obj.ObjectType == 2504) // relation line selected on
{
relationship = obj.ParentBase;
}
else if (obj.ObjectType == 2004) // relation selected
// in Model Explorer
// or Object Viewer
{
relationship = obj;
}
if (relationship != null)
{
//System.ShowMessageDialog(++dialogId, 'InfoDialog', "rel name is " + relationship.Name, 2, 4);


for (fk = 0; fk < relationship.ForeignKeys.Count; fk++)
{
constraint = relationship.ForeignKeys.GetObject(fk).KeyConstraintItem;

//System.ShowMessageDialog(++dialogId, 'InfoDialog', constraint.Name, 2, 4);

}

//System.ShowMessageDialog(++dialogId, 'InfoDialog', "the fkey index name is " + relationship.ForeignIndex.Name, 2, 4);
name = relationship.ChildEntity.Name + "_" + constraint.Name + "_" + relationship.ParentEntity.Name + "_" + <How to get the column in parent table it is referring to> + "_fk";
//System.ShowMessageDialog(++dialogId, 'InfoDialog', "new rel name is " + name, 2, 4);
relationship.Name = name;
relationship.Caption = name;
}

}

 

Question:

Relationship name : ChildEntity_ForignKey_ParentEntity_ParentKey_FK

For above relationship name, how to get the ParentKey i.e. the column in the parent table it is referring to?

Please let me know if you need more information.

Regards,

Lalit

Unanswered 2163 5 / Create an account to join the discussion.
kenatsun
Follow / 24 Apr 2016 at 10:23pm / Toad Data Modeler
Latest post by on 25 Apr 2016 at 9:48am

Customizing relationship line formats

Expand content
I need to do two things re formatting relationship lines. Can these be done, and if so, how? Provide a setting to override the convention that identifying relationships are shown as solid lines and...

I need to do two things re formatting relationship lines.  Can these be done, and if so, how?

  1. Provide a setting to override the convention that identifying relationships are shown as solid lines and non-identifying relationships are shown as dashed lines.  The identifying/non-identifying semantic/functional difference is important to capture, and I'm glad that Toad does this.  But I need to be able to show both types of relationships as solid lines.
  2. Let me modify the displayed line pattern (solid vs dashed vs whatever) for individual relationships.  In other words, provide a line pattern choice on the relationship line format dialog (which currently only lets one customize line color and weight).

If these aren't built-in options, is there a way that I could implement them in my installation by writing macros or whatever?

~ Thanks in advance, Ken

Unanswered 2116 1 / Create an account to join the discussion.
jackomino
Follow / 3 Jun 2015 at 1:21pm / Toad Data Modeler
Latest post by on 4 Apr 2016 at 12:08pm

Entity custom properties

Expand content
Good afternoon, we'd like to set additional properties to Model Entity, so that we can use them later when we create our object from Model itself: for example the information if a field can be modified...

Good afternoon, we'd like to set additional properties to Model Entity, so that we can use them later when we create our object from Model itself: for example the information if a field can be modified by application or by scripting.

Is there a chance to do this ?

Thanks a lot in advance for any help

Jackomino

Unanswered 6695 7 / Create an account to join the discussion.
martinez.astek
Follow / 22 Dec 2015 at 4:02pm / Toad Data Modeler
Latest post by on 4 Jan 2016 at 10:31am

HTML Report Customization

Expand content
Hello, I have realized a package to customize reports HTML for the database Oracle,MySQL and Sql Server. But only, few case work fine: all Oracle reports, MySQL 5.0 reports and SQL SERVER 2005 reports...

Hello,

I have realized a package to customize reports HTML for the database Oracle,MySQL and Sql Server. But only, few case work fine: all Oracle reports, MySQL 5.0 reports and SQL SERVER 2005 reports. I suppose that i have a problem with my classes which extend the default classes...

My package is join to the post. If someone can help me, i work on this for a couple of days and I am disappointed with that...


Regards

Answered 2444 2 / Create an account to join the discussion.