-1

I am trying to create a application that will export ddl for the given schema.

I created sample in java using ddlgen command. In which, I can get ddl for all objects for the schema of logged. Command is:

java -cp "C:/Users/admin/Desktop/lib/jconn4.jar;C:/Users/admin/Desktop/lib/dsparser.jar;C:/Users/admin/Desktop/lib/DDLGen.jar" com.sybase.ddlgen.DDLGenerator -Usybase1 -Psybase1 -Sserver-name  -Ddatbase1  -Ooutput.sql

In the above command I need do give for UserName and Password.

Now I have second another user sybase2, who is a grantee and sybase1 user grants access of all objects to sybase2 user. Here I want get ddl of sybase1 user from the sybase2 user's account.

Same thing I have done in oracle where we have two users user1 and user2 . The user1 grant all permission to access all objects to user2. I can successfully getList of all granted objects.

Query:-

select object_name from dba_objects where owner = 'user1';  

and after that using get_ddl functions, I am getting ddl of all objects.

The above method of ddlgen, I did not find a way to pass schema name, for which I want to get ddl.

Is ddlgen does not support this ? If not then please suggest us other way to get ddl for the given schema.

We also do not found 'How to create new schema except 'dbo' ?'

Tej Kiran
  • 2,218
  • 5
  • 21
  • 42
santosh
  • 435
  • 1
  • 7
  • 24

1 Answers1

0

SAP/Sybase ASE does not use the Oracle/Microsoft implementation of schemas.

You can find the owners of database objects by joining sysobjects and sysusers

SELECT db_name()
     , su.name
     , so.type
     , so.name
 FROM sysusers su, sysobjects so
WHERE su.uid = so.uid
 AND su.name = "[name of user you are looking for]"
Mike Gardner
  • 6,611
  • 5
  • 24
  • 34