Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > Does Sybase ASE have table alias?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-07, 02:58
Lapson Lapson is offline
Registered User
 
Join Date: May 2003
Location: Hong Kong
Posts: 21
How to query table w/o specifying the table owner?

I am using Sybase ASE 12.5. I have a database owned by a certain user account, say owner1. So, when other user accounts query those tables, I have to specify the schema name, like "owner1.table1".

Can I create alias for those tables, so that I don't have to specify the schema name? I searched on Internet with keywords "sybase", "alias", "synonym" but found nothing.

Or else, can I set other users to use "owner1" as their default schema? I also searched this but again couldn't find anything.....

Last edited by Lapson : 12-07-07 at 05:40. Reason: change title
Reply With Quote
  #2 (permalink)  
Old 12-07-07, 05:48
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
Quote:
Originally Posted by Lapson
can I set other users to use "owner1" as their default schema?
exec sp_addalias otheruser, owner1
But this will also allow otheruser to modify owner1.table1
Reply With Quote
  #3 (permalink)  
Old 12-07-07, 06:06
Lapson Lapson is offline
Registered User
 
Join Date: May 2003
Location: Hong Kong
Posts: 21
Quote:
Originally Posted by pdreyer
exec sp_addalias otheruser, owner1
But this will also allow otheruser to modify owner1.table1

Yes, that's the problem. I want other users to be "read-only".
Reply With Quote
  #4 (permalink)  
Old 12-08-07, 13:56
bonson bonson is offline
Registered User
 
Join Date: Jul 2006
Posts: 13
Is it a must to specify schema name? In my case, I also have some databases owned by other account, and the read-only accounts can query the tables in the database without specifying the schema name.

From my understanding, the full syntax to access a table is <database>.<owner>.<table>. But if you specify the table name only, it equal to <current_database>.dbo.<table>.
Reply With Quote
  #5 (permalink)  
Old 12-08-07, 17:07
Lapson Lapson is offline
Registered User
 
Join Date: May 2003
Location: Hong Kong
Posts: 21
Quote:
Originally Posted by bonson
Is it a must to specify schema name? In my case, I also have some databases owned by other account, and the read-only accounts can query the tables in the database without specifying the schema name.

From my understanding, the full syntax to access a table is <database>.<owner>.<table>. But if you specify the table name only, it equal to <current_database>.dbo.<table>.

Yes, if table owner is dbo, then it's ok to omit the owner name.

But my tables are not owned by dbo, they are owned by owner1. So when other users try to query, the owner name must be specified, like "owner1.table1".
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On