Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9279971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:45:32+00:00 2026-06-18T17:45:32+00:00

I have a public synonym on my server for transactions: However I’d like to

  • 0

I have a public synonym on my server for transactions: However I’d like to be able to work with my own local version of the table, so as not to disturb other users.

Does Oracle’s SQL resolve naming conflicts like this in a predictable fashion?

In other words, if another user creates a public synonym called TRANSACTION and I do this:

CREATE TABLE TRANSACTION (

ID NUMBER

);

When I write

select * from TRANSACTION

Do I have any guarantee that Oracle will always resolve the synonym or my local table?

(I know I could technically specify schema.TRANSACTION to force the issue, but in my case that would require me to modify/rebuild an application and I’m hoping to save some work.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:45:33+00:00Added an answer on June 18, 2026 at 5:45 pm

    Your understanding of name resolution is correct. Oracle will first look in the current schema to find an object with that name. So, In case of a conflict, It will choose an object in the current schema instead of the object referred to by the public synonym.

    http://docs.oracle.com/cd/B28359_01/server.111/b28310/general008.htm

    Oracle Database attempts to qualify the first piece of the name
    referenced in the SQL statement. For example, in scott.emp, scott is
    the first piece. If there is only one piece, the one piece is
    considered the first piece.

    In the current schema, the database searches for an object whose name
    matches the first piece of the object name. If it does not find such
    an object, it continues with step b.

    The database searches for a public synonym that matches the first
    piece of the name. If it does not find one, it continues with step c.

    The database searches for a schema whose name matches the first piece
    of the object name. If it finds one, it returns to step b, now using
    the second piece of the name as the object to find in the qualified
    schema. If the second piece does not correspond to an object in the
    previously qualified schema or there is not a second piece, the
    database returns an error.

    If no schema is found in step c, the object cannot be qualified and
    the database returns an error.

    Having said that, this is one of the problems with public synonyms. Having objects like this will lead to confusion down the road, both for development and support. You are better off referencing the object by owner and name in both cases

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created public synonym as suggested in my other question about creating view
I have public class Entity On which works class: public class Table<Target extends Entity>
I have public functions like this: public static T Get<T>(this Mango m, T defaultValue
I have: public static int[] ArrayWorkings() I can call it happily with MyClass.ArrayWorkings() from
I have public site with some forms. Simple question: What kind of informations should
I have public and private keys in separate .pem files that I would need
I have public static class A { public static string ConnString; } [Serializable] public
In java I have: public class MyClass{ public enum STATUS { ZERO, ONE ,
In Form1.cs i have public const int n = 30; public TabPage[] tp =
Suppose I have: public class foobar { public int lorem; public int ipsum; }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.