Home » SQL & PL/SQL » SQL & PL/SQL » Is this a valid package name &&subvar1..emp_demo_pkg
Is this a valid package name &&subvar1..emp_demo_pkg [message #238664] Fri, 18 May 2007 20:58 Go to next message
dpriver
Messages: 3
Registered: May 2007
Junior Member
CREATE OR REPLACE PACKAGE &&subvar1..emp_demo_pkg
AS
...

I know &&subvar1 is a substitution variable, but what does
double dot (..) means, is there any docuement to explain this?
Re: Is this a valid package name &&subvar1..emp_demo_pkg [message #238665 is a reply to message #238664] Fri, 18 May 2007 21:42 Go to previous messageGo to next message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
I suspect the goal is to end up with something like the following

CREATE OR REPLACE PACKAGE schema_name.emp_demo_pkg
AS

Please feel free to actually run your own tests & observe what happens.
It is OK to learn on your own without depending upon others to spoonfeed you answers
Re: Is this a valid package name &&subvar1..emp_demo_pkg [message #238666 is a reply to message #238664] Fri, 18 May 2007 22:03 Go to previous messageGo to next message
dpriver
Messages: 3
Registered: May 2007
Junior Member
Thanks for your answer.
I not just want the job done, but also like to know
why use &&subvar1..emp_demo_pkg to generate schema_name.emp_demo_pkg

but not use &&subvar1.emp_demo_pkg instead

the key here is why use .. but not .

In SQL Server, this qualified name is valid,
database..object

So what does .. means in a qualified name of oracle

Re: Is this a valid package name &&subvar1..emp_demo_pkg [message #238667 is a reply to message #238664] Fri, 18 May 2007 22:13 Go to previous messageGo to next message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
What did you learn when you tried the variations yourself?
Use CUT & PASTE to post the results back here to share what you learned.
Re: Is this a valid package name &&subvar1..emp_demo_pkg [message #238706 is a reply to message #238666] Sat, 19 May 2007 08:49 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What you actually see is not a double dot, it is a substitution variable, which optionally is terminated with a dot, followed by a dot.
The second dot separates the schema_name (as provided through the substitution "&&subvar1.") from the actual package name.
Re: Is this a valid package name &&subvar1..emp_demo_pkg [message #238711 is a reply to message #238664] Sat, 19 May 2007 09:28 Go to previous message
dpriver
Messages: 3
Registered: May 2007
Junior Member
Thanks, you are right. I also find the answer from Oracle SQL*PLUS reference.
"if you wish to append characters immediately after a substitution variable, use a period to separate the variable from the character."

Previous Topic: PRAGMA INTERFACE
Next Topic: SQL Server to Oracle data migration
Goto Forum:
  


Current Time: Mon Dec 05 21:02:55 CST 2016

Total time taken to generate the page: 0.07070 seconds