Passing variable from sql to shell script

Usually we can pass arguments from shell script to the sql that us called inside the shell script. But I also want to do the reverse. I have the location of my backup path in a table. I want to run the rman script (shell), read this parameter from the table and use this to construct the "format" path in rman. Anyone has any ideas about this. Thanks.

To achieve getting the modified value from the table everytime the job runs, I encapsulated this in another job.
BEGIN
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME           => 'TEST_LOGS_MAIN',
JOB_TYPE             => 'PLSQL_BLOCK',
JOB_ACTION          => 'declare
v_aname varchar2(32);
begin
select aname into v_aname from attr where attrid = 3;
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME        => ''TEST_LOGS'',
JOB_TYPE        => ''EXECUTABLE'',
JOB_ACTION      => ''/opt/sql/testy.sh'',
number_of_arguments => 1,
COMMENTS        => ''TEST'');
dbms_scheduler.set_job_argument_value(''TEST_LOGS'',1,v_aname);
dbms_scheduler.enable(''TEST_LOGS'');
end;',
REPEAT_INTERVAL => 'FREQ=MINUTELY',
ENABLED           => TRUE);
END;
/

Similar Messages

  • Pass variable from apex to shell script

    Hi,
    i am able to use apex button to run a db scheduler job and use the the job to run an OS bash script, but don't know how to pass an variable to the script from apex.

    Hi,
    Thansk for the reply.
    My scenario is
    1. Apex page 1: Store List Report, click the store you want to process, the selected store id and store name will be passed to apex page 2 automatically.
    2. Apex page 2: Show the store ID and Store Name, once confirm click a button on the screen. I already created dynamic action of the button to run a bash script in OS via dbms_scheduler.
    My issue is i don't know how to get the store id and pass it to the bash script through dbms_scheduler.
    Regards
    Lion

  • Passing paramter from ANT to shell script doesn't seems to work for me;Help

    Hi,
    what iam "trying" to do is to pass some variables from my ANT script to a shell script. This is what iam doing with my 3 files. Iam getting errors when iam doing this.
    1) build.xml file:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project name="dev" default="all" basedir=".">
        <!-- (2) Create the class path -->
        <path id="common.class.path">
            <pathelement
    location="/opt/bea/weblogic81/server/lib/weblogic.jar"/>
        </path>
        <!-- create a reference for the class path utilized -->
        <property file="./myAnt.properties"/>
        <property name="common.class.path" refid="common.class.path" />
        <property name="Deploy.scripts.folder" value=
    "/opt/bea/weblogic81/server/bin/applicat
    ions" />
        <property name="1" value="${ANTPATCH}" />
        <property name="2" value="${WEBLOGICJAR}" />
        <property name="3" value="${ADMINPORTNUMBER}" />
        <property name="4" value="${HOSTNAME}" />
        <target name="xyz">
            <echo message="***********deployment**********"/>
            <property name="general.deployment.script.name"
    value="${general.script}" />
        </target>
        <target name="sangitatest">
            <echo message="This is the TESTNET box"/>
            <exec dir="${Deploy.scripts.folder}"
    executable="${Deploy.scripts.folder}/${genera
    l.deployment.script.name}" />
            <arg line="${1}"/>
            <arg line="${2}"/>
            <arg line="${3}"/>
            <arg line="${4}"/>
        </target>
        <target name="all" depends="xyz,sangitatest" />
    </project>---------------------------------------
    2) myAnt.properties file:
    general.script=deployScript.sh
    ANTPATCH=/opt/bea/wlserver6.1/lib/latest_deploy.jar
    WEBLOGICJAR=/opt/bea/wlserver6.1/lib/weblogic.jar
    ADMINPORT-NUMBER1=7001
    HOSTNAME=reliant2-----------------------------------------
    3) deployScript.sh file:
    export ANTPATCH=$1
    export WEBLOGICJAR=$2
    export ADMINPORTNUMBER=$3
    export HOSTNAME=$4
    java -cp "$ANT-PATCH":"$WEBLOGIC-JAR" weblogic.deploy -port
    "$ADMIN-PORT-NUMBER" -host "$HOSTNAME" -component testMon:beamon_biko_s1 deploy
    weblogic testMon /export/home/san5sxs/applications/beamon/myfile.war-------------------
    and the Exception is:
    [echo] This is the TESTNET box
    [exec] /opt/bea/weblogic81/server/bin/applications/deployScript.sh: ANTPATCH=: is not an identifier
    [exec] Result: 1
    BUILD FAILED
    file:/opt/bea/weblogic81/server/bin/build.xml:30: Could not create task or type of type: arg.
    Ant could not find the task or a class this task relies upon.
    any help in this matter ??
    regards,
    sangita

    Have you looked at [url http://ant.apache.org/]ant's website
    That's apache's ant. I'm not sure if there are others or not.
    if so, here is the mailing list [url http://ant.apache.org/mail.html]info

  • Passing variables from DM to logic script problem (REPLACEPARAM)

    Dear All,
    I would like to send variables from data manager to a logic script. The script copies values from an account to an other. If I hardcode two accounts in the script, it works fine, but I want to pass these two accounts dynamically from data manager to the script.
    My advanced script in DM looks as follows:
    PROMPT(SELECTINPUT,%ENTITY_M%,,"Select entity:","ENTITY_DIM")
    PROMPT(SELECTINPUT,%SOURCE%,,"Select source account:","ACCOUNT_DIM")
    PROMPT(SELECTINPUT,%TARGET%,,"Select target account:","ACCOUNT_DIM")
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%ENTITY_M%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF)
    TASK(PROCESS_CHAIN_RUNL,MEMBERSELECTION,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    In the logic script, I'm using $SOURCE$ and $TARGET$ as variables, but it seems that only the first of them gets the value from DM, the other one not, and I always get an error message:
        Member "$TARGET$" not exist
    The second variable doesn't seem to get the value. If I use only one variable, either SOURCE or TARGET, it works fine...
    ...and I also tried to replace the MEMBERSELECTION statement with a REPLACEPARAM statement:
    TASK(PROCESS_CHAIN_RUNL,REPLACEPARAM,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    This way I got an other error message, saying: "Member .../PrivatePublications/user not exist"
    Do you have any idea? How to pass two user selected parameters to a logic script?
    Thanks for your help,
    A.

    Hi CsernusAttila
    You cannot use ACCOUNT_DIM with promp SELECT  and variable $SOURCE$ because it only works with variable ACCOUNT_SET in your script logic.
    instead of you can use TEXT
    PROMPT(TEXT,%,ENTITY_M%%,"Select Entity",)
    PROMPT(TEXT,%,SOURCE%%,"Select Source",)
    PROMPT(TEXT,%,TARGET%%,"Select Target",)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%SELECTION%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF)
    TASK(PROCESS_CHAIN_RUNL,REPLACEPARAM,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    or you can modify your script like this
    *XDIM_MEMBERSET ACCOUNT=%ACCOUNT_SET%
    *XDIM_MEMBERSET ENTITY=%ENTITY_SET%
    And your Prompt like this
    PROMPT(SELECTINPUT,,,,"%ACCOUNT_DIM%,%ENTITY_DIM%,")
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%SELECTION%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF
    I hope it helps
    Regards!!

  • Passing variables from shell script to separate sqlplus script

    Hi, I am having issues passing variables to a separate sqlplus script invoked by the shell script, e.g.
    #!/bin/sh
    DB_NAME=TEST
    PWD1=PA55W0rd
    echo exit | sqlplus / as sysdba @${DB_NAME}.sql ${DB_NAME} $PWD1 >> ${DB_NAME}.sql
    exit 0
    The script picks up the $DB_NAME variable fine, and therefore invokes the required sql script.
    However, when I pass the variable $PWD1 to the sql script I get an error.
    The script creates a database link:
    create or replace procedure new.link
    is
    begin
    execute immediate 'create database link TEST
    connect to TESTSCH identified by '$PWD1'
    using ''TEST''';
    end;
    exec new.link;
    output is:
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at "NEW.LINK", line 4
    ORA-06512: at line 1
    any help appreciated!
    Edited by: 969765 on Apr 5, 2013 4:24 AM

    969765 wrote:
    that is a pretty unhelpful comment, this is actually my LAST resort I have looked up all the documentation etc.This is what I did...
    I went to the documentation:
    http://www.oracle.com/pls/db112/homepage
    I searched for "sqlplus" which gave me this documentation (under "SQL*plus program syntax")...
    http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_three.htm#i1169374
    I read the syntax:
    SQLPLUS [ [Options] [Logon|/NOLOG] [Start] ]and the subsequent information:
    >
    where Start has the following syntax:
      @{url|file_name[.ext]} [arg ...]and "Start" was hyperlinked, so I clicked on it, which took me to the section...
    >
    Start
    @} [arg ...]
    Specifies the name of a script and arguments to run. The script can be called from the local file system or from a web server.
    SQL*Plus passes the arguments to the script as if executing the file using the SQL*Plus START command. If no file suffix (file extension) is specified, the suffix defined by the SET SUFFIX command is used. The default suffix is .sql.
    See the START command for more information.
    >
    and here the "START" was hyperlinked, so I clicked on that...
    and hey presto, I ended up here:
    http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve044.htm#BACJJHDA
    ... where the arguments are described...
    >
    arg ...
    Data items you wish to pass to parameters in the script. If you enter one or more arguments, SQL*Plus substitutes the values into the parameters (&1, &2, and so forth) in the script. The first argument replaces each occurrence of &1, the second replaces each occurrence of &2, and so on.
    >
    ... clearly explaining that SQL*Plus substitutes the substitution variables &1, &2 etc. in the script with the passed in arguments.
    Your script was including a Unix style substitution, not an SQL*Plus script substitution, so that's seems to be the most likely cause of your problem.
    And still you haven't come back to say whether it's worked for you or not... leaving others guessing as to whether you still need help.

  • How can I pass value from sql query to unix script

    I am new to oracle/unix.
    I want to write a simple script to find max date from a table and then pass date into a variable in a korn shell script.
    sql is select max(date) from table;
    how can I pass that value in unix shell as a variable. Thanks

    I use to code like this.
    Enjoy Scripting.
    cmd.sql
    select sysdate from dual;
    exit
    db.sh
    #! /usr/bin/ksh
    . ~oracle/.orapaths
    dbdate=$(sqlplus -S user/pwd@servicename @cmd.sql)
    echo $dbdate
    Run shell scripts
    ./db.sh
    SYSDATE --------- 19-JAN-07

  • Embed SQL in shell script

    I'm trying to embed sql statements in shell.
    I'm new to this..
    Can someone please pass some relevant document links on the web which demonstrates it?
    What I'm looking for is:
    1) How to pass variables from shell environment to sql
    2) How to pass values back to the shell from sql
    Example:
    Say, I want to run a concurrent request ( inside a shell script) . Then I want to check the status of this concurrent requests from FND_CONCURRENT_REQUESTS
    For which I have do a:
    #/bin/bash
    #Submit the request
    CONCSUB APPS/APPS SYSADMIN 'System Administrator' SYSADMIN CONCURRENT FND FNDSCURS >> /tmp/${TWO_TASK}request.log
    #Here, I pull out the value of request id from the log #in v_request_no
    v_request_no=`cat /tmp/${TWO_TASK}request.log | cut -d" " -f3`
    echo "Submitted request No: ${v_request_no}"
    Now, I want to check the status of this request, for which I want to embed the sql:
    select status_code from FND_CONCURRENT_REQUESTS where request_id=${v_request_id}
    How do I embed this?
    And later, I want to pass the value of "status_code" back to my shell and do some manipulation.
    How do I get the value ( of status_code) back in shell script?
    I did a quick hunt on the google to find a relevant doc. No luck yet, so I thought I'll post it here and then go back to some more hunting.
    Message was edited by:
    itzz.me

    Replying to myself instead of editing previous post. Confusing either way, hopefully I picked the less-confusing route.
    The second script snippet that I posted would work really well except for one tiny detail: exit codes have to be numeric. The status_code column in FND_CONCURRENT_REQUESTS is certainly not numeric. :-)
    Here's something that should work. I even checked it for syntax this time, because, well, it's really ugly. :-) Needless to say, you'll need to modify it slightly to plug into your script, since I hard-coded a requestid for purposes of illustration. Please note that the sqlplus command in the here document is enclosed in backticks, not single quotes:
    ----begin code snippet---
    #!/bin/bash
    v_request_id=2415616 #Just an example, sub your own value here
    status_code=`sqlplus -s apps/appspass<<EOF | grep Code | cut -f2 -d:
    select 'Code:' || status_code
    from fnd_concurrent_requests
    where request_id = $v_request_id;
    exit;
    EOF`
    echo "Status code is: $status_code"
    ----end code snippet-------
    If you can't pass in the apps password from the environment, and have to hard-code a password into the script (yecccchhh), I'd suggest setting up a read-only user with SELECT privileges on FND_CONCURRENT_REQUESTS, and running sqlplus as the read-only user instead of apps.

  • Controlling a procedure execution from a UNIX shell script

    I want to control the execution of a PL/SQL procedure from a UNIX shell script.
    Below, I include the script.
    The control variable which should recive the return of the procedure, dosen't work well.
    I want to control the return, because I wanr to make a UNIX script to control the execution of
    a load data process with some Oracle procedures.
    #!/bin/ksh
    echo "Executing procedure pl/sql"
    SQLPLUS="sqlplus -s /"
    ESQUEMA="esquema1"
    echo "\
    call ${ESQUEMA}.Z_PROC_PRUEBA();" | $SQLPLUS
    echo "Controlling pl/sql execution"
    var_err=$?
    if [ $var_err -gt 0 ]
    then
    echo "Error executing pl/sql"
    else
    echo "pl/sql finished sucessfully"
    fi

    This is not oracle problem. You can try something like this in your shell program ->
    DEV=Udev01/1ods@ODS1
    DEV_ID=`sqlplus -s ${DEV} <<!
             set heading off feedback off verify off
             set serveroutput on
             @/prod/ods/satyaki/prac/ctl_build.sql '$1' '$3';  -- If you sql needs to pass argument
             exit
             !`
    O_DIV_ID=`echo $DIV_ID | tr -s " " | sed 's/^[ ]//g'`
    if [[ $O_DIV_ID -ne 0 ]]; then
          echo "Successfully EXecuted.."
    else
      echo "Failed..."
    fiHope this will help.
    Regards.
    Satyaki De.

  • Passing variables from Applescript to bash

    Hello,
    I'm trying to pass variables from Applescript to bash using the following code
    #!/bin/bash
    osascript <<EOF
    tell application "SystemUIServer"
    set username to text returned of (display dialog "Enter your name" with icon caution default answer ""  buttons{"Continue"})
    set macname to text returned of (display dialog "Enter name of your Mac" with icon caution default answer ""  buttons{"Continue"})
    do shell script "export USERNAME=" & quoted form of username & " && export MACNAME=" & quoted form of macname
    end tell
    EOF
    echo "USERNAME is $USERNAME, MACNAME is $MACNAME"
    but no luck
    Mac-mini:Downloads admin$./new.command
    USERNAME is , MACNAME is
    Any help would be greatly appreciated.

    I just realized you are returning 2 variables.  That can still be handled by echoing/printing the values, you just have to parse the output, or use other tricks.
    VALUES=( $(osascript -e '...') )
    This would make VALUES an array, with each array element containing one space separate return value from osascript
    USERNAME=${VALUES[0]}
    MACNAME=${VALUES[1]}
    If USERNAME or MACNAME could have spaces in them, you would need to use some kind of separator character.  For example if you use @ as the separator you could do something like:
    VALUES=$(osascript -e '...')
    USERNAME=${VALUES%@*}
    MACNAME=${VALUES#*@}
    which will %@* will delete everything starting with the @ til the end of the string, and #*@ will delete everything from the beginning of the upto and including the @.
    Another trick is to have the return values be properly formed shell variable assignments such as
    print "USERNAME='your user name' MACNAME='Your Mac Name' " -- I'm making this up as I do not really know Applescript, so you will have to figure out how to get Applescript to print something that looks like
    USERNAME='your user name' MACNAME='Your Mac Name'
    In your shell script you have code that looks like:
    VALUES=$(osascript -e '...')
    eval $VALUES
    The eval will execute whatever is stored in $VALUES, and if that happens to look exactly like shell variable assignments, you get the variables created in the current shell context, where can use them.

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Pass variables to child via C# script task ?

    I don't want to use package configurations to pass variables from Parent to child package. I'd prefer to pass the variables to child, from a  C# script task in the parent package. Can this be done ? Here is the pseudocode for what I hope to do - 
    //code in script task of parent package
    Main(){
    Object parentObj = SSIS.ParentPackage.myObject;
    String parentStr =  SSIS.ParentPackage.myString;
    callChildPackage(parentObj, parentStr);

    You have four choices for this:
    Use Parent-Child variable configurations
    Place the value in a variable in the parent package, which can be referenced from the child package, when run with an Execute Package Task. (http://agilebi.com/jwelch/2009/10/03/passing-an-object-from-a-parent-package-to-a-child)
    Take over the execution of the child package entirely executing the package from inside your C# script task.
    Use something like the Task Factory Advanced Execute Package task. (Full Disclosure: I work for Pragmatic Works)
    Item 3 is probably closest to what you want. You'd need to use the Package.Execute method to run the child package yourself. The advantage of doing that is you can set child package variables explicitly before executing the package.
    John Welch | www.pragmaticworks.com | www.agilebi.com | ssisUnit.codeplex.com

  • Sql loader shell scripting

    Hi All,
    I need help on sql loader shell scripting basically since my input file is csv file will load into some target table say xx_90 along defining with control and data file. what where the data that goes into the bad file a segment of scripting that keep watching on badfile directory path if any bad file it finds it should move to a sperate database error table.
    Plz any sqlloader shellscripting experts can provide me the solution for this. Its a very urgent code i need to deliver I need the sample code for this your help is highy appreciated
    thanku
    sahana

    thanku..............when the load fails it moves to bad file script something like filewatcher it sees the data in the badfile and loads into the database error table........as i am basically businessobjects developer as for time being they have assinged me the task i did few manual loading on sql loader but i never have any experince on writing unix scripting i am quite worried to get this script done........
    can i use the samecode for the failed bad records into seperate external table......
    here i would change the path location and the rest goes as it isright............................i have the script for loading the datainto the targetsomething like this:
    sqlldr userid=ops$NGPTQMS/[email protected] \
    control=${evncpaq1/apps/cp/cm/r11.5.10/geae/gl/include/PAY0001_test.ctl} \
    data=${evncpaq1/data/infile/mon_gross_det.dat} \
    log=${evncpaq1/data/infile/mon_gross_det.log} \
    discard=${evncpaq1/data/infile/mon_gross_det.dis} \
    errors=999
    #bad=${BAD_FILE} \
    if [ $? -ne 0 ]; then
    echo "Error ! The sql loader call failed "
    exit 1
    fi
    IF any error is there in the script plz modify it and plz provide the complete code where to incorporate the code which you have written for bad file. Would be set it in seqence the steps so that i can run it in cron tab basically i have no other support for me to assist me on the job.......
    my dba has sent me the mail something like this:
    Please see the attached script to archive the source file once we are done with loading the data to the database. You already have the script for loading the data to the database. Please incorporate the attached script with your loading script. This script is generic and can be used to archive the bad file also once it has been loaded into the database (in case of any failures). This script send an email in case of any failures to the defined email distribution list. Right now the assumption is to run this through the cron. It we need to run this through the Appworx I will have to do some changes in the script. Also we will have to install the appworx agent on the server. Please let me if we need to need to run this through appworx I will create the appworx module for the same.
    and the archive script he sent is:
    . $HOME/.profile
    # Script to Archive SysLog files
    # This script accepts 2 parameters
    # - 1: Script Name          2: File Name
    # Created By : Pravin Darbare
    # Creation Date : 03/19/2008
    # Modified Date :
    # Modification History :
    echo "Starting SysLog_archiving Process"
    # Set Environmental Variables
    echo "Invoke Set Variable Script `date '+%H%M%S'`"
    # Set Local Script Variables
    #SCRIPT_NAME=$1
    SOURCE_DIR=$1
    FILE_NAME=$2
    # Zipping and Archive Source File
    echo "Zip Source file `date '+%H%M%S'`"
    #cp $LOAD_SRC_FILES/$SOURCE_DIR/$FILE_NAME $LOAD_SRC_FILES/syslog/Old_$FILE_NAME
    gzip /$SOURCE_DIR/$FILE_NAME
    check_rtn_status=$?
    if [ $check_rtn_status != 0 ]; then
    echo "Zipping source file Syslog process unsuccessfull"
    mailx -s "Zipping source file during Syslog unsuccessfull" $PR_PAGER_EMAIL_LIST </dev/null
    exit 1
    fi
    echo "Archive Source File `date '+%H%M%S'`"
    mv /$SOURCE_DIR/$FILE_NAME.gz /$SOURCE_DIR/archive/$FILE_NAME.gz$FILE_EXT
    check_rtn_status=$?
    if [ $check_rtn_status != 0 ]; then
    echo "Archiving source file during Syslog load process unsuccessfull"
    mailx -s "Archiving source file during Syslog load process unsuccessfull" $PR_PAGER_EMAIL_LIST </dev/null
    exit 1
    fi
    # example of calling file Syslog_archiving_Files.sh /apps/syslog/source_dir a.txt
    # example of calling file (Bad file) Syslog_archiving_Files.sh /apps/syslog/source_dir_bad a.txt
    # You need to have directory "archive" in both pathes .
    based on the complete detailed mail must having some view plz provide me something like exact code the rest path directories i will change it........
    for me its highly urgent to keep up my job
    Your support is highly appreciated
    Thanks&Regards
    sahana

  • Passing variables from AS3 to PHP

    Hi there
    I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
    I've stuck with this for two days.. Here's what I have done. Please help!!!
    header.fla [Actionscript in the timeline]
    stop();
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.net.*;
    var url:String = "http://localhost/0000/try.php";
    var req:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    var variables:URLVariables = new URLVariables();
    send_btn.addEventListener(MouseEvent.CLICK, sendForm);
    function sendForm(evt:MouseEvent):void
        // add the variables to our URLVariables
        variables.asd = "value";
        // send data via post
        req.method = URLRequestMethod.POST;
        req.data = variables;
        loader.dataFormat = URLLoaderDataFormat.TEXT;
        // add listener
        loader.addEventListener(Event.COMPLETE, onLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        //send data
        loader.load(req);
    function onLoaded(evt:Event):void
        var result_data:String = String(loader.data);
        if (result_data)
            trace(result_data);
        else if (!result_data)
            trace("error");
    function ioErrorHandler(event:IOErrorEvent):void
        trace("ioErrorHandler: " + event);
    try.php
    <body>
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
      <param name="movie" value="header.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <?php
    if($_POST['asd'])
    echo "value of var1 is <b>".$_POST['asd']."</b>";
    else
    echo "bad luck";
    ?>
    </body>
    BIG THANKS!!

    the problem is nothing your showed.   did you see a security warning that you ignored?
    to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

  • Calling a sql in shell script

    Dear All,
    I want to call an sql script within a unix shell script. I want to pass a parameter into the shell script which should be used as a parameter in teh sql script.
    e.g
    $ ./shell1.sh 5000129
    here 5000129 is a prameter
    inside shell script i am calling one sql script
    e.g.
    @script1.sql;
    inside the sql script I have an update statement
    UPDATE abc set xx = 22 where id = 500129;
    as you can see the 5000129 passed as shell script parameter, is being passed as parameter in the sql script.
    Please can you advise how can I achieve this?
    Many Thanks,

    Hi
    You could try something like this.
    tmpSQLFile=$EXTLOG_DIR/tmpSQLFile_$$.sql
    tmpSpoolFile=$EXTLOG_DIR/tmpSpoolFile_$$.sql
    export ORACLE_PWD=`cat /home/oracle/secure/runtime_user.dat`
    echo "spool $_tmpSpoolFile" > $_tmpSQLFile
    echo "SET ECHO OFF NEWP 0 SPA 0 PAGES 0 FEED OFF HEAD OFF TRIMS ON LINESIZE 10000 TIMING OFF" >> $_tmpSQLFile
    echo "begin" >> $_tmpSQLFile
    echo "DW_MGT_SCHEMA.PKG_RUNTIME_HANDLER.SP_UPD_RUNTIME_EXT_CTL_LOG_TDT(p_transfer_date => '$today', p_schedule_id => $schedule_id);" >> $_tmpSQLFile
    echo "end;" >> $_tmpSQLFile
    echo "/" >> $_tmpSQLFile
    echo "exit" >> $_tmpSQLFile
    sqlplus ${ORACLE_USER}@${ORACLE_SID} @$_tmpSQLFile << EOT
    `echo $ORACLE_PWD`
    EOTCheers
    Gary

  • Is it possible to pass variables from Tidal to the Peoplesoft run controls?

    Does anyoen know
    •1) Is it possible to pass variables from Tidal to the Peoplesoft run control page such as current date?
    An example would be updating run control parameters for a PSQUERY.
    •a) From date
    •b) To date
    •c) Business units
    Thanks,
    Jay

    Edit the job - go to Run Controls Parameters tab - select the param you want in the Override column then click on the Variables button on the bottom and select the variable you want

Maybe you are looking for