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()

Similar Messages

  • ODI - to declare the variable for the path in Modules & Interface

    Hi,
    I have different server names like Development, Test & Production. I have installed ODI client in my local machine.
    1. For creating *10 modules*, i have the flat files in Development server. For now i can hard code the path by \\Development\ODI_FileStore....
    2. In the Interface i am using the hard coded paths for the logs.
    Is there any possibility to create a variable for the shared folder and use that variable (like environment variables ...) instaed of using the hardcoded path. If so, can you explain tme how i can create.
    Your advise will help me a lot and will be appreciated.
    Thanks & Regards
    Dhamu

    Dhamu,
    I think when you say modules, you mean models.
    To use multiple files in the same interface, you can use ODI variables.
    Read this link for more information : http://odiexperts.com/multiple-files-single-interface

  • 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
    # =========================================

  • How can I use my Mac OS X for the next time

    Dear sir,
    Please, I need your help about Mac OS X and how can I use the OS for the next time I mean when I'm going to format my computer or to use for the another computer.
    By the way... I already installed the Mac OS X to my MacBook Pro so please I'm waiting for you advice.
    Mohammed Hussein

    Hi,
    He bought the iMac two years after mine.
    Would his Mac still be under warranty? It sounds like it is about only a year old and so may be still eligible for phone support, though that may depend on having nearby access to an Apple Tech support.
    He could get a replacement disk sent to him as well. The cost,  I don't know.
    Your disk would probably work, but you don't need to burn one; just use yours. If you are in two locations, then it would be better for Apple to mail him a replacement disk for his particular Mac.

  • How can I use an image as background for the entire page?

    With CSS mill, the solid color was defined in the color.X.property file and there is no place to define an image to use as the background? Is it doable to use an image as the background for teh entire page? If so, where to add it and how to implement? Thank you!
    Hao Pan ([email protected])

    While I have been able to add the image to a JLabel and insert it into frames, so that it looks like a suitable background, I have found it impossible to place any other component over the top of said imageDid you set a layout manager for the label?
    Check out the [Background Panel|http://www.camick.com/java/blog.html?name=background-panel] for two different solutions depending on your exact requirement.

  • How do I use one of my photos for the desktop background?

    I have a photo which I would like to have as my desktop background. How do I accomplish this?

    Hi leduckmrb,
    Are you talking about your computer desktop? If so, that isn't a Firefox thing at all. You'll have better luck looking at the [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/display_change_desktop_background.mspx?mfr=true Microsoft documentation].
    Hopefully this helps!

  • 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.

  • Change the environment variables for sid adm failed

    Hi Experts,
    I have installed ECC HA on AIX/ORACLE
    now i want to change the environment variables for the qr1adm user at the standby node
    i tried to change the /home/qr1adm/.profile with command
    vi  /home/qr1adm/.profile  it is changed  and i saved this changes.
    now I login with qr1adm user and i executed this command
    env |more
    it comes with the old values
    i don't know why?
    and if i oppened the .profile file i'm finding the new values
    So could you please tell me how can i change the environment variable for qr1adm user
    Thanks
    Sherif
    Edited by: Sherif Eid on Jan 23, 2008 9:08 AM

    Thanks Sridhar ,
    which hostname?
    for example i have
    .dbenv_R3QASsvc.csh
    .sapenv_KFGKWERPR303.csh
    i want to tell you that R3QASsvc is the virtual hostname
    and KFGKWERPR303 is the name of the primary node A
    and the phiscal host name of node B is KFGKWERPR307
    so which one should i change it?
    thanks
    Sherif
    Edited by: Sherif Eid on Jan 23, 2008 11:59 AM

  • Two selection option-variables for the same object

    Hi,
    I'm using two selection-option variables for the same characteristic in my query:
    One is authorization variable and the other is used for restrictions (filter) in a selection screen.
    I get an error: SELOPT/Query variable .... does not allow any further selections.
    If a selection option-variable is used, no additional selections can be specified for this characteristic in this element.
    Is there a way to overcome this problem?
    Thanks,
    Hagit

    Hi,
    I have solved the problem by changing the authorization object (in RSECADMIN) from range to single value and also the variable in BEx from selection single value.
    To be more clear:
    object in RSECADMIN was: infoobject BT var1 - var5
    I have changed it to:
    infoobject EQ var1
    infoobject EQ var2
    infoobject EQ var3
    infoobject EQ var4
    infoobject EQ var5
    Hope this helps.
    Hagit

  • 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>

  • How do I use a OS (Windows) Environment Variable in the source path of me ActionScript 3.0 settings

    I'm sure this can be done as I know we used something similiar at my old work place, below is an image showing what I am attempting to do.
    We used this to create more portable / shareable assets files which when symbols are linking to code, the code was very often in different directories on different machines.
    So we had set up environment variables in the OS to point to source directories and then used these variables in the source paths.
    As long as everyone had these variables set up then it would all work.
    Anyone know the correct way to do this in Flash CC
    Thanks in advance!
    Best Wishes
    Rhys Thomas

    sinious the problem with doing that is that the changed path gets into the code repository as well, so you wind up with everyone going back and forth changing it to their own value, which is a hassle. If you use relative paths and a standard project setup, then it all "just works" without a problem.
    For example, this is the setup I use:
    .dev
         .thisProject
              .Flash1
                   Flash1.as
                   .Flash1
                        Flash1.xfl
                   .view
                        .audioAssets
                        .customViews
              .SoundLib
                   SoundLib.xfl
              SoundLib.swc
         .bin <swfs are output here
              .xml
         .core
              .control
              .model
              .service
              .view
    We have a "base project" that you check out to start a new project (we do heaps of similar work), and the paths are already set up to be relative. Having each project point to its own copy of the core code allows for fine-grained control of which revision you're using--we've even pointed deliberately to old versions or branches on rare occasions.
    The bin folder is actually shared with the website repository, which is in a different directory from the Flash source code (in the website, it has a different name). This allows the generated swfs to be easily updated and ensures that the latest XML is being used both for development and on the site.
    The "thisProject" folder actually includes a Flash Builder workspace with all the standard shortcuts, etc., already set up. This is primarily because of how the "default path" works when you create a new Flash Pro project in FB. Because we output a level up from the workspace, we hack the .metadata folder every time, but that's a small change.

  • 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.

  • 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

  • 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 can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

Maybe you are looking for