‎2007 May 23 8:58 AM
Hi,
I havw one doubt about views,synonyms.
1.what is synonym?
2.for checking whether database view exists or not one function module is there
that is "db_exists_view."
but for checking synonym is there any other function module is there?
Thanks in advance
‎2007 May 23 9:04 AM
Hi,
1.A synonym is another name for a table.
Every synonym has a name that is unique within the entire database system and differs from all the other table names.
2.The Function Module For Checking whether the Synonym(Table) is exist or not is <b>DB_EXISTS_TABLE</b>.
Regards,
Padmam.
null
‎2007 May 23 9:06 AM
Hi,
synonym is an alias for tables/views/program unit.
check this link
http://sapdb.org/7.4/htmhelp/48/8af5a1a54f11d2a97100a0c9449261/content.htm
rgds,
bharat.
‎2007 May 23 9:08 AM
Hi kan,
A synonym is a DB object which can reference to a table, view, package..., regardless whether it belongs to the same schema or to a different one, and regardless whether it belongs to the same database or not.
For example, suppose you are working in SAP R/3 with Oracle. Then the main schema may have the name "SAPR3". Well, it may not be a nice procedure, but you may have more schemas into the same SAP R/3 machine (for test purposes, for example). Let's suppose there is another schema, say TESTSAP, with DB tables that are NOT created via SAP R/3. Well, you can create a public synonym, so that these tables are accesible from the whole machine. For example:
CREATE PUBLIC SYNONYM my_remote_table
FOR testsap.my_table
So every time you access "my_remote_table" (for instance, in a SELECT statement), it will automatically be redirected to the table "my_table" in schema "TESTSAP".
Another utility is to link several databases in several machines. This can be achieved via <b>db-links</b>. You may also create synonyms for that:
CREATE PUBLIC SYNONYM my_remote_table
FOR admin_1.salaries@another_db
So every time you access "my_remote_table", it will be redirected to the table "salaries" of schema "admin_1" into database "another_db", which can be another database different fom SAP.
I hope it helps. Best regards,
Alvaro