title: To extract DDL statements of a Sybase database
body: <p>We are working with <code>Sybase</code> database. We are using <code>Sybase ASE 15.5</code> version on Windows 7 machine and we have created one sample java program that connect with <code>Sybase</code> using jdbc : <code>com.sybase.jdbc4.jdbc.SybDataSource</code>. We are able to connect and run query on sybase database.</p>
  
  <p>Our requirement is to <code>generate DDL statements</code> : <code>create table scripts</code>, <code>indexes</code>, <code>stored procedure</code>, <code>triggers</code>, <code>synonyms</code>, <code>functions</code> etc. We want to generate <code>SQL script</code> on all database objects.</p>
  
  <p>We have tried to extract using <code>sysobjects</code> and <code>syscolumns</code> as per suggestion give <a href="https://stackoverflow.com/questions/1429898/from-a-sybase-database-how-i-can-get-table-description-field-names-and-types">here</a> but that only produce table names user table and system tables from : <code>SELECT * FROM sysobjects WHERE type = 'U'</code>.</p>
  
  <p>On researching over <a href="http://marlowa.blogspot.in/2014/02/reverse-engineering-sybase-database.html" rel="nofollow noreferrer">reverse engineer sybase</a> using schemaspy tool that visualize the relationship between tables/views. But that of no use, we need script having ddl commands. </p>
  
  <p>On exploring more found that <a href="http://www.sypron.nl/2002Q4_ddlgen.pdf" rel="nofollow noreferrer">ddlgen</a> extracts all sorts of DDL statements (tables, indexes, etc.), how can I extract these statement in my java program using ddlgen?</p>
  
  <p>OR can there be any other solution that will help us to extract ddl of a sybase database like in case of oracle we get using metaModel.getDDL() ?</p>