SQL Query in Shell script

Hi everyone,
I am facing a difficulty in writing a query for a table REF_PRODUCT having some columns like OFFER, PROVIDERID.
The problem statement is
if the OFFER not in ('A','B','C') then x='D'
if x is empty then
if providerid in (some values) then x='A'
else if providerid in (some other values) then x='B'
else x='C'
where x is a variable in shell script.
I want to execute the above in shell script. how to manage this?
Please help..
Regards
Abhi

user8744860 wrote:
I am facing a difficulty . . . Etc . . .
I want to execute the above in shell script. how to manage this?
Please help..
1) What you posted is not a shell script.
2) In order for us to help you with your question, you need to post a working test case: create table and insert statements
as well as the expected result from that data. Provide also an explanation of the rules that lead to this result.
3) Also provide any code you have written.
:p

Similar Messages

  • How to pass a result of SQL query to shell script variable

    Hi all,
    I am trying to pass the result of a simple SQL query that only returns a single row into the shell script variable ( This particular SQL is being executed from inside the same shell script).
    I want to use this value of the variable again in the same shell scirpt by opening another SQL plus session.
    I just want to have some values before hand so that I dont have to do multiple joins in the actual SQL to process data.

    Here an example :
    SQL> select empno,ename,deptno from emp;
         EMPNO ENAME          DEPTNO
          7369 SMITH              20
          7499 ALLEN              30
          7521 WARD               30
          7566 JONES              20
          7654 MARTIN             30
          7698 BLAKE              30
          7782 CLARK              10
          7788 SCOTT              20
          7839 KING               10
          7844 TURNER             30
          7876 ADAMS              20
          7900 JAMES              30
          7902 FORD               20
          7934 MILLER             10
    14 rows selected.
    SQL> select * from dept;
        DEPTNO DNAME          LOC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    $ cat my_shell.sh
    ### First query #####
    ENAME_DEPTNO=`sqlplus -s scott/tiger << EOF
    set pages 0
    select ename,deptno from emp where empno=$1;
    exit
    EOF`
    ENAME=`echo $ENAME_DEPTNO | awk '{print $1}'`
    DEPTNO=`echo $ENAME_DEPTNO | awk '{print $2}'`
    echo "Ename         = "$ENAME
    echo "Dept          = "$DEPTNO
    ### Second query #####
    DNAME_LOC=`sqlplus -s scott/tiger << EOF
    set pages 0
    select dname,loc from dept where deptno=$DEPTNO;
    exit
    EOF`
    DNAME=`echo $DNAME_LOC | awk '{print $1}'`
    LOC=`echo $DNAME_LOC | awk '{print $2}'`
    echo "Dept Name     = "$DNAME
    echo "Dept Location = "$LOC
    $ ./my_shell.sh 7902
    Ename         = FORD
    Dept          = 20
    Dept Name     = RESEARCH
    Dept Location = DALLAS
    $                                                                           

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Looping through SQL statements in shell script

    Hello members,
    I'm working on the Solaris environment and the DB i'm using is Oracle 10g. Skeleton of what I'm attempting;
    Write a ksh script to perform the following. I have no idea how to include my sql query within a shell script and loop through the statements. Have therefore given a jist of what I'm attempting, below.
    1. Copy file to be processed (one file at a time, from a list of 10 files in the folder ).
    for i in *
               do
               cp $i /home/temp[/CODE]2 . Create a snapshot(n) table : Initialize n = 1 -- -- To create my snapshot table and inserts records in SQL
    create table test insert account_no, balance from records_all;3. Checking if the table has been created successfully:
    select count(*) from snapshot1 -- query out the number of records in the table -- always fixed, say at 400000
    if( select count(*) from snapshot(n) = 400000 )
    echo " table creation successful.. proceed to the next step "
    else
    echo " problem creating table, exiting the script .. "  4. If table creation is successful,
    echo " select max(value) from results_all " -- printing the max value to console
    5. Process my files using the following jobs:
    ./runscript.ksh - READ -i $m ( m - initial value 001 )
    ./runscript.ksh - WRITE -i $m ( m - initial value 001 -- same as READ process_id )
    -- increment m by 1
    6. Wait for success log
    tail -f log($m)* | -egrep "^SUCCESS"7. looping to step1 to :
    Copy file 2 to temp folder;
    create snapshot(n+1) table
    Exit when all the files have been copied for processing.
    done -- End of Step 1
    Pointers on getting me moving will be very valuable.
    thanks,
    Kris

    Hi,
    Are you inserting the data from file or from some table.
    If it is from file, I suggest sql loader would be better, I suppose.
    If it is from table, then something like this
    for i in *
               do
    sqlplus username/password@db_name<<EOF
                create table test select * account_no, balance from records_all;
    EOF
    exit
    doneAnurag

  • 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

  • SQL LOADER and SHELL SCRIPT ISSUE

    Hello Guys,
    I know this not the right forum but i am not sure where i should post this.
    Pelase help
    I am running a shell script which is giving me error
    Username:SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:04 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:06 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter user-name:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    0 rows updated.
    Commit complete.
    SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
    SQL> SQL> Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options Thu Nov 19 13:02:06 EST 2009In shell script i have used the same username and passwd which i am using from command line
    the shell script is calling sql loader to load file
    and for that also the username and passwd is same.
    i am able to run sqlldr command from command line dont knw why here its giving error
    here is my shell script
    set -a
    . $HOME/.edw.env
    . $admlib/checklib.sh
    LOGDIR=$admsrc/sigma6/ppadala/copg
    LOGFILE=${LOGDIR}/log/test`date '+%m%d'`.xtr
    DB_USER=copg
    DB_PWD=copg
    set +a
    cd $LOGDIR
    if test ! -f $admsrc/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_11192009.txt
    then
       echo "Error: DM_Daily_EFolderCloseCancel_Report_11192009.txt does not exist and/or is not a regular file." >> ${LOGFILE}
       exit 1
    fi
    echo 'End of Checking for the existence of the file - Successful'>> ${LOGFILE}
    sqlldr control=$admsrc/sigma6/ppadala/copg/Close_Cancle.ctl log=$admsrc/sigma6/ppadala/copg/Close_cancle.log
    userid=${DB_USER}/${DB_PWD} silent=\(HEADER,FEEDBACK,DISCARDS\)>> ${LOGFILE} 2>&1
    case $? in 0) :;;1|3) echo "Error: SQL Loader" >> ${LOGFILE}
         exit 1;;
    esac
    sqlplus << EOD
    ${DB_USER}/${DB_PWD}
    @Close_Cancle.sql
    EOD
    if [ $? -ne 0 ]
    then
        echo "Error: SQL Plus for script Processing" >> ${LOGFILE}
        echo "Resi Unit Scheduling Report Refresh failed" >> ${LOGFILE}
    fi
    ) > ${LOGFILE} 2>&1
    echo `date` >> ${LOGFILE}
    if [ -f ${LOGFILE} ]
    then
    mail -s "Resi Unit Scheduling" "[email protected]" < ${LOGFILE}
    sleep 3
    `ck_error ${LOGFILE}`
    fiplease help guys
    thanks

    Thanks for the reply
    In Close_cancle.log also its the same msg which i posted.
    logon denied..............
    and this is the log file contents when i do set - X on
    + cd /u2144009/src/sigma6/ppadala/copg
    + test ! -f
    + /u2144009/src/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_1
    + 1192009.txt echo End of Checking for the existence of the file -
    + Successful
    + 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr
    + sqlldr control=/u2144009/src/sigma6/ppadala/copg/Close_Cancle.ctl
    + log=/u2144009/src/sigma6/ppadala/copg/Close_cancle.log
    Username:SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:17 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    + userid=copg/copg silent=(HEADER,FEEDBACK,DISCARDS)
    + 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr 2>& 1
    + :
    + sqlplus
    + 0<<
    copg/copg
    @Close_Cancle.sql
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:58 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter user-name:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    0 rows updated.
    Commit complete.
    SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
    SQL> SQL> Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    + [ 0 -ne 0 ]
    Thu Nov 19 17:32:59 EST 2009Edited by: user10647455 on Nov 19, 2009 2:35 PM

  • How to get return code or parameters from PL/SQL in my shell script ?

    My shell script must check the result of PL/SQL's running, and decide what to do in the next step.

    I think you put the problem the wrong way.
    You should try to do as much as possible through your SQL scripts, and, if you need to make OS calls, you may do that using host(command_string).
    If you need to transfer parameters from other programs to your FORMS (PL/SQL), then you have to see user_exit.
    Some other means would be to have your PL/SQL write to certain OS files that the shell script may read, but that doesn't seem like good practice to me.

  • PL/SQL function - unix shell script

    Hello,
    I have an application that calls a unix shell script This unix shell script calls a oracle function in the PL/SQL package. For example,
    In package pkg_test, there is function f_test. This function returns pls_interger.
    How can I write a unix shell script to return the value from the oracle function, so that the application can get the value from the unix shell script?
    Many thanks.

    Thank you for your response.
    The Oracle functuion pkg_name.proc_name will return different values, 0, 1, 2, 3 in diffefrent conditions.
    The unix script, myscript.ksh calls pkg_name.proc_name.
    The other application will call myscript.ksh and this application will need to get the values 0, 1, 2, 3 from myscript.ksh.
    Can we make it without using the unix shelll function?
    Thanks.
    Edited by: slsam01 on Jun 2, 2009 9:21 PM

  • Pl/sql procedure with shell script

    Hi Guys,
    I will be updating some of the columns in the database thru SQL UPDATE stament. I want to make this process automatic. I.e instead of running manually this uodate process, i want to write a unix script which run on cron job. In the update stament I have to compare date like e_create_date > to_date (........, 'yymmdd') and date should be 2 days previous then to date and I would ike to create the spool file which I would like to send through mail.the script will run automatically.
    I am confused how to write shell script & sql procedure and how to call it inside the shell script. How can this be done.
    Help Appreciated.
    Thanks
    sonu

    save the Store procedure as a create_SP.sql in OS
    save another testrun.sql
    as follows
    begin
    sp_test('&p_test');
    end;
    If you are on a Unix or Solaris OS then
    open a Shell Script as follows :
    and name as test.sh or test.ksh
    var='SYSTEM'
    export var
    sqlplus username/password
    @create_SP.sql
    -- this created a store procedure on the database
    @testrun.sql $var
    This will execute the SP with parameter from OS Variable.

  • Passing params from SQL file to Shell Script and then from Shell to SQL Fil

    Afternoon guys,
    Have a fun question for all you gurus in shell scripting out there. I have a shell script that is calling 2
    different SQL programs. My objective is to pass a variable called request_number from one sql program
    to the shell script and then from the shell script back to another SQL program. I will explain why I
    need this to happen.
    Here is what the shell script looks like which calls sql programs student_load_a.sql and
    student_load_b.sql. Student_load_a.sql basically creates the control file (.ctl) which is needed for the
    SQL*Loader and then student_load_b.sql reads the table that was just loaded and does the main
    processing. My main objective here is to be passing the request_number which is being generated
    using an Oracle Sequence in student_load_a.sql and using this generated number in my main
    processing in student_load_b.sql to select records from the table based on request_number.
    Any ideas ?Any help or recommendations is welcome and appreciated.
    *1. Shell Script*
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id
    exit_status=$?
    # Do sqlloads
    sdesqlldr.exe userid=$p_user_id control=student_load-$p_job_id.ctl \
                                                 log=student_load-$p_job_id.log \
                                                 bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id
    exit_status=$?
    exit 0*2. student_load_a.sql (Would like to pass back the Sequence Number back to shell script and then use in student_load_b.sql*
    -- Accept system input parameters
    define p_job_id = &1
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ' || '''' || request_number_seq.nextval || ''',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    *3. student_load_b.sql (This is a big file so I am only adding code that is relevant for the SQL)*
    {code}
    declare
      v_request_number    number(6);
      v_student_id                  number(7);
      cursor cur_student_load is
        select  student_id
        from   TMP_STUDENT_LOAD
        where  request_number = v_request_number
        order by 1;
    begin
        v_user_id := '&1';
        v_job_id := &2;
        -- This is the variable I would like to be be passing from shell script to student_load_b.sql
        -- v_request_number = '&3';
         open  cur_student_load;
         fetch cur_student_load into v_student_id;
          exit when cur_student_load%notfound;
          .... more logic of if then else in here
         close cur_student_load;
    end;
    {code}
    Edited by: RDonASnowyDay on Jan 29, 2010 4:03 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How come you are mixing WinDoze script (*.exe) with Unix?
    You are aware that you will be passing the password along with the user id to the second sql script?
    I will assume Unix ksh:
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    p_seqno=`sqlplus -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id`
    exit_status=$?
    # Do sqlloads
    sqlldr userid=$p_user_id control=student_load-$p_job_id.ctl \
           log=student_load-$p_job_id.log \
           bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql \
               $p_user_id $p_job_id $p_seqno
    exit_status=$?
    exit 0And the first sql script would look like this:
    -- student_load_a.sql
    -- Accept system input parameters
    set echo off pages 0 feed off lin 80 trims on ver off
    def p_job_id = &1
    col seqno NEW_VALUE seqno
    select request_number_seq.nextval seqno from dual;
    set term off
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ''&&seqno'',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    :p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Unable to see the sql serveroutput from shell script

    Hello experts,
    I have a shell script which I am using to call a pl/sql proc.
    This proc writes to dbms_output.
    I would like to capture the dbms_output to a file when calling sqlplus from my shell script.
    Here is the code:
    ===============================
    echo "
    sqlplus apps/$APPS_PWD << ENDOFSQL
    set serveroutput ON
    set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    begin
    jdr_utils.listcustomizations('$i');
    end;
    exit
    ENDOFSQL
    " >> new.log
    ===============================
    What I get in the 'new.log' is given below:
    ===============================
    sqlplus apps/prj08app << ENDOFSQL
    set serveroutput ON
    set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    begin
    jdr_utils.listcustomizations('/oracle/apps/irc/candidateSelfService/webui/VisVacDispPG');
    end;
    exit
    ===============================
    ENDOFSQL
    What I would like to get is the dbms_output given by the procedure.
    Please suggest.
    Thanks,
    Vinod

    Vinod wrote:
    Hello experts,
    I have a shell script which I am using to call a pl/sql proc.
    This proc writes to dbms_output.
    I would like to capture the dbms_output to a file when calling sqlplus from my shell script.
    Here is the code:
    ===============================
    echo "
    sqlplus apps/$APPS_PWD << ENDOFSQL
    set serveroutput ON
    set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    begin
    jdr_utils.listcustomizations('$i');
    end;
    exit
    ENDOFSQL
    " >> new.log
    ===============================
    What I get in the 'new.log' is given below:
    ===============================
    sqlplus apps/prj08app << ENDOFSQL
    set serveroutput ON
    set feedback off
    set verify off
    set linesize 250
    set pagesize 250
    begin
    jdr_utils.listcustomizations('/oracle/apps/irc/candidateSelfService/webui/VisVacDispPG');
    end;
    exit
    ===============================
    ENDOFSQL
    What I would like to get is the dbms_output given by the procedure.
    Please suggest.
    Thanks,
    VinodYou need to realize & understand that EVERY command line command runs in its own separate OS process.
    So the results from DBMS_OUTPUT get sent to Standard Out for the sqlplus process; which is NOT attached to your terminal.
    The bottom line is you can't get there from here.

  • How To Execute SQL Statements From Shell Scripts?

    I need to extecute some SELECT statements from a shell scripts. Could anybody kindly tell me how to do that, or which document i should refer to ? Thank you very much!

    You can execute SQLPlus with the SQL in a file (sqlplus -s @<sql-script>).

  • Calling SQL statements from Shell scripts

    Hi,
    I want to call external package procedures, declare some variables & do some oracle validations in the shell script.
    How SQL environment is set in shell script & is this one time process or I have to write few statements before every SQL statement.
    Please explain with an example.
    Thanks..

    is this one time process Yes. Example :
    $ cat script.sh
    export ORACLE_HOME=/home/oracle/base/OraHome10
    export ORACLE_SID=db102
    export PATH=$ORACLE_HOME/bin:$PATH
    sqlplus -s / as sysdba << EOF
    select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') date_time
    from dual;
    exit
    EOF
    sqlplus -s / as sysdba << EOF
    col global_name for a60
    select * from global_name;
    exit
    EOF
    $ ./script.sh
    DATE_TIME
    27/02/2008 11:11:27
    GLOBAL_NAME
    DB102
    $

  • Sql Query in Unix script

    Hi,
    on 10G R2, on AIX 6.1,
    in a shell script I want to do :
    sqlplus user/password@mydb
    select * from mytable.How to do that ?
    Thank you.

    Although you have got your answer, still I am posting my solution
    sqlplus /nolog <<EOX
    connect username/password@dbname
    select * from blah;
    EOX
    If you do "sqlplus username/password@dbname" on command line, other users can see the password in "ps" command, which is violating security.
    Cheers

  • How to Call pl/sql procedure from shell script

    Hi,
    I've one procedure which takes the xml file name as input from one of the remote location. Every day users keep one file in that location.
    For eg:
    ACS_RPO00020110316_20110316220956.xml
    ACS_RPO00020110319_20110319220956.xml
    I need to read the latest file in this case. In this case second one is the latest file.
    Can some body please help me how to write script to pass parameter to that procedure that via shell program and execute that.
    Thanks in advance.
    Regards
    Nagendra

    hi
    I executed the below mentioned steps, but I did not get any result:
    I am pasting all the steps which I did
    -bash-3.2$ ls -lrt
    total 316
    -rw-r--r-- 1 oratest dba 4884 Mar 16 03:56 XXGEBIZ_EPO160320110356.xml
    -rw-r--r-- 1 oratest dba 4884 Mar 16 03:57 XXGEBIZ_EPO160320110357.xml
    -rw-r--r-- 1 oratest dba 4884 Mar 16 17:52 GEBIZ_ACS_RPO00020110316_20110316175216.xml
    -rw-r--r-- 1 oratest dba 38 Mar 16 18:18 GEBIZ_ACS_RPO00020110316_20110316181858.NODATA
    -rw-r--r-- 1 oratest dba 63 Mar 16 22:09 GEBIZ_ACS_RPO00020110316_20110316220956.xml
    -rw-r--r-- 1 oratest dba 9716 Mar 16 22:14 GEBIZ_ACS_RPO00020110316_20110316221429.xml
    -rw-r--r-- 1 oratest dba 12988 Mar 17 01:42 GEBIZ_POC_RPO000EPO20110317_20110317014247.xml
    -rw-r--r-- 1 oratest dba 13103 Mar 17 01:53 GEBIZ_POC_RPO000EPO20110317_20110317015356.xml
    -rw-r--r-- 1 oratest dba 38 Mar 17 01:57 GEBIZ_POC_RPO00020110317_20110317015712.NODATA
    -rw-r--r-- 1 oratest dba 38 Mar 17 18:44 GEBIZ_ACS_RPO00020110317_20110317184423.NODATA
    -rw-r--r-- 1 oratest dba 12326 Mar 17 18:46 GEBIZ_ACS_RPO00020110317_20110317184603.xml
    -rw-r--r-- 1 oratest dba 67578 Mar 18 01:32 GEBIZ_POF_RPO000EPO20110318_20110318013232.xml
    -rw-r--r-- 1 oratest dba 14484 Mar 18 20:27 GEBIZ_POF_RPO000EPO20110318_20110318202754.xml
    -rw-r--r-- 1 oratest dba 47653 Mar 19 01:29 GEBIZ_PYS_RPO00020110319_20110319012953.xml
    -rw-r--r-- 1 oratest dba 937 Mar 21 09:34 GEBIZ_SUPP.xml
    -rw-r--r-- 1 oratest dba 947 Mar 21 09:35 GEBIZ_SUPP1.xml
    -rwxrwxrwx 1 oratest dba 121 Mar 21 17:43 test
    -bash-3.2$
    -bash-3.2$ cat > test
    ls -lrt | tail -1
    filelist = $(ls GEBIZ_SUPP*.xml)
    for file in $filelist ; do
    echo "inside loop"
    file = $file
    echo "file name " $file
    done
    XGBZ_SUPP_MAST_XMLTAG_PROC $file
    -bash-3.2$ chmod 777 test
    -bash-3.2$ ./test
    -bash: ./test: Text file busy
    -bash-3.2$
    Initially I listed down all the files, in a sample file I've written the steps. But nothing is executed.
    One thing I want to ask here XGBZ_SUPP_MAST_XMLTAG_PROC is my procedure. I think I need to invoke sqlplus in the so as to execute my pl/sql script.
    Gurus, please let me know how to write them.
    Regards
    Nagendra

Maybe you are looking for

  • Can not see assignment block conditions in rule policy

    Hi gurus, I can't define any conditions in a new lead distribution rule. When I create a rule under a rule folder I can see the assignment blocks "Rule Details", "Actions" and "Preview", but I can't see the assignment block "Conditions" in order to d

  • My apple tv is not recognising my apple id and password

    My apple tv is not recognising my apple id and password after this new update. Netflix is also don't let me play any movies. I already reset the equipment, network is ok because some features of of apple tv are working fine such as renting from Itune

  • Capture Now Freezing

    I just got a Canopus ADVC 110. Everything connects fine and works well. I can moniter play and watch video in the capture windo. I have my VCR connected to the converter via RCA then to the computer with FireWire. When I try to capture "now" the wind

  • Can't create portal application project with netweaver development studio

    Hi All, I want to follow the toturial (http://help.sap.com/saphelp_nw04/helpdata/en/9e/7d96f7087311d7b84600047582c9f7/frameset.htm) to create a portal application with netweaver , but I am failed at the first step, I can not found "Portal Application

  • Thinkpad Yoga - Cant turn on Windows Defender

    Just got my thinkpad today in the mail. I went about uninstalling the included Norton antivirus trial with the intention of turning on windows defender. I uninstalled Norton in the control panel and then used Norton's removal tool just to make sure.