Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

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

accept rate: 0%

edited 15 Mar '13, 21:04

Mark%20Culp's gravatar image

Mark Culp

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

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 06 Dec '12, 08:30

question was seen: 9,057 times

last updated: 15 Mar '13, 21:04