Written by

Integration Analyst at BPlus Tecnologia
Question Guilherme Koerber · Dec 8, 2021

Export DDL from a Caché class

I need to generate a DDL file from a .cls class that already exists, the idea is to create a mirror table in SQL. Is it possible to do this export or do I need to do the CREATE TABLE manually?

Product version: Ensemble 2018.1

Comments

Vitaliy Serdtsev  Dec 8, 2021 to Guilherme Koerber

See the sources of method %SYSTEM.SQL:Export() for a description of the parameters.

Only instead of 0, use 1, for example:

SAMPLES><FONT COLOR="#0000ff">w $$</FONT><FONT COLOR="#ff0000">Export</FONT><FONT COLOR="#000000">^%qarDDLExport(</FONT><FONT COLOR="#008000">"Sample"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"*"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"C:\Temp\Sample.sql"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"WNS"</FONT><FONT COLOR="#000000">,1,0,0,0,0)</FONT>
0
Guilherme Koerber  Dec 8, 2021 to Vitaliy Serdtsev

I managed to export with the command. Thank you very much!

0
Marcio Jose Pedroso Dias  Jan 28 to Vitaliy Serdtsev

Here I`m, in 2025, using the same tip to solve a problem.
Thanks, Vitaliy, thanks, community.

0
Enrico Parisi · Mar 30

While the suggested method should still work (haven't tested), I'd advise using the official method $system.SQL.Schema.ExportDDL()

See Class Reference for documentation details  and samples.

0
Vitaliy Serdtsev  Mar 31 to Enrico Parisi

Initially, the question was asked in relation to Caché or/and Ensemble 2018.1, but not to IRIS.

0