Set of stored procedures that can be used to extract DDL of various objects from SAP Sybase IQ quickly and efficiently.

While IQ provides efficient ways to perform regular and/or virtual database backups, it doesn't provide an easy way to perform backup of database structure only (not including the data). I have found this kind of backup very useful. Nobody will want to restore a 50TB virtual backup just to restore an important stored procedure dropped by accident, for example. In addition, I have found some bugs in Sybase Central “copy/paste” functionality. Particularly, the order of columns in primary key may be generated incorrectly.

I have prepared a set of stored procedures that can be used to extract DDL statement from Sybase IQ. The stored procedures have been tested with versions 12.6, 12.7, 15.2 and 15.4. There are different sets of stored procedures: one for versions 12.6 and 12.7 and another one for versions 15.*.


Set of stored procedures that can be used to un-pivot an arbitrary result set in isql.

It may very convenient when working with relatively small result sets which contains big number of columns. It is similar to Tom Kyte's print_table. See examples inside.


Stored procedures for calculation of suitable geohash lists for a polygon of an arbitrary shape or for a circle with the center in a given point and with a given radius.

First published on SAP Teched 2013 conference in Las Vegas. Works with SAP Sybase IQ starting from version 15.4. Examples of procedure calls are in the source code.