cancel
Showing results for 
Search instead for 
Did you mean: 

Create table with alias dba

Former Member
0 Kudos

We can create table with another user

for example:

login in sap iq with user jose we can create:

CREATE TABLE "cesar"."tabla" (

        "id" BIGINT NOT NULL,

    PRIMARY KEY ( "id" ASC )

) IN "iq_main";

Is this possible?


Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

markmumy
Advisor
Advisor
0 Kudos

In IQ 16, you can do this with privileges.

Add the user 'jose'

Grant the privilege CREATE ANY TABLE to 'jose'

> isql -S localhost:2638 -Udba -Psql

1> grant connect to jose identified by password

2> go

1> grant connect to cesar identified by password

2> go

1> grant create any table to jose

2> go

1> quit

> isql -Slocalhost:2638 -Ujose -Ppassword

1> create table cesar.test_table ( a1 int )

2> go

Of course, 'jose' won't be able to drop the table:

1> drop table cesar.test_table

2> go

Msg 262, Level 16, State 0:

SQL Anywhere Error -121: Permission denied: you do not have permission to use the "DROP TABLE" statement

To do that you need to grant the DROP ANY TABLE privilege.

To see a full list of privileges, look here:

SyBooks Online

Mark

Former Member
0 Kudos

Hi Mark

we have IQ v15.4

thanks for the info

Cesar F.

markmumy
Advisor
Advisor
0 Kudos

OK. With that version you can certainly do it with DBA role. Check on the resource role too.

Former Member
0 Kudos

Thanks Mark, by security policies, the user must not have role dba

0 Kudos

Sir, can we restrict create table by user jose only for user cesar?

Answers (1)

Answers (1)

markmumy
Advisor
Advisor
0 Kudos

No, you can either create tables or not. We cannot restrict it to just the ability to create a table for a single user. Jose can create tables, that we allow. We have no way to say that Jose can only create tables for Cesar.