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 8417401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:02:09+00:00 2026-06-10T02:02:09+00:00

I have a package with two variables that has constant values like below. person_name

  • 0

I have a package with two variables that has constant values like below.

person_name              CONSTANT VARCHAR2 (15)           := 'Adam';
person_city              CONSTANT VARCHAR2 (15)           := 'Houston';

This package variables are used across my database in stored procedures, other packages etc.

Now i want these variables to have values based on the client server who is calling. And i have all these maintained in a table like below

Server      Parameter       Value
Server1     person_name     Adam
Server1     person_city     Houston
Server2     person_name     Victor
Server2     person_city     Dallas

So when the package/SP is referenced/called from server1, i want my person_name and person_city to be defaulted to Adam and Houston.
Similarly when the package/SP is referenced/called from server2, i want my person_name and person_city to be Victor and Dallas.

How can this be done? Is there anyway in oracle side, the client who is calling a particular SP or using a package variable? I wrote a function to get the value like below.

in package, 
person_name     CONSTANT VARCHAR2 (15)      :=GETPARAMVALUE(person_name);
person_city     CONSTANT VARCHAR2 (15)      :=GETPARAMVALUE(person_city);

and in the function, i will query the table

select * from parameterstable where parameter = (function's input) and servername = ???? 

How will i know the servername here?

Any help/tips will be appreciated. Thanks

  • 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-10T02:02:11+00:00Added an answer on June 10, 2026 at 2:02 am

    Assuming that server1 and server2 are the client machines that are connecting to your server,

    SYS_CONTEXT( 'USERENV', 'HOST' )
    

    should return the name of the client machine. You can use that in your GetParamValue function to determine which row in the configuration table to read.

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

Sidebar

Related Questions

I'd like to be able to have two protected classes in my package. That
Within an SSIS package I have a dataflow that extracts two coloumns from an
I have two SSIS Solutions SolutionA Contains one utilities package that handles all emails
i have two variables in a SSIS package Var1 and Var2. Both of these
I have an SSIS Package with two steps: 1) FTP in to a server
I have these two modules : package G1; sub new { my $class =
I have two java classes as follows App1 without a package: class App1 {
I have two classes. package utilities; public class PostCaller { public String getUrl() {
I have two projects with similar starting splash and menu activities, but the package
In Eclipse I have two projects with the same package structure. In one of

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.