Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling Packages with embedded globals

Status
Not open for further replies.

Roncayenne

Programmer
Sep 15, 2003
43
US
I am trying to compile a package that has globals in the packages as &case id, &begin date.
When I compile the package via SQL it stops me to enter the global. The package is not for one specific case id as above but for any case id I enter when I use the package. When I ran it, I just hit enter on all the globals and it said package created. When I try to run it, I get 'search error'. I then tried using TOAD to compile and it did not stop me on the globals and created the package. When I ran it again I got the same 'search error'.
If there another way to compile a package that has globals?
Thanks in advance for the help!
Ron
 
Ron -


The short answer is
SQL> SET DEFINE OFF
and then run in your source again

'&' is the default SQL*Plus substitution character, so if you use it in the source for PL/SQL packages then SQL*Plus will prompt for a value to use. SET DEFINE OFF will tell

The reason you're gettig errors is because SQL*Plus will have removed all the words in your package which start with '&'. Have a look at the source in the database using the USER_SOURCE view and compare it to your original source.

However, I'm not entirely clear what you mean by 'globals'.
Can you give us an example of how you are trying to use the '&' character with 'globals' ? ie in what context is your code using '&case id' ?

Steve
 
Steve, I set define off and the package compiled clean. I think that was it. The package is being used were variables are entered on the screen and passed to the package. It looks like after I set the define off and got a compile, I was able to run the program ok.

Thanks a million for the come back on this. I just could not figure out how to get around it. That did it!

Have a good Thanksgiving!! :)

Ron
 
Glad to hear it's worked.

Not sure what happened to the end of the 2nd sentence in my 1st post, but I must have said enough to get you on your way !

I should also have said to use SET DEFINE ON after the compile, but I guess you worked that out.

Enjoy the holiday.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top