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?
Comments
Will an undocumented command suit you?
Yes
See the sources of method %SYSTEM.SQL:Export() for a description of the parameters.
Only instead of 0, use 1, for example:
SAMPLES>w $$Export^%qarDDLExport("Sample","*","C:\Temp\Sample.sql","WNS",1,0,0,0,0)I managed to export with the command. Thank you very much!
Here I`m, in 2025, using the same tip to solve a problem.
Thanks, Vitaliy, thanks, community.
Very useful command, thank you @Vitaliy Serdtsev
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.
Initially, the question was asked in relation to Caché or/and Ensemble 2018.1, but not to IRIS.
Thank you @Enrico Parisi , this is helpful!