Sybase SQL Anywhere and Schemata

14 views
Skip to first unread message

Lukas Eder

unread,
Feb 3, 2012, 8:19:25 AM2/3/12
to Espen Strømsnes, jooq-de...@googlegroups.com
Hello Espen,

I am currently adding support in the jOOQ code generator for
multi-schema environments. Many databases allow for using schemata /
schemas as namespaces for tables, types, routines, etc. In standard
SQL, a schema is an independent entity, whereas in databases such as
Oracle, the schema and its owner (user) are closely coupled.

Do you know how this works in Sybase (both ASE and especially SQL
Anywhere)? I know ASE uses the term "owner" and SQL Anywhere uses the
term "creator" (e.g. SYS.SYSTABLE.CREATOR) for tables, routines, etc.
Is that something like the Schema? Have you encountered such
multi-schema databases in Sybase?

Cheers
Lukas

Espen Strømsnes

unread,
Feb 3, 2012, 9:04:27 AM2/3/12
to Lukas Eder, jooq-de...@googlegroups.com
Greetings!

I don't have much experience with ASE.

I think the term "creator" in SQL Anywhere is like Schema.

I have successfully executed the following statements in a SQL Anywhere database:

create user espen;
create user lukas;

create table espen.tt_1 (id integer);
create table lukas.tt_1 (id integer);

insert into espen.tt_1 values (1);
insert into lukas.tt_1 values (1);

create function espen.proc1 ()
returns INTEGER
deterministic
begin
 return 1+1;
end;

create function lukas.proc1 ()
returns INTEGER
deterministic
begin
 return 1+2;
end;

select espen.proc1(), lukas.proc1() from espen.tt_1;



Espen

Lukas Eder

unread,
Feb 3, 2012, 9:20:49 AM2/3/12
to Espen Strømsnes, jooq-de...@googlegroups.com
Very nice, thanks Espen!

That's what I thought. I guess I can look up the "owner" or "creator"
in the SYS.SYSUSERPERM table as documented here:
http://infocenter.sybase.com/archive/index.jsp?topic=/com.sybase.infocenter.dc38151.1260/html/iqref/iqref750.htm

ASE is a bit weird. Maybe I won't support multi-owner environments in
ASE right away.

Cheers
Lukas

2012/2/3 Espen Strømsnes <estro...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages