Your best best is dbunload -n. Generating the DDL statements for schema objects such as tables by querying the system tables is a large & complex undertaking. dbunload does it for you. |
Just to add to John's answer:
I need to capture the DDL from just one table at a time, so the function mentioned by @Volker Barth (sa_get_table_definition ()) is exactly what I was looking for. Thank you all.
(20 Sep '18, 22:53)
gil
Replies hidden
Feel free to accept that answer, then:)
(21 Sep '18, 04:22)
Volker Barth
1
Sybase Central can be used for this also. If you copy a selected object (i.e. a table) that will generate the DDL for that object which can be pasted into a text editor. This works for the broader schema if you need DDL for objects other than tables.
(21 Sep '18, 07:45)
Chris Keating
|
I am using SQL Anywhere 16.
Are you trying to reverse-engineer existing DDL definitions, or create new DDL statements based on existing objects?
The former is best handled by dbunload, but the latter is not (e.g., generating complex shadow tables and their triggers, or funky MobiLink scripts).
> which commands return such scripts
A deep understanding of the STRING() function and LIST() aggregate function is one prerequisite for writing SQL to generate complex SQL. Another prerequisite is an understanding of the system catalog views.