Getting a Unix environment variable

Hi, everyone.
I need to use a Unix enviroment variable from a form. This form
is gonna use this variable in order to be the path of another
form who is gonna be called.
In other words:
CALL_FORM( $unix_var + '/forms/myform_name' );
unix_var is what I want to get.
Thanks a lot in advance,
Eduardo

It worked, Michael. Thanks a lot!
To the documentation guys at Oracle... This is how you define
the TOOL_ENV package in the Forms' help:
"The TOOL_ENV package allows you to interact with Oracle
environment variables by retrieving their values for use in
subprograms."
Suggestion: ...with Oracle environment variables AND OTHER
SYSTEM OPERATION ENVIRONMENT VARIABLES...
because this narrow definition can prevent people for trying to
use it to retrieve other NON-ORACLE environment variable via
this package. Thanks.

Similar Messages

  • Java and UNIX environment variables

    Hi folks,
    am I right when I say that it is not possible to access UNIX environment variables from Java (these ones delared by the export statement)?
    Cheers,
    Heiko

    Yes.. Since some OS do not have the  concept of environment variables,it is directly not possible.
    But using the method System.getProperties you can get
    some inf about the environment.
    the following links may be of some help to you
    http://www.javaworld.com/javaworld/javaqa/2001-07/01-qa-0706-env.html
    http://www.jguru.com/faq/view.jsp?EID=11422

  • OMB PLUS - Problem passing Unix environment variables to OMBPlus

    Due to a requirement to encapsulate deployment of OWB applications, we currently start OMBPlus.sh from our own wrapper ksh script (deploy.ksh) in order to get the new / changed application into the target control center etc.
    We now have a new requirement that means we need to pass the content of the Unix environment across to OMBPlus.sh (and from thence into our deployment tcl scripts).
    No problem, if you believe the tcl documentation. The entire Unix environement gets dumped into a hash array called 'env', so you can get the variable's value out just by saying $env(unix_valraible).
    Sounds great, it should work a treat.
    Except OMBPlus only silghtly resembles tclsh.
    The 'env' that gets into OMBPlus bears practically no resemblance to the 'env' that existed before OMBPlus.sh got invoked.
    Does anyone have:
    a decent explanation for why the env gets scrambled (and how to avoid it) ?
    or an alternative method of getting the Unix environment varaible values into OMBPlus ?
    Please do not propose passing them all on the command line because (would you beleive it) the values are database passwords !
    Edited by: user10466244 on 23.10.2008 09:28

    Unfortunately, the java implementation of TCL that Oracle used as the basis for OMB+ is NOT a fully-featured implementation. Just try using packages...
    However, and understanding why you don't want to hard-code passwords into a file, you can always edit the setowbenv.sh file in your owb/bin/unix directory to grab your specific shell environment variables and propogate them to the java session.
    towards the bottom of this env file you will see a section that looks something like:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    You could add in the environment variables that you want propogated, include them into the CLASSPATH_LAUNCHER, and then they will turn up in your OMB+ session env array.
    e.g., to propgate an environment variable called MY_DATABASE_PASSWORD you would:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DMY_DATABASE_PASSWORD=${MY_DATABASE_PASSWORD} -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    So now you have no protected data hardcoded, it will pick up your specific environment variables at runtime, and when you start OMB+ you will be able to:
    array get env MY_DATABASE_PASSWORD.
    cheers,
    Mike

  • How do I use a UNIX environment variable for the path of a file name

    We are running Forms 6i over the web. The forms server runs on a UNIX (HP-UX) machine.
    I want to read the contents of a file, which is simple enough, using the TEXT_IO package. However, I want to reference a UNIX environment variable that specifies the file path i.e
    PROCEDURE get_file IS
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    filename VARCHAR2(200);
    BEGIN
    filename:= '$LOG_DIR/RCAS181.log';
    in_file := Text_IO.Fopen(filename, 'r');
    .....other stuff
    Notice the filename string references my unix env variable '$LOG_DIR'. However, this doesnt work. If I put the full pathname it works fine.
    Any suggestions ?

    Have a look at TOOL_ENV.GETVAR()

  • Fetching UNIX environment variables

    Does anyone know of a way to fetch a UNIX environment variable into a PL/SQL variable?
    Thanks
    Kerri

    Hi Dave
    If you are just running through the conc manager as a regular report you can not do this. At the CM layer publisher is not aware of nor can it be passed environment variables.
    If you are on 11.5 why not store the sub template in the template manager and then use our URI to reference it:
    xdo://APPCODE.TEMPLCODE.LANG.TERR
    Check the user guide.
    Regards
    Tim

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • XSL variable and unix environment variable

    Any idea how I can pass the unix environment variable to the custom XSL file? I want to be able to pass the $PO_TOP path so the file location can be derived
    The below code works fine for static file location but I want it to be more generic.
    <fo:block xsl:use-attribute-sets="termcond">
    <xsl:if test="($print_draft = '')">
         <xsl:value-of select="unparsed-text('/usr/tmp/tc.txt','UTF-8')"/>
    </xsl:if>
    </fo:block>
    <fo:block id="last-page"/>
    Thanks in advance

    you'll need to use the name(.) XPath function to test the name of the current node.

  • Unix Environment variable for connect string in SQL*Plus

    I am using some environment variables to connect to a sql*plus session in unix.
    they are exported as part of a file which contains the following and gets executed through the .profile.
    export db_username=xxx
    export db_password=xxx
    export db_name=xxx
    i have created a file abc.sql which contains the following
    connect $db_username/$db_password@$db_name
    Now, I have a shell script which uses this file inside it to connect to a sql*plus session and execute some queries.
    The contents of the shell script :
    API_CONNECT_SQL=abc.sql
    sqlplus /nolog << THEEND
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set timing on
    @${API_CONNECT_SQL}
    ---- do something
    EXIT
    THEEND
    Now, the sql*plus session is able to get db_username and db_password, but not the db_name. It says "TNS service name not found".
    If I hardcode some database name in place of db_name, it connects properly.
    Please let me know the problem and solution as well.
    Any help appreciated.
    thanks,
    Vijay

    for me this one works
    # =========================================
    # begin of script
    # =========================================
    export db_username=alpha
    export db_password=bravo
    export db_name=charly
    echo "connect $db_username/$db_password@$db_name" > xxx.sql
    API_CONNECT_SQL=/cfs/dummy1/0/appl/dummy2/rev_04/zzz/tst/xxx.sql
    cat ${API_CONNECT_SQL}
    sqlplus /nolog << THEEND
    spool xxx
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set echo on
    host cat ${API_CONNECT_SQL}
    @${API_CONNECT_SQL}
    select * from dual;
    spool off
    EXIT
    THEEND
    # =========================================
    # end of script
    # =========================================

  • Servlets: how do I get client's environment variables

    Hi everybody
    I make various servlets, and like to get the client's environment variables (such as used by the SET command under Windows). Especially username which is set in Windows-NT.
    Are there any straight forward way to get these?
    .. or can I get them and return them via a javaScript?
    Arne

    The servlet runs on the server. The browser and JavaScript run on the client. If you wanted to use JavaScript to pass them back, you would have to pass them back to the server through another servlet.
    Or you could use an applet and get at the standard Java properties. Nobody should use environment variables anyway, as you can't guarantee a computer even has them. :-)

  • Changing UNIX environment variables?

    Is there an easy way to change the environment from inside Java-code?
    I have tried using the compile version and this works fine.
    Compile version:
    java -DmyVar="$PATH" myClass
    and then used System.setProperty("myVar", "/home/lala");
    The above works fine and changes the PATH variable in UNIX, but i don�t want to set these things at compiletime, is there another way?
    Thank you for any hints
    // adde

    I want to change the systems environment variable when I run my Java application, what happens when I close the program does not concern me. And I don�t just want to fetch what�s currently there, I want to change them and then use them in my program.
    But can you somehow do this without telling the program what variables you are interested in at compile time?
    Thank you for your answers

  • How do i get value of Environment variables from a java program?

    Hai,
    I have a setup file wherein i set the path for the root directory , in the following way.
    setenv TPEROOT "/home/systpe/khurram/changes"
    when i give echo $TPEROOT
    the path , home/systpe/khurram/changes , is displayed on the console
    If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
    I want to use the value of the environment variable in my program.
    Any help in this regard would be very useful
    Thanks
    khurram

    java -DTPEROOT=$TPEROOT my&#337;ackage.myclass myargs

  • Unix Environment Variables

    I use EBS 11.5 and I am trying to use XML Publisher with RTF files for PO printing. I have a main script loaded into Oracle as the template and it uses
    <?import:file///home/dave/scripts/test.rtf?> to pull in a subtemplate. I want to change this to reference an environment variable, like MY_HOME, instead of having the directory hardcoded into the import statement.
    Home do I do that?
    What is the syntax in the import statement?

    Hi Dave
    If you are just running through the conc manager as a regular report you can not do this. At the CM layer publisher is not aware of nor can it be passed environment variables.
    If you are on 11.5 why not store the sub template in the template manager and then use our URI to reference it:
    xdo://APPCODE.TEMPLCODE.LANG.TERR
    Check the user guide.
    Regards
    Tim

  • Unable to access value in System Environment Variable using Java

    I am using Java code to get the value of a System Environment Variable using the Runtime, Process java classes.
    The code works fine in tomcat, but when deployed in 9ias the code is unable to retrieve the value stored in the System environment variable in Windows 2000.

    Thanks for the comment steve, here is the code which i am using.
         public String getEnvironmentVariable()
                   // This will get the FEDREP_HOME environment variable
                   String FEDREP_HOME = null;
                   Process p = null;
                   Runtime rt = Runtime.getRuntime();
                        try {
                             // invokes a shell-command to retrieve FEDREP_HOME variable
                             String OS = System.getProperty("os.name").toLowerCase();
                                  // Get the Windows 95 environment variable
                                  if (OS.indexOf("windows 9") > -1)
                                            p = rt.exec( "command.com /c echo %FEDREP_HOME%" );
                                  // Get the Windows NT environment variable
                                  else if (OS.indexOf("nt") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the Windows 2000 environment variable
                                  else if (OS.indexOf("2000") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the Windows XP environment variable
                                  else if (OS.indexOf("xp") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("linux") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("unix") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("sunos") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  } else
                                            System.out.println("OS not known: " + OS);
                             // set up to read subprogram output
                             InputStream is = p.getInputStream();
                             InputStreamReader isr = new InputStreamReader(is);
                             BufferedReader br = new BufferedReader(isr);
                             // read output from subprogram
                             FEDREP_HOME = br.readLine();
                             br.close();
                        } catch(Exception ex)
                                  System.out.println("Error when getting FEDREP_HOME environment variable");
                                  ex.printStackTrace();
              return(FEDREP_HOME);

  • How could I get unix shell variable value?

    I want to get a unix shell variable value because I will use it in my java program. For example $HOME, I have wrote like below,
    Runtime runtime = Runtime.getRuntime();
    Process proc = runtime.exec("echo $HOME");
    But I could not get $HOME value, just get "$HOME" as result.
    Why could not I get the value?

    Other than passing them as params to your program, the only way to read them runtime is either pipe them thru a stream or use JNI.

  • Getting oracle environment variables using plsql code

    Hi Geeks,
    Can anyone tell me how to get an Oracle environment variable (eg db_cache_size) from inside a plsql block of code or through a sql query?
    Thanks,
    Prabhu

    Is it possible to update the values via SQL?That's indicated by:
    ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER SESSION (TRUE) or not (FALSE)
    ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER SYSTEM and when the change takes effect:
    See the docs:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176

Maybe you are looking for

  • Service Desk Expert Mode

    Hello, When I try to get into the expert mode in service mesage, Nothing happens I tried to check if there is a autorization issue but all permission are given to the message processor With some users I can access and with others I can only acces whe

  • HP OFFICEJET PRO 8610 SCANNER IS BUSY

    I recently set up a new system for a friend.  He is using the officejet pro 8610 with a new mac using osx 10.9. The printer is set up wirelessly.  Printing works but the scanner keeps giving an error that it is busy. From the printer I can attempt to

  • HT201250 Time Machine Problem - Unable to "Enter" Time Machine

    I can see the back ups occuring as usual, but when I go to "Enter Time Machine" absolutely nothing happens. I can see the back up drive mounted on my desktop. I can double click, look inside and see the backups in a File Menu Structure. I doubt I can

  • Disable Reconciliation event similar to deleteDetectedAccounts

    Hi, I would like to know whether there is any method or functionality we can use to create a reconciliation event of type "Disable". Currently we are using "deleteDetectedAccount" method in tcReconciliationOperationsIntf and it is deleting the accoun

  • What is the best way to archive your photos?

    My computer has gotten very slow, and I want to take my thousands of pictures off.  What is the best way to archive them?