We are working on extracting database DDL of Sybase ASE 15.5 version. We have one sample created in java that execute ddl commands. We got ddl using ddlgen utility provided by Sybase with commands :
java -cp "mypath/lib/jconn4.jar;mypath/lib/dsparser.jar;mypath/lib/DDLGen.jar" com.sybase.ddlgen.DDLGenerator -Usa -Pmypassword -S192.123.13.111:5000 -Dmaster
Above command generate DDL for all database objects exist in user sa
, also we get list of objects shared to other user by user sa
as :
Grant Select on dbo.mytable1 to anotheruserthansa
go
Grant Select on dbo.mytable2 to anotheruserthansa
go
Now we want DDL of shared objects by username, like in my case user is anotheruserthansa
We need some command that can generate DDL for user, we might not have its password. What we need to get DDL using my user sa, its password and with schema name : anotheruserthansa
we need to generate ddl for all the database object those are shared by user sa
to anotheruserthansa
.
Like we do in Oracle with query :
select object_type from dba_objects where owner = ''anotheruserthansa' and object_name = 'anotheruserthansa'
How can we get DDL for shared object using its schema?