I've inherited a SQLAnywhere database that somebody else created. I'm more used to MySQL. I'm able to connect and query both databases.

Example of a working query for the MySQL database:

{
  $query = DB::query('SELECT * FROM `Users`');
}

Example of a working query for the SQLAnywhere database:

{
  $query = DB::query('SELECT * FROM "EM"."Users"');
}

My question is about what the 'EM.' prefix is:

  • is this a table prefix?
  • is it required?
  • can the separator (period) be changed to another symbol?
  • where in Sybase Central can the prefix name be edited?
  • if it's not required, how can I remove it?
  • if it is required, how do I manage my code to keep the SQL statements portable?

asked 06 Dec '12, 08:30

MMacdonald's gravatar image

MMacdonald
1766617
accept rate: 0%

edited 15 Mar '13, 21:04

Mark%20Culp's gravatar image

Mark Culp
23.2k9132272


The EM is the name of the table owner, if your user is not EM or in the group of EM you need the right to access the table and also need to address the table with the owner. From the docs:

"Tables owned by a different user can be qualified by specifying the user ID. Tables owned by groups to which the current user belongs are found by default without specifying the user ID."

permanent link

answered 06 Dec '12, 09:06

Martin's gravatar image

Martin
8.6k116151237
accept rate: 14%

Thanks. This helped me establish that if I log in as the user 'EM' I can now run the query like this:

{
  $query = DB::query('SELECT * FROM "Users"');
}

Which is what I wanted.

(06 Dec '12, 09:24) MMacdonald
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×90
×32
×27
×15

question asked: 06 Dec '12, 08:30

question was seen: 1,824 times

last updated: 15 Mar '13, 21:04