Problem while calling concsub from shell script

Hi All,
I am facing problem when I am trying to run CONCSUB utility from shell script.The same works well when I try it from command line.The only prob I am facing from shell script is assigning values to temporary variables.
This is how my script looks
#!/bin/bash
export PARM5="$5"
export PARM6="$6"
export PARM7="$7"
echo "INTPARM5=\"$PARM5\""
echo "INTPARM6=\"$PARM6\""
echo "INTPARM7=\"$PARM7\""
echo $FND_TOP/bin/CONCSUB $1 ONT 'Order Management Super User, Vision Operations (USA)' $3 WAIT=Y CONCURRENT ONT $PROGRAM "$INTPARM5" "$INTPARM6" "$INTPARM7"When I try to run the above shell based concurrent program it doesn't pass the parameters as expected and it errors out saying "Wrong number of arguments to call the procedure"
I tried my luck from some of the previous posts ({thread:id=2360776} ),but to vain
If anyone has any ideas,please suggest!!
Thanks in advance!!
Edited by: sandy on May 4, 2013 12:54 PM

Here are your proofs
Proocedure
   PROCEDURE abc(--p_errbuf            OUT   VARCHAR2,
                                            --p_errcode           OUT   VARCHAR2,
                             p_order_no          IN    NUMBER DEFAULT NULL,
                                            p_customer_id       IN    NUMBER DEFAULT NULL,
                             p_name              IN    VARCHAR2 DEFAULT NULL
      IS
                v_cname    VARCHAR2(200);
           v_ordered_date DATE;
           v_order_number  NUMBER;
          v_order_type    VARCHAR2(200);
BEGIN
            fnd_file.put_line(fnd_file.output, 'Begin Execution');
   SELECT DISTINCT ac.customer_name,
                d.ordered_date ordered_date,
                d.order_number order_number,
                x.NAME order_type
        INTO   v_cname
           ,v_ordered_date
           ,v_order_number
           ,v_order_type
           FROM oe_order_headers_all d,
                oe_transaction_types_tl x,
                wsh_delivery_details b,
                wsh_delivery_assignments c
                ,ar_customers ac
          WHERE 1 = 1
            AND ac.customer_id = b.customer_id
            AND d.order_type_id = x.transaction_type_id
            AND x.LANGUAGE = 'US'
            AND b.released_status = 'B'
            AND b.source_header_id = d.header_id
            AND c.delivery_detail_id = b.delivery_detail_id
            AND d.order_number=NVL(p_order_no,d.order_number)
            AND ac.customer_id = NVL(p_customer_id,ac.customer_id)
         AND x.name=NVL(p_name,x.name)
            AND NOT EXISTS (SELECT 1
                            FROM wsh_delivery_details b
                           WHERE 1 = 1
                                  AND b.released_status != 'B'
                                  AND b.source_header_id = d.header_id)
                                   --BETWEEN ('1213794') and ('1213797'))
            AND rownum<2;
        INSERT INTO xxc_temp(customer_name,ordered_date,order_number,order_type) VALUES(v_cname,v_ordered_date,v_order_number,v_order_type);
        COMMIT;
         fnd_file.put_line(fnd_file.output, 'Order Number is' || v_order_number);
         fnd_file.put_line(fnd_file.output, 'Order Type is'   || v_order_type);
   END;Script
#!/bin/bash
set -x
export PARM5="$5" 
export PARM6="$6"
export PARM7="$7"
sqlplus -s $1 <<EOF
set head off feed off serverout on size 1000000
exec abc('$PARM5','$PARM6','$PARM7');
exit
EOFNow when I run the 'XX Order Detail CSV Report' I get the below log and no Output
+---------------------------------------------------------------------------+
Application Object Library: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
XXKES_PDF_TRANSFER module: XX Order Detail CSV Report
+---------------------------------------------------------------------------+
Current system time is 06-MAY-2013 05:05:56
+---------------------------------------------------------------------------+
+ export PARM5=66432
+ PARM5=66432
+ export PARM6=
+ PARM6=
+ export PARM7=Mixed
+ PARM7=Mixed
+ sqlplus -s APPS/APPS
+---------------------------------------------------------------------------+
Executing request completion options...
Output file size:
0
+------------- 1) PRINT   -------------+
Disabling requested Output Post Processing.  Nothing to process.  The output of the request is zero byte.
+--------------------------------------+
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed successfully
Current system time is 06-MAY-2013 05:05:56
+---------------------------------------------------------------------------+After the concurrent program executed I queried the table xxc_temp and here you see the data
SQL> select * from xxc_temp;
CUSTOMER_NAME
ORDERED_D ORDER_NUMBER ORDER_TYPE
A. C. Networks
18-FEB-13        66432 MixedMy procedure fetches the data fro given set of i/p parameters but it doesn't give o/p coz it's a host based conc program.Please advise if there's a way to get the o/p in a host based conc program
Thanks!!

