on 2011 Apr 17 5:36 PM
hello,
I am using eclipse on mandriva and SQL Anywhere 12. when I create the tables via JPA (part of JEE5), the Java Persistence API, the tables are created, what is good, but with the format : <user_name>.<table_name>, e.g. "olivier_dba.t_item", but I would like to have "t_item". I saw the logs, and the SQL orders don't mention the user_name : the error seems to come from SQL Anywhere. and it is not a whim from me, but I can't go ahead in my project since there are errors in the java files (because the entities are not found in the DB).
can you help me?
olivier
EDIT - some news : finally I think that the user is not added to the table, but the eclipse plugin (SQL explorer) add the name of the user at the beginning of the name of the table. in sybase central I found that the names of the tables are good.
the error in eclipse is : "schema 'dbo' cannot be resolved for table <the_table>.
any suggestion?
If you do not specify a table owner when creating a table (e.g., "CREATE TABLE t_item( ..."), the default behavior is to assign the table to the creating user.
If you want the table to be owned by another user (i.e., in another namespace), you simply need to explicitly include the desired "creator" in the CREATE TABLE command -- for example "CREATE TABLE dbo.t_item( ..." will create a table named t_item within the dbo schema.
Just as an aside, this is a very clear difference between That Other Transact-SQL server and Sybase's product. Microsoft SQL databases default to creating tables in the dbo schema when no table owner is specified, while SQL Anywhere uses the (more rational, IMNSHO) convention of assigning ownership to the user who actually created it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should be added that DBA authority is required to create database objects for different owners.
Users with RESOURCE authority (but not DBA authority) can only create database objects in their own schema.
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.