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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Passing Params from Mutiple Class in a Single Script

    Hi Folks,
    there is a scenario where there are many parameters (optional and mandatory parameters) , which are to be used across different functions with in a child script called CHDS
    So I want to create a separate class ABC with in the same script and declare all those parameters in it and then pass the entire class as an argument to a function.
    Then I would declare an instance ABC and access those parameters required for that particular function.
    so The first class in the script is by defaut
    public class script extends IteratingVUserScript {
    public void functionA1(ABCparams) throws Exception
    ABCparams abc = new ABCparams();
    app.field1 = abc.parameter1;
    app.field2 = abc.parameter2;
    app.field6 = abc.parameter6;
    app.field7 = abc.parameter7;
    public void functionB2(ABCparams) throws Exception
    ABCparams pqr = new ABCparams();
    app.field3 = pqr.parameter3;
    app.field4 = pqr.parameter4;
    app.field8= pqr.parameter8;
    app.field9 = pqr.parameter9;
    Now the second class is
    public class ABCparams
    parameter1;
    parameter2;
    parameter3;
    parameter4;
    parameter5;
    parameter6;
    parameter7;
    parameter8;
    parameter9;
    parameter10;
    parameter11;
    parameter12;
    However the values for parameters declared in class ABCparams would be read from a databank of a parent script PRNS, i.e parent PRNS would invoke child script CHDS.
    Do you think that, this a feasible approach?

    Im not sure whether you can store the internal table into Java script array.
    Look at the below thread, it may help you
    pass an internal table to a javascript function
    By the way you want to store the itab into javascript?
    Raja T
    Message was edited by:
            Raja Thangamani

  • Pass param from report to report

    Hello guys,
    I have got a report1 linking to a custom target - report2. In report1 I have set Item 1 as IR_type_of_part_needs_id #PART_ID#. Report2 is based on the following query:
    WITH
    subparts (partId, subPartId, amount, subLevel) AS
    SELECT TYPE_OF_PART_NEEDS_ID, TYPE_OF_PART_IS_NEEDED_ID, AMOUNT, 0 SUBLEVEL
    FROM PART_NEEDED
    WHERE type_of_part_needs_id = :IR_type_of_part_needs_id -- here I need to pass the parameter from report1
    UNION ALL
    SELECT SUB.TYPE_OF_PART_NEEDS_ID, SUB.TYPE_OF_PART_IS_NEEDED_ID, SUB.AMOUNT, SUBLEVEL+1
    FROM SUBPARTS S, PART_NEEDED SUB
    WHERE sub.TYPE_OF_PART_NEEDS_ID = S.SUBPARTID
    SELECT partId, subPartId, amount, subLevel
    FROM subparts
    ORDER BY subLevel, partId;
    Could you please give me an advice how I can achieve this
    Many thanks in advance!
    Application Express 4.0.1.00.03
    Edited by: Todor Kolev on Mar 2, 2012 2:41 PM
    Edited by: Todor Kolev on Mar 2, 2012 4:39 PM

    You can solve this by creating an item and then initialize that item when the link from report1 is clicked.
    Example:
    1) Create new item - my_item in report1 page
    2) In report1 set Item 1 as my_item #PART_ID#
    3) Then you can call in report2 like this:
    WITH
    subparts (partId, subPartId, amount, subLevel) AS
    SELECT TYPE_OF_PART_NEEDS_ID, TYPE_OF_PART_IS_NEEDED_ID, AMOUNT, 0 SUBLEVEL
    FROM PART_NEEDED
    WHERE type_of_part_needs_id = *:my_item*
    UNION ALL
    SELECT SUB.TYPE_OF_PART_NEEDS_ID, SUB.TYPE_OF_PART_IS_NEEDED_ID, SUB.AMOUNT, SUBLEVEL+1
    FROM SUBPARTS S, PART_NEEDED SUB
    WHERE sub.TYPE_OF_PART_NEEDS_ID = S.SUBPARTID
    SELECT partId, subPartId, amount, subLevel
    FROM subparts
    ORDER BY subLevel, partId;

  • Can a Button call a java script and then proceed with the creation

    Hi all,
    I have a simple APEX form on a table,
    with simple function as create and apply changes,
    some items of the form are computed by a "Computation"
    I need the create button to show the computed values, before move to the next page, then proceed with the creation ( submission)
    I have tried to show the values by a java script, but after clicking the button OK of the javascript msg, no submission performed ,
    details:
    the java script is called in the URL of the Button,
    it only contains a alert statement
    is there a way to let the button do that
    or may be the case could be solved by another idea!!!
    rgrds,

    Hi Varad,
    It is Before header of course. I forgot to mention this.
    Yes, you are right Varad, I have read again the question and seems original request was to show Computation that is done in After Submit, more javascript is required of course.
    One possibility is to create On Demand process called COMPUTEITEM where you compute your item, and in the end of on demand process it prints it
    htp.p(:P1_X)
    Then put in HTML header of your page
    <script language="JavaScript" type="text/javascript">
    function setShowItemSub(pThis){
       var l_This   = $x(pThis);
       var ajaxRequest = new htmldb_Get(null, $v('pFlowId'),  'APPLICATION_PROCESS=COMPUTEITEM', $v('pFlowStepId'));
       ajaxRequest.add($x(l_This).id, $v(l_This));
       var gReturn = ajaxRequest.get();
       alert(gReturn);
       ajaxRequest = null;
      doSubmit('aa');
    </script>And in Button URL textarea put:
    javascript:setShowItemSub('P1_X');
    Then no need in After Submit process anymore
    I have put this now in http://apex6.revion.com/pls/apex/f?p=225:1
    COMPUTEITEM On demand process is :
    :P1_X := :P1_X || ' Added this trail';
    htp.p(:P1_X);Of course, all this should be modified accordingly
    Regards,
    Oleg

  • Passing param from UIX Master-Deatil to Search form

    OK This seems to be little bit advanced question (at least for me).
    Say I have two UIX pages
    1. The first page (P1) contains Master Detail view of some table T1(ID1, ID2, ID3).
    2. The second page (P2) is UIX search phase created from from the view of T2(ID4,ID5,ID1)
    NOTE that ID1 is FK in T2 and is also PK in T1.
    Let's say that user picks some record in P1. Then the user clicks some submit button that should open P2. Now when the P2 renders it starts with 'Results' table (I hope everyone is familiar with UIX search pages).
    What I WANT is this:
    a) When P2 renders it should show only records where ID1 matches the one selected in P1, ie
    SELECT T2.ID4, T2.ID5, T2.ID1 FROM T2
    WHERE T2.ID1=T1.ID1 <-- this one is chosen from P1 and T1.
    b) When user now wants to create a search critera it has to have ID1 set to the one chosen from P1 T1.
    Hope the question is clear
    Please help!
    Rade

    This is how we recommend doing this:
    Create your data model so that the Detail is a child of Master. You might not have this set up correctly currently.
    Next, on the struts-config.xml diagram, create a Data Page and call it the MasterDataPage. Open the page and make sure to name it with the .uix extension. Select the Master Data Control and drag a read-only table onto the MasterDataPage. Drag and drop a uix submitButton component in the tableActions named child of your table.Set the event attribute on the submit button to "search". (don't create an event handler in the uix page yourself since this happens in struts).
    Draw your forward line from MasterDataPage to Search DataAction and call it "search". Create a DetailDataPage that comes off of SearchDataAction via "success", the default. Select the Detail model and drag it as a Read-only table onto that page.
    Now run the MasterDataPage. Select a row from the master table. Click the Submit button. This will take you to the Detail page and you will see the details for the row on the master that you selected.
    I hope this helps,
    Jeanne

  • Sometimes when I open Firefox I get a message about scripts and then it freezes it says something about Script: file:///C:/Program%20Files/Mozilla%20Firefox/modules/XPCOMUtils.jsm:165

    This happened this morning. Firefox seemed to freeze and go into slow motion.

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • Passing parameters from shell script to OWB process flow

    Hi all,
    I am running OWB process flow (using the template script provided by oracle) and i want to pass two date parameters as shown below:
    sqlplus -s $SQL_USER/$SQL_PWD@$ORACLE_SID @$HOME_DIR/src/vmc_oem_exec_script.sql OWB_OWNER VMC_POST_DW_PF_LOC_SIT PROCESS VMC_NM1_PORT_MAIN "," "P_DATE_FROM=$DATE_FROM,P_DATE_TO=$DATE_TO"
    How do i catch those values in process flow and pass those to mappings in Process flow?
    Do i need to create PF variables with same names or any name will do?
    Thanks in advance

    This document is explaining how to pass data between activities in process flow.
    I am passing parameters from a shell script.
    Any ideas,how to pass parameters from shell script and then initialize the process flow variables based on those values and then pass them further to mappings.
    Thanks

  • How to pass values from single Databank file across different scripts?

    Hi Guys,
    I have a question regarding using single databank file across different scripts.
    Lets say there 5 web service scripts and these are very generic scripts where the input/request xml schema of each script is parameterized without having any databank as script asset.
    These 5 web service scripts are like library functions and so we dont want to attach any databank as script asset.
    However I have a driver script to call all of these 5 library scripts and now I attach a databank (a .csv file) to the driver script as script asset. Say this .csv file has got 10 different columns with just single record/row.
    As and when the function call goes to those 5 scripts i.e one by one, then based on the function call the corresponding columns are used and the data for those columns must be read.
    Is there any solution to acheive this?
    Faster help is highly appreciated.

    Hi JB,
    what i was looking for, was an approach to use a databank file (.csv file) in a parent script and then by reading that .csv file, the data should be moved from the parent script to individual child scripts.
    The child scripts are very generic scripts and are like library functions which are not data dependent. they are fully parameterized and they dont have any sort of databank attached to them.
    Now the question is if the databank has got 10 columns where first 3 columns belong to one child script, second 3 columns belong to 2nd child script and so on.
    Then how do we pass the values from parent script to a child script and what is the best/recommended approach.

  • Accessing passed arguments from php script?

    I have a php script which will pass an argument which I need
    to turn in to a coldfusion variable, how should I go about doing
    this?

    I am developing a cf application to interface with the PLESK
    control panel's Event manager to dynamically setup cf security
    sandboxes when a new domain is added to PLESK. Plesk uses encrypted
    php3 files and with the use of the event manager API I can pass the
    new domain name to any script. However, I cannot alter the way
    PLESK sends the param <new domain> therefore a cfhttp post is
    impossible. All I can do is path the new domain as an argument to
    the file IE: myscript.cfm.
    I have tested passing the new domain to a bash shell script
    and then using bash to drop the new domain name into a database
    then using CURL to execute the .cfm file which sets up the new
    sandbox. This is tested and working on Linux servers but now my
    task is to do the same for Windows servers, hence I would prefer to
    keep all the coding under cf

  • SAP XI: How To Write Shell Script And use it in File Adapter On XI Server

    Hi,
    I want to split file at sender side in XI using Shell Script and then after i want to do
    Mapping.
    Can anyone tell me what exactly it means "write a script in UNIX shell on XI SERVER"?
    Regards,
    Akshay.

    Hi,
    You can execute a Unix script running in the XI server from the File communication channel. Ie. if you want to do something which was not part of XI adapter configuation , then you can make use of external unix script and you can execute those from the XI.
    For this, write a unix script and place in the XI OS level provided that path is accessible from PI Channel.
    E.g
    So u can use this in either Sender Channel to modify the data before it reaches into the Integration Server or in Receiver channel it is generally used to transfer the files into different location via Secure FTP
    SAP help: http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Blog:/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    XI  can be in any OS.
    Hope this helps,
    Rgds,
    Moorthy

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

  • 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

  • Script fails when passing values from pl/sql to unix variable

    Script fails when passing values from pl/sql to unix variable
    Dear All,
    I am Automating STATSPACK reporting by modifying the sprepins.sql script.
    Using DBMS_JOB I take the snap of the database and at the end of the day the cron job creates the statspack report and emails it to me.
    I am storing the snapshot ids in the database and when running the report picking up the recent ids(begin snap and end snap).
    From the sprepins.sql script
    variable bid number;
    variable eid number;
    begin
    select begin_snap into :bid from db_snap;
    select end_snap into :eid from db_snap;
    end;
    This fails with the following error:
    DB Name DB Id Instance Inst Num Release Cluster Host
    RDMDEVL 3576140228 RDMDEVL 1 9.2.0.4.0 NO ibm-rdm
    :ela := ;
    ERROR at line 4:
    ORA-06550: line 4, column 17:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    &lt;a string literal with character set specification&gt;
    &lt;a number&gt; &lt;a single-quoted SQL string&gt; pipe
    The symbol "null" was substituted for ";" to continue.
    ORA-06550: line 6, column 16:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev su
    But when I change the select statements below the report runs successfully.
    variable bid number;
    variable eid number;
    begin
    select '46' into :bid from db_snap;
    select '47' into :eid from db_snap;
    end;
    Even changing the select statements to:
    select TO_CHAR(begin_snap) into :bid from db_snap;
    select TO_CHAR(end_snap) into :eid from db_snap;
    Does not help.
    Please Help.
    TIA,
    Nischal

    Hi,
    could it be the begin_ and end_ Colums of your query?
    Seems SQL*PLUS hs parsing problems?
    try to fetch another column from that table
    and see if the error raises again.
    Karl

  • How to pass arguments to .sql file.......

    Hello,
    I want to pass arguments to .sql file which is being called from within a shell (.sh).
    suppose this is the line in shell -
    ${ORACLE_HOME}/bin/sqlplus -s abcuser/abcuser@abc < ${ABCDB_DIR}/A.sql $val >>${LOG}
    - now I want to pass '123456' to A.sql
    Please suggest how to do that.
    Thanks and regards,

    You can pass parameters to a shell script executing sql commands just like you would any other shell script.
    I have a script called test_os_variables.sh:
    sqlplus -s "/ as sysdba" << EOF
    select '$1' from dual;
    EOF
    Now I execute my script passing SHAWN as a parameter.
    ./test_os_variables.sh SHAWN
    SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jan 9 08:09:46 2007
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL>
    'SHAW
    SHAWN

Maybe you are looking for

  • IPHONE 5 RUNNING IOS 6.1.4 WON'T LET ME UPDATE TO IOS.7

    Hi, I have an iPhone 5 running IOS 6.1.4 and was wanting to update to IOS.7 wirelessly but when I go into Software Update it tells me this software is up to date and doesn't give me any option to update to IOS 7. I know the software has been released

  • Payment Block at the time of FB60

    Hi I want to have payment block flowing directly in FB60. I shud not enter manually So what i did: I went to OBA3. There i defined tolerance group and i gave payment terms as 0002 In that payment terms, i have given payment block key A But when i did

  • Portal & Webi iView Question

    Hi Experts, Are there predefined iViews (templates) available for Webi documents/reports? If yes, how do I obtain the iviews, and could you please provide a step-by-step on how to view Webi reports on the Portal? Thanks for your help in advance. tvu

  • Why is the dispay on my nano upside down?

    why is the display on my nano upside down?

  • How to Cache a Web Template in RRI scenario

    Hi, We have used RRI functionality to one of our requirements where in user can look at Territory wise info first and can drill down to any specific territory for Dealer wise info. We have used Control Query to cache Dealer info based on all the terr