Similar Messages

  • Passing contents of file as an argument while calling class from shell scri

    I am calling a class from shell script. One fo arguments which i want to pass to this class is the content of a text file. like:
    /opt/java/bin/javac CLASS_NAME "FILE_CONTENTS"
    if i give "cat FILE_NAME" it will take literally
    and if i dont use quotes then it will be considered as seperate arguments, how do i slve this?

    double-post http://forum.java.sun.com/thread.jspa?threadID=684422

  • Problem while passing parameter to shell script which sends email-Ora Apps

    Hi,
    I have a pl/sql package which will call a shell script program.The shell script program is written in order to send the invoice hold details of AP as a mail.The parameters to this program are passed in the pl/sql package.
    The shell script program has
    5 parameters namely
    to - email
    from - email
    hold id - which is a number
    hold name - varchar2( free text)
    hold reason - varchar2( free text)
    the shell script looks as below.
    FROM_EMAIL=`echo $1|cut -f9 -d " "|sed 's/\"//g'`
    echo "From email id is $FROM_EMAIL" -- From email
    TO_EMAIL=`echo $1|cut -f10 -d " "|sed 's/\"//g'`
    echo "To Email id is $TO_EMAIL" -- to email
    PARAM0=`echo $1 | awk '{print $11}'|sed -e "s/\"//g"`
    echo "Param0: $PARAM0" -- hold id
    PARAM1=`echo "$1" | cut -d" " -f12-| sed -e "s/\" \"/\"^\"/g" | awk -F'^' '{print $1}'|sed -e "s/\"//g"`
    echo "Param1: $PARAM1" -- hold name
    PARAM2=`echo "$1" | cut -d" " -f13-| sed -e "s/\" \"/\"^\"/g" | awk -F'^' '{print $1}'|sed -e "s/\"//g"`
    echo "Param2: $PARAM2" -- hold reason
    the values that am passinf to this program are if suppose
    from email ---- [email protected]
    to email [email protected]
    12345 ------ hold id
    test hold name ------ hold name
    test hold reason ------- hold reason
    The output for the above parameters is as follows
    from email ---- [email protected]
    to email [email protected]
    12345 ------ hold id
    test hold name ------ hold name
    hold name --------hold reason (a part of hold name parameter is displayed as hold reason.The reason being in param2 we used cut which is cutting from 13.
    the problem here is since param1 being free text we cannot predict at what position the parameter ends.i mean there might be a single word or more than 2 words in that parameter seperated by space. the question here is ... is there anyway that we can specify dynamically from which location the param2 should fetch the value.
    can we use some delimiter to identify the end of param1 and start of param2.If so... how can it be written in this scenario.
    Thanks in Advance.

    As I see, all parameters are merged into 1 at shell script.
    Please do as follow:
    1- Modify your shell script as followed:
    echo "From email id is $1" -- From email
    echo "To Email id is $2" -- to email
    echo "Param0: $3" -- hold id
    echo "Param1: $4" -- hold name
    echo "Param2: $5" -- hold reason
    2- rename your shell script file with .prog extension : CUSTOM_NAME.prog
    3- perform the following command at custom file location:
    ln -s $FND_TOP/bin/fndcpesr CUSTOM_NAME
    This approach will seperate your parameters and then it will be more easier to manipulate them.
    Regards

  • Calling sqlplus from shell script

    Hi ,
    I am calling sqlplus from a shell script. After running sql commands successfully, it fails to continue executing commands from the shell script.
    There is no EXIT statement at the end of the sql.
    The error i get is,
    SP2-0734: unknown command beginning "echo "FFFF..." - rest of line ignored.
    Can someone please help.

    how does your shell script looks like? did you check my other post today on this forum
    sqlplus called from a shell script

  • Problem while executing procedure thru Shell script (EXECUTE IMMEDIATE)

    Hi All,
    I have created a procedure where i am passing column name, tablename and business date. The procedure gets last 5 business date excluding Saturday and sunday based on business date.
    i am using EXECUTE IMMEDIATE statement in the procedure, where i am replacing the column name, table name, and business date & then executing this statement.
    stmt := 'select count(1) FROM '||tblname||' where trunc('||date_column||')= :1';
    EXECUTE IMMEDIATE l_stmt into tbl_count using to_char(in_date, 'DD-MON-YYYY') ;
    It will give me the count of all 5 days for a particular dates. When i run the procedure in SQL*Plus/TOAD, it gives me desired result. When i run this in UNIX shell script, it runs fine but at end gives following error:
    SP-xxx: Bind varaible not declared.
    Can someone tell me where might be the problem?

    Hello, if you could put a {noformat}{noformat} before and after your snippets of code please, it makes it much easier to decipher.
    You have:EXECUTE IMMEDIATE l_stmt into tbl_count using to_char(in_date, 'DD-MON-YYYY') ;
    Where it should be:EXECUTE IMMEDIATE l_stmt into tbl_count using TRUNC(in_date) ;
    Additionally, you do not need the SQL script, you could simply have:sqlplus -S $ORA_UID/$ORA_PWD@$DSQuery <<EOF >>${TMP_DIR}/report.log 2>&1
    whenever sqlerror exit failure
    whenever oserror exit failure
    set serveroutput on;
    set pages 0;
    set feed off;
    exec return_date ('20090515','STIFAPACDTR','ASOFD','n');
    print;
    quit
    EOF
    if [[ $? -ne 0 ]]
    then
    echo "sqlplus did not run successfully,verify"
    echo "For errors please check ${TMP_DIR}/report.log file\n Exiting..."
    else
    echo "$0 script executed successfully"
    fi
    exit $?
    You don't need any of this:if /usr/xpg4/bin/grep -e 'ORA-' -e '^ERROR at' -e 'unknown command' ${TMP_DIR}/report.log
    then
    print "sqlplus did not run successfully,verify"
    print "For errors please check ${TMP_DIR}/report.log file\n Exiting..."
    exit 1
    fi
    if [http:// -s ${TMP_DIR}/report.log ]
    then
    print "`echo $0 script executed successfully"
    grep -v '^$'${TMP_DIR}/report.log > ${TMP_DIR}/report.csv
    else
    print "${TMP_DIR}/report.log file not generated, verify, \n exiting"
    exit 1
    fi
    outFLAG="n"
    done
    I'm not sure that that will fix your problem here, but can you try again with those changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get an error code from from calling sqlplus from shell script?

    Hello -
    i am calling sqlplus from a bash shell script. If the sql statement generates an error, how can I return that error code (unsuccessful) back to the bash shell?
    Thanks!

    user11340104 wrote:
    Hello -
    i am calling sqlplus from a bash shell script. If the sql statement generates an error, how can I return that error code (unsuccessful) back to the bash shell?
    Well, let google be your friend,
    http://www.google.co.in/search?rlz=1C1GGLS_enIN327IN327&sourceid=chrome&ie=UTF-8&q=sqlplus+error+codes
    There are many threads I guess talking about the same issue.
    HTH
    Aman....

  • Problem while calling servlet from java bean

    I am trying to call a servlet from java bean in cep.
    My java bean:
    package com.bea.wlevs.example.algotrading;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class MarketEventBean implements StreamSink {
         String s=null;
         public void onInsertEvent(Object event) {
              if (event instanceof MarketEvent) {
                   MarketEvent marketEvent = (MarketEvent) event;
                   try {
                        JAXBContext cxt = JAXBContext.newInstance(MarketEvent.class);
                        Unmarshaller unmarsh = cxt.createUnmarshaller();
                        StringReader strReader = new StringReader(marketEvent.getString_1());
                        MarketEvent obj = (MarketEvent) unmarsh.unmarshal(strReader);
                        s=obj.getSymbol();
                        System.out.println("data: " + s);
                   } catch(Exception e) {
                        e.printStackTrace();
                   try {
                        System.out.println("test1");
         URL url = new URL("http://172.18.21.94:7001/AppServletrecv-Model-context-root/ReceiveServlet");
         URLConnection conn = url.openConnection();
              System.out.println("test2");
         conn.setDoOutput(true);
              System.out.println("test3");
         BufferedWriter out =
         new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
         out.write("symbol="+s);
              System.out.println("test4");
         out.flush();
         System.out.println("test5");
         out.close();
         System.out.println("test6");
         BufferedReader in =
         new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
              System.out.println("test7");
         String response;
         while ( (response = in.readLine()) != null ) {
         System.out.println( response );
         in.close();
         catch ( MalformedURLException ex ) {
         // a real program would need to handle this exception
         catch ( IOException ex ) {
         // a real program would need to handle this exception
    My servlet code:
    package model;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ReceiveServlet extends HttpServlet {
    private final static String _SYMBOL = "symbol";
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    * Get the value of form parameter
    // private final static String USERNAME = "username";
    String symbol = request.getParameter( _SYMBOL );
    * Set the content type(MIME Type) of the response.
    response.setContentType("text/html");
    * Write the HTML to the response
    try {
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title> A very simple servlet example</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello " + symbol +"</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    } catch (IOException e) {
    Web.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <servlet-name>ReceiveServlet</servlet-name>
    <servlet-class>model.ReceiveServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReceiveServlet</servlet-name>
    <url-pattern>/ReceiveServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    My servlet is running in weblogic server.
    But when I am running this program in weblogic server side there is no log.
    Edited by: 856272 on Jun 23, 2011 6:43 AM

    I would run both sides in a debugger and see what code is getting invoked

  • Line Alignment Problem while sending Fax from SAP Script

    Moderator message: please do not post the same question in different forums
    Hi Experts,
    While sending fax the horizontal lines are not displaying till the end of the page.
    But in the print preview the lines are displying till the end.
    If this is printed using local printer the lines are printing fine but the problem is with the fax.
    Please provide me a solution for this.
    Regards,
    Rajesh.
    Edited by: Matt on Nov 25, 2008 2:51 PM

    Puzzling.
    I've seen where the printed output doesn't match the print preview but not a fax not matching a print.
    Do you use SAPConnect or the older SAPComm method for faxing?
    How do you produce the horizontal lines? BOX commands, ULINE, '-', etc.?

  • Problem while calling webservice from a plsql stored procedure

    Hi everybody,
    I need to call a webservice from a plsql stored procedure.
    I was following documentation published in the otn at the following link.
    "http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html"
    I am encountering the following error on my sql prompt-
    SQL> exec dbms_output.put_line(time_service.get_local_time('94065'));
    BEGIN dbms_output.put_line(time_service.get_local_time('94065')); END;
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at "APPS.DEMO_SOAP", line 65
    ORA-06512: at "APPS.TIME_SERVICE", line 13
    ORA-06512: at line 1
    Has anybody worked on the same example. Please direct me.
    Thanks & Regards
    Kiran Kumar

    Kiran, were you able to solve this?
    I am facing the same error.
    Oracle Server is Unix and webservice is .NET.
    I am able to connect to Java web service.

  • Problem while Calling Webservice from ABAP

    Hello All,
                 I am Calling the Webservice using ABAP-Class from abap,i getting the following HTML response error from the Webservice.Can any one help me.
    tional//EN">######
    ####td {font-family : Arial, Tahoma
    , Helvetica, sans-serif; font-size : 14px;}##A:lin
    k ##A:visited
    ##A:active ####
    Thanks and Regards,
    Kamal

    It is not finding the correct URL - hence the 404 - page not found error.
    Correct the URL and try again.

  • List problem while calling report from froms

    forms 6i i am using.
    i am passing parameters to report from my form.
    in report i have company parameter.
    user select ALL/Specific
    i populate list for specific on run time like with this query.
    Populate_Group_With_Query(rg_id,'select sym_code,sym_code from companies');
    but how can i populate companies name along with all option in my list item.

    query works fine..
    now i have all in my list along with other sym_code.
    but when i give ...ALL... as initial value in my list item..
    it gives error
    initial value does not match available list items.
    even all is in list..

  • Please help to call oracle procedure with out paramter from shell script

    Hi
    I want to call a process with out parameter from shell script. I am calling process in shell script in below way
    function Process_loads {
    ( echo 'set serveroutput on size 1000000 arraysize 1'
    echo "set pagesize 0 term on verify off feedback off echo off"
    echo "BEGIN"
    echo " dbms_output.put_line('Before Calling The package'); "
    echo " x ( '$1', '$2', '$2', '$4', '$5', '$error_code'); "
    echo " dbms_output.put_line('After Calling The package'); "
    echo "EXCEPTION "
    echo " WHEN OTHERS THEN "
    echo " dbms_output.put_line('BIN_LOAD_ERROR' || SQLERRM); "
    echo " ROLLBACK;"
    echo "END;"
    echo "/" ) | sqlplus -s $USER/$PASSWORD@$SID
    Here $error_code is out paramter. All varaibles passed in process are declared with export command.
    When executing .sh it gives below error
    "sh ERROR at line 3: ORA-06550: line 3, column 99: PLS-00363: expression '' cannot be used as an assignment target ORA-06550: line 3, column 3: PL/SQL: Statement ignored".
    Please help to get rid from this error or please suggest how to call a oracle procedure with out paramter from unix shell script.
    Thanks in advance

    You can try this:
    From sql*plus
    SQL> ed
      1  create or replace procedure my_proc(p_id in int, p_result out int)
      2  as
      3  begin
      4  select 10 * p_id
      5  into p_result
      6  from dual;
      7* end my_proc;
    SQL> /
    Procedure created.
    SQL> set serveroutput on
    SQL> declare
      2  v_r int;
      3  begin
      4  my_proc(10,v_r);
      5  dbms_output.put_line(v_r);
      6  end;
      7  /
    100
    PL/SQL procedure successfully completed.
    from bash:
    testproc.sh:
    #!/bin/bash
    (echo 'set serveroutput on';
    echo 'declare';
    echo 'v_r int;';
    echo 'begin';
    echo 'my_proc(10,v_r);';
    echo 'dbms_output.put_line(v_r);'
    echo 'end;';
    echo '/';) | sqlplus -s u1/u1
    Console:
    oracle@mob-ubuntu:~$ chmod u+x testproc.sh
    oracle@mob-ubuntu:~$ ./testproc.sh
    100
    PL/SQL procedure successfully completed.With kind regards
    Krystian Zieja

  • Calling linux / unix shell scripts from APEX

    Hi -- I'm doing some prototyping, and would like to try calling a unix shell script on the server from within APEX.
    Is this possible? Maybe thru Javascript? Other ways? Not sure if it's possible thru pl/sql.
    FYI, I'm attempting to check username/password specified at login to see if it's a valid login
    to another database (also specified at login). If there's an easier way to do this, I'd love to hear it!
    We're highly motivated to have a single apex app work on multiple databases -- largely because of a lack of
    administration resources on the other databases. All databases are accessible via database links from
    the apex server (the links are necessary to implement other business rules), and I know I can get
    the DML working. Powers that be prefer that Database Account authentication (or a facsimile thereof)
    be used. I suspect I'm opening myself up to lots of criticism by disclosing this ... :)
    Thanks for any ideas,
    Carol

    R -- If I understand you correctly, a pl/sql process in APEX could invoke a java program on the server. Is that correct?
    If so, is there any reason it couldn't just call a unix shell script? Seems they're both just executables recognized by the OS....
    I know I called unix scripts from embedded sql a billion years ago, but don't recall the method for doing that. What is
    the syntax I'd use in apex / pl/sql?
    thanks,
    Carol

  • Calling an external shell script program from ABAP.

    Hi,
      Can i call an external shell script program from abap which is there on application server.
    The FM WS_EXECUTE i know can be used for calling this purpose.
    But i am getting a doubt that how can i call the external program from there.
    Please clear my doubts.
    Thanks in advance.
    Vikash

    search in SCN for sm49 and sm69 Tr. you will surely find solutions for it, with a simple search.

  • Urgent Problem in Executing perl script from shell script

    Hello,
    I've a shell script on one server (source) and a perl script on another (target).
    My perl script will check whether the directoryname, filename provided by shell script exists on the target server or not.
    My shell script is as follows:
    #! bin/bash
    cmd=`ssh user@target "perl /home/user/test_dir/validate_file.pl"`
    echo $cmd
    And my perl script uses a package CU_Functions.pm, which is in the same directory as the perl script on the target server.
    But when I invoke the perl script from shell script, I get the following error:
    Source:user> (db:ias10g12_mid_db) /home/user/perl
    $ sh /home/user/arcs/arcs_conn.sh
    user@target's password:
    Can't locate CU_Functions.pm in @INC (@INC contains: /local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1 /local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux /local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .) at /home/user/test_dir/validate_file.pl line 13.
    BEGIN failed--compilation aborted at /home/user/test_dir/validate_file.pl line 13.
    Please let me know if I need to do any configurations prior to call the perl script.

    As for the Perl INC, I cannot recall the environment variable that sets that but the following example should work:
    ssh user@host "export ENV_VAR=/path/to/include/files:$ENV_VAR ; /full/path/to/script"

Maybe you are looking for