Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

&& Substitution Variable in Package Body using SQL Developer

956107Aug 16 2012 — edited Aug 16 2012
Hi Folks,

I've moved over to working to in SQL Developer (its a very early version - 1.0.0) from a combination of SQL*Plus command line and a text editor. I'm trying to get this upgrgraded, but I think the question will be the same with a newer version anyway.

I am creating a package, and in the package body I have some &&my_var substitutions that I was previoulsy prompted for when calling the .sql from the command line SQL*Plus. I need this as the variable needs to be different for the development and live environment.

When working in SQL Developer, I can load the package body from Connection->Packages->My Package->My Package Body, and click the edit button to edit the code, however, when I click the Compile button in the top of the window my code error's because of the substituion variablle. An example is:

CREATE OR REPLACE
PACKAGE BODY MY_PACKAGE AS

PROCEDURE MY_PROCEDURE
BEGIN
my_variable := &&my_function_from_live_or_dev_database
END MY_PROCEDURE

Can anyone tell me if there is a way of defining a compiler variable within the IDE widow while editing a package body stored in the database, without manually copying the code into the Worksheet and running it as a script?

Thanks,

AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2012
Added on Aug 16 2012
4 comments
1,354 views