Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > SQL code > Generating SQL code > Generating SQL code (SQL code)
  
Generating SQL code (SQL code)
This topic provides brief instructions for using ACS to generate SQL code. For more information about using ACS, see Overview of ACS (ACS).
To generate SQL code:
1. From Modeler, open the model from which you want to generate SQL code.
2. If you have not done so already, add the ACS Profile to the model. How?
3. If the ACS/TDK Control toolbar is not shown, on the View menu, point to Toolbars, and then click ACS/TDK Control.
The ACS/TDK Control toolbar displays Not Connected.
4. Load ACS on the ACS/TDK Control toolbar, click the Load or Unload ACS button, and wait for ACS to load.
After ACS is loaded, the ACS/TDK Control toolbar displays Connected.
5. In Modeler, select the root item for the generation, which can be the Model or a Package.
6. Create a Generation Settings Scheme for the root item:
a. On the ACS/TDK Control toolbar, in the drop-down list ensure that New Scheme is selected.
b. On the ACS/TDK Control toolbar, click the Edit ACS Scheme button.
Modeler opens the Launch ACS/TDK dialog.
c. Click the button associated with the Generator Dll box, and select the Oracle 10g, SQL 2003 or SQL Server 2012 ACS Code Generator DLL.
If you have installed Modeler to the default location, the supplied Code Generator DLLs reside in subfolders of the following folder (the name of a Code Generator DLL's folder matches that of the Code Generator DLL).
For Windows 7 and later operating systems:
C:\Users\<user>\AppData\Roaming\ItsShadow\ScriptDir\SQLGen
For 64-bit versions of pre Windows 7 operating systems:
C:\Program Files (x86)\PTC Integrity Modeler\Modeler\System\SQLGen
For 32-bit versions of pre Windows 7 operating systems:
C:\Program Files\PTC Integrity Modeler\Modeler\System\SQLGen
d. Click the button associated with the Target Directory box, and select the folder to which you want to generate SQL code.
e. On the Advance tab, change any values if required. For example, you may want to change the extension of generated files from cs to something else.
f. Click the button associated with the Settings File box, specify a name and location in which to save the Generation Settings Scheme, and then click Open.
g. Click Save Only, and then click Cancel.
7. On the ACS/TDK Control toolbar, click the Start toolbar button.
The ACS/TDK Control toolbar displays Loading Model, followed by either First Generation or Updating Code, followed by Ready.
8. If this is the first time you have used the Generation Settings Scheme to generate code, no code is generated at this point. To generate code the first time, you must force a generation:
a. Ensure that the ACS/TDK Control toolbar is displaying Ready.
b. On the ACS/TDK Control toolbar, click the Force Generate button.
c. From the confirmation dialog, click Yes.
ACS generates the SQL code to the target folder you specified in the Generation Settings Scheme.