Both of these work in my app:
INSERT INTO PLATYPUS (Bla, Blee, Bloo, Blah) VALUES (:Bla, :Blee, :Bloo, :Blah)
INSERT INTO CRITTERS.PLATYPUS (Bla, Blee, Bloo, Blah) VALUES (:Bla, :Blee, :Bloo, :Blah)
…Is one way preferred over the other?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
After working on a number of systems that have used both implicit and explicit (I call them “hardcoded”) schema references, I’ve found that in all cases, hardcoding the schema name in application code makes life more difficult.
This is why Oracle has synonyms.
The only time I hardcode schema names is in deployment scripts, e.g. when creating an object I want to explicitly state which schema the object should be created in.
It means that when the developers ask, “can we have a copy of our dev database in the same instance?”, I can say, “no problem – give me a few minutes”. I create a new schema, copy the tables etc. into it, then update their login user’s synonyms to point to the new schema. Voila, two databases on one instance. However, if I let them hardcode a schema name in the application code, this becomes impossible because synonym translation doesn’t get done.