Skip to Content
0
Former Member
Feb 10, 2016 at 10:36 AM

ddlgen for Functions

140 Views

Hi, I need to generate ddl for functions but looks that ddlgen support them partially.

If I run

ddlgen -TDB -N<db name> ...

this generate all objects of the db <db name> and functions with grants as well.

but...

if I want to generate only functions looks from docs it is not possible, the parameter -T does not allow the value 'SF' (as 'type' in sysobjects for functions) or any suitable value for functions.

I would like to know if ddlgen can generate ddl only for functions.

I already found a workaround, my question is about ddlgen.

Just as additional information here is the workaround:

sp_showtext <function name>

or better

sp_showtext @objectname='<function name>', @printops='ddlgen'

but this does not generates grants

For grants I build a query joining sysobjects and sysprotects getting user with 'exec' permission on function.

All managed inside a shell script.

Working with ASE 15.0.3