Not able to return value for pl/sql to shell

Hi,
I'm calling pl/sql script from my shell script. Have set a flag in the pl/sql. Trying to return the value of the flag back to the shell script, but it is not working. My shell is ksh
Please help....
SHELL code trysnir.sh file--->
<code>
#!/bin/ksh
flaga=50
echo $flaga
flaga=`sqlplus -S user/pass@sid@/opt/local/sql/update.sql > LOGFILE`
echo aftersql
echo $flaga
if [ $flaga -lt 50 ]; then
error "Previous Load failed"
exit 3
fi
echo complete
</code>
SQL CODE file for update.sql--->
<code>
variable flaga number
declare
sessin_id number;
begin
Select Load_Sessin('aaa','xx') into sessin_id from dual;
if sessin_id is NULL then
:flaga :=10;
end if;
dbms_output.put_line(flaga);
end;
exit :flaga
</code>
But this returns me --->
+50+
aftersql
PL/SQL procedure successfully completed.
tyrnir.sh[9]: procedure: unknown test operator
complete
Please advise.... I have been trying since past 3 hrs and tried all search and everything i could but in vain.
Many Thanks....
Edited by: nss280 on Aug 20, 2009 2:17 AM

executing this way will return you the last output from the sqlplus command. I think suppressing message PL/SQL procedure successfully completed. and putting a DBMS_OUTPUT.PUT_LINE(vflag) (this you have done already) will give you the desired result. So in update.sql put some extra line as below:
set feedback off
set serveroutput on
<your code goes here>
Regards.

Similar Messages

  • Not getting the return value of a program though it has no  errors

    public static String giroReturnFileDate(String strType)throws IOException{
              try{
                   SimpleDateFormat getFormatDate = new SimpleDateFormat("yyMM");
                   Date date = new Date();
                   String str = getFormatDate.format(date);
                   System.out.println("Current Date is : "+ str);
                   System.out.println("Fetching the Giro file now");
                   if(strType.equalsIgnoreCase("WPD") || strType.equalsIgnoreCase("ISTD")) {
                   FileReader inputFileReader = new FileReader("giro2itcs_"+strType+".txt");
                   ArrayList list = new ArrayList();
                   ArrayList list1 = new ArrayList();
                   System.out.println("Reading the file");
                   BufferedReader inputStream = new BufferedReader(inputFileReader);
                   String inLine = null;
                   String str1 = null;
                   while((inLine = inputStream.readLine()) != null && inLine.length() < 2)
                        list.add(inLine);
                   System.out.println("Control Record for giro2itcs_"+strType+"is:"+ inLine);
                   inputFileReader.close();
                   inputStream.close();
                   for (int i=0; i<inLine.length(); i++ )
                        str1 = inLine.substring(19,23);
                   System.out.println("date of the transaction is:"+str1);
                   if (str .equals(str1)){
                        System.out.println("giro2itcs_"+strType+".txt file is created today");
                        return "true";
                   else{
                        System.out.println("giro2itcs_"+strType+".txt file is not created today");
                        return "false";
                   }// end of if
                   return "test";
              }// end of try
              catch(Exception e) {
              System.out.println("The Exception is ::::::::::::::"+e);
    return "one";
    }//end of giroReturnFileDate(...) method
    }//end of of the class
    main method is seperate. this program compiles fine but am not getting the return value for this. none of the return values. plzzz help me.

    can you send me the code complete one ...
    i will debug and solve the problem
    [email protected]
    By publishing your email address you are likely to get loads of spam.

  • Not able to set values in drop down for a table field

    Hi All,
    I am not able to set values in drop down for a table field. Although I am able to set these values to a stand alone field but its not happening for a particular table field. I am using ABAP web dynpro for coding.
    Pls help.
    Regards,
    Bhaskar

    Hi Otto,
    Here is the code I am using:
    * navigate from <CONTEXT> to <DATASOURCE> via lead selection
      lo_nd_datasource = wd_context->get_child_node( name = wd_this->wdctx_datasource ).
    * navigate from <DATASOURCE> to <CHANGING_PARAM> via lead selection
      lo_nd_changing_param = lo_nd_datasource->get_child_node( name = wd_this->wdctx_changing_param ).
    * navigate from <CHANGING_PARAM> to <EDUCATION_TAB> via lead selection
      lo_nd_education_tab = lo_nd_changing_param->get_child_node( name = wd_this->wdctx_education_tab ).
      node_info = lo_nd_education_tab->get_node_info( ).
      REFRESH ddlb_value_set.
      DATA: wa_edu_est TYPE t517t.
      SELECT * FROM t517t INTO wa_edu_est WHERE sprsL = 'EN'.
        s_element-text = wa_edu_est-stext.
        s_element-value = wa_edu_est-slart.
        APPEND s_element TO ddlb_value_set.
      ENDSELECT.
      SORT ddlb_value_set BY text.
    *    Set Value_sets to node_info
      node_info->set_attribute_value_set(
         name      = 'EDU_EST'
         value_set = ddlb_value_set ).
    Regards,
    Bhaskar

  • When I am on a phone call and I double click the button to go to my home screen, then open another application (usually my calendar program, Calengoo), my screen goes blank and I am not able to return to either the app, the phone, or the home screen.

    When I am on a phone call and I double click the button to go to my home screen, then open another application (usually my calendar program, Calengoo), my screen goes blank and I am not able to return to either the app, the phone, or the home screen. If I am speaking to a person, if they hang up then I am back to the phone application. If I'm leaving a message, I am unable to return to the phone screen to end the call, and have to wait until the other phone hangs up. I'm also unable to switch back and forth to look at my calendar if I'm calling someone about scheduling. This has only started happening since the most recent iOs update. I run into situations similar to this about once per day during the work week, as I use my phone is this manner quite often. While not life altering it is quite frustrating. Can anyone here help me figure out a way to avoid this? If it helps, I have noticed a general downgrade in overall performance starting two system updates ago (apps opening more slowly, closing unexpectedly more often, etc.). I have an iPhone 3GS with the latest OS update.
    Thank you for any help or suggestions,
    Chris

    I could be corrupted backup.
    You can check the notification settings for message.
    Settings>Notification Center>Messages>Alert Style
    It should be on Banners or Alerts.
    Settings>Messages> Turn on Imessage and send as SMS and below that "Blocked" to check if you have any numbers block might be blocking the message.
    You can also do a hard reset by holding power and home till it restarts and release after seeing the apple logo.
    Still doesn't work? Settings>General>Reset>Reset all settings

  • ** Not able to create Value Mapping Table in Integration Directory

    Hi friends,
        I am not able to create value mapping entries like below in ID.
    Agency :    Computer1                Agency : Computer2
    Scheme:    Country                     Scheme: CountryCode
    Value for Computer1                   Value for Computer2
    Australia                                     AU
    India                                           IN
    Austria                                       AU
    Note that I have assigned the same country code 'AU' for the Countries 'Australia' & 'Austria'. But, when we assign 'AU' to 'Austria', the system asks question as below:
    Value mapping already exists
              Australia | AU
              Austria | AU
    Do you want to delete it from the existing group and assign it to the current group instead?
                       Continue       Cancel
    Though choose any of the option, I am not able to assign 'AU' to 'Austria'.
    Friends, this is my requirement. How do we solve this ?
    Kindly help me.
    Kind Regards,
    Jeg P.

    Hi Koen,
        I tried this. Its working fine now. Thanks for giving guidance to me. Then, I have another doubt. Suppose if we create 2 sets of VM table, (First Receiver will act as 2nd one how do we achieve this). For Ex:
    Set 1:
           Source Agency: SYS1              Target Agency: SYS2
           Source Scheme: CODE             Scheme : DEPT
             A                                            HR
             B                                            Accts
             C                                            Finance
    Set 2:
           Source Agency: SYS2              Target Agency: SYS3
           Source Scheme: DEPT             Scheme : GRADE
             HR                                             Second
             Accts                                          First
             Finance                                       First
    In this case, I followed the same logic which you said, but I am not able to create. I think the main point is GUID here. If you have any idea, kindly tell me.
    Kind Regards,
    Jegathees

  • How to exit from SQL*Plus based on the return value of a SQL select stment?

    Hi
    I have a SQL script executed from SQL*Plus. I would like to know if SQL*Plus
    supports any kind of branching or exiting from script execution based on a
    returned value of a SQL select statement. I am on 9i.
    Regards,
    Tamas Szecsy

    in sqlplus, you have whenever
    ex:
    whenever sqlerror exit failure
    insert into ...
    -- if this fails, then you will be out
    insert into ...
    -- if this fails, then you will be out
    whenever sqlerror continue
    insert into ...
    -- if this fails, this continues
    insert into ...and you have PL/SQL
    declare x number;
    begin
    select count(*) into x from emp;
    if (x=14) then null; end if;
    end;
    /note that you can mix those in some case
    -- exit if there is no row in emp
    whenever sqlerror exit 1
    var dummy number
    exec select count(*) into :dummy from emp having count(*)!=0

  • [svn:fx-trunk] 11523: Fix return values for ASyncListView/setItemAt(), removeItemAt(): return failed items if they exist.

    Revision: 11523
    Author:   [email protected]
    Date:     2009-11-06 11:58:50 -0800 (Fri, 06 Nov 2009)
    Log Message:
    Fix return values for ASyncListView/setItemAt(),removeItemAt(): return failed items if they exist.
    QE notes:
    Doc notes:
    Bugs: sdk-24078
    Reviewer: Evtim
    Tests run: AsyncListView Mustella tests pass
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/sdk-24078
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/AsyncListView.as

  • Not able to install onedrive for business, keeps telling its already installed but its not (W7)

    not able to install onedrive for business,  keeps telling its already installed but its not  (W7)
    after a change of the 365 office version OneDrive for business it is not possible to reinstall the software
    it keeps telling me it is already installed.
    I think some settings are still there from the old install.
    how can I remove them or force the reinstall

    yeah finally
    Problem solved! , my tube is back to normal ( to rock )
    all i did is , removed the sys,private,system,resources,data folders from the memory card , switched off my phone , removed the memory card , did a soft reset (*#7370#) and tried to install an application from downloads , i was able to install in the phone memory as memmory card was not inserted then switched off the phone , inserted the memory card and tried to install an application from the downloads, finally i was asked where to install the app. and gave memory card , viola application installed sucessfully
    Regards,
    evil_night13

  • Not able to find values in LOV of field "Help Desk" of Global contract

    Not able to find values in LOV of field "Help Desk" of Global contract defaults.
    This value should be coming from resource setup.
    Resource is already created.

    Issue resolved:
    The resource should ahve valid Email id in HR People setup

  • How to Change the return value for the parameters

    Hi, Can anyone help me with my problem?
    I have a parameter called "P1_Projects" defined in the HTMLDB page, on the report region, there are 2 buttons, one is "Go" button to submit the report on the screen, so user can preview the report, then another button "Export to PDF" can be clicked to generate the report using Oracle Report Services. The "Export to PDF" button will use the same set of parameters submitted for the "Go" button.
    So, the parameter "P1_Projects" is being used by these 2 buttons. and I have to pass a "%" wild card for "All Projects". To make the "Export to PDF" button work, I have to safe encode the return value for "%" to "%25" in order to pass the URL formula, but now my "Go" button doesn't work with "%25", it only recognize the "%" wild card.
    Is there a way to conditionally change the value depends which button is clicked?
    Any hint or help is highly appreciated!
    Hong

    try creating a plsql process which sets the P1_Projects item as required.
    in the plsql you can do:
    if :REQUEST = 'GO' then
    xxx
    else
    xxxx
    end if;
    set the condition to plsql expression:
    :REQUEST in ('GO', 'EXPORT')
    NB. the request value is usually set to the button name when a page is submitted from a button

  • Not able to create index for organization

    in transaction ses_admin, i created an index for business object BAS_BUPA of type 1,ie individual account.
    However, i am not able to create index for BAS_BUPA of type 2
    It says "No entry in table SIC_INDEX_MAIN for index object BAS_BUPA and index 2"

    hi,
    The index is for Business Partner, so it includes both Persons and Organizations. So, only one index needs to be created for both.
    The functioning is correct, just that i missed it.

  • Not able to put reason for rejection at sales order level.

    Hi Gurus,
    I have an issue where I am not able to put reason for rejection for line item in sales order. It gives error as please delete the follow on document purchase order line item number 10. I have already deleted the line item in purchase order. Then tried but did not work. Tried by deleting the purchase requision item also but it did not work.
    Tried to undelete the item from PO and then again tried to put reason for rejection but it could no worked out. 
    Please guide me what can be the solution.
    Regards
    Vinod

    As far a I understand you created PO for line item
    So first check whether GR is reversed or not for PO
    Then mark this line item for deletion in PO and then in PR
    Check if you have created any billing document for PO if so reversed that invoice
    Also check if you have created any delivery for the Line item in sales order if yes then reversed the same
    If you have Sales order related Billing, and if you have done billing reverse the same
    If you have Delivery related Billing, and if you have done billing reverse the same
    After reversing all docuemnts created for Sales order then only try to reject the line item
    You can check table VBFA for document flow

  • Not able to do GR for STO delivery with packing.

    Hi All,
    Hi All,
    I am not able to do GR for STO delivery.
    I am getting the following error:
    Data for creating a delivery is incomplete (Vendor)
    Message no. M7279
    Business scenario:
    STO between two plants of same company code with packing material.
    Sales Org(Supp)-4444
    Sales Org(Rec)- 3333
    Plant(Supp)-2003
    Plant(Rec)-2002
    ME21N->VL10B->PGI->VF01(Proforma)->MIGO w.r.t outbound delivery(error)
    Note: PGI with packing material-separate line item generated for packing material-movement type for main material-641 and for packing material-601)
    with regards
    Azeez.Mohd

    Hi,
    When the stock is going to be moved between two plants or two storage locations that are under single company code called as stock transfer order business process. Receiving plant raises the purchase order with supplying plant; supplying plant delivers the goods to the receiving plant by raising sales order.
    Config Steps
    Create Vendor: Transaction code: XK01
    Assign Plant to Vendor
    Go to change mode of Vendor [XK02]
    Specify Vendor number that we created in the previous step
    Define shipping data for plants
    Create material by maintaining u201CPurchasingu201D view: Transaction code: MM01
    Extend the material from XXXX to YYYY plants
    As we are extending material from plant XXXX into YYYY plant, system copies all the data into the new plant.So that we have to change the delivering plant in delivering plant field as YYYY in Sales: Sales organization data 1 view.
    Create Purchase order: Transaction code: ME21N
    Activities due for Shipping (Purchase order fast display): Transaction code: VL10B
    Display stock in transit: Transaction code: MB5T
    Goods receipt: Transaction code: MIGO
    Stock movement types: INTRAand INTER
     INTRA
    Stand order type (Document type) = UB
    Delivery type = NL
    Determination of document type:
    Supplying plant + Receiving plant = UB
    Supplying plant + UB = NL
    Movement types:
                      Issuing plant Receiving plant
    Single step    647                        101
    Two step        641                        101
     INTER
    Standard order type (Document type) = NB
    Delivery type = NLCC
    Determination of document type:
    Supplying plant + Receiving plant = NB
    Supplying plant + NB = NLCC
    Movement types:
                            Issuing plant Receiving plant
    Single step              645               101
    Two step                 643                101
    PBXX is the Gross price condition type for Stock Transfer Order
    Vendor = Supplying plant
    Customer = Receiving plant
    NOTE: In single step method updations takes place in both plats simultaneously.
    In two-step method updations should takes place manually.

  • Not able to do GR  for PO's , Delivery Completion Indicator Not Ticked

    Hi ,
    In SRM 5.0 
    Users Not able to do GR  for PO's eventhough  Delivery Completion Indicator Not Ticked , having Confirmation Roles
    Either the PO is not appearing in the List or when they click the confirmation icon , the screen is not taking to the next screen to enter the quantity.
    What all must be the probable reasons.
    Thanks & Regards,

    Hello,
    You can check following things,
    1. User in the PO should be correctly assigned in org without any sync errors(check users_gen)
    2. Check in PO if the Confirmation/services performed tick is assigned properly.
    3. Check if the PO in SRM and backend is correctly synchorinzed with PO in Ordered status.
    4. Finally if there is any existing confirmation for the PO, then they can create the next confirmation only after the earlier conf is synchronized with backend, which means it would depend upon your schedule of clean_reqreq_up report.
    Regards,
    Sanjeev

  • My Iphone 5 headset is not working?Not able to hear sound (for eg:Music)

    My Iphone 5 headset is not working?Not able to hear sound (for eg:Music)

    Try disconnecting the headphones and then adjusting the volume, does it say headphones?
    There might be something in the headphone jack, maybe lint, dirt, or something else in there.
    Take a look at this Apple document for more information -> iPhone: Can't hear through the receiver or speakers

Maybe you are looking for

  • How to delete BP from ECC

    Dear experts, CRM BP( sold-to-party ) is linked with ECC customer. When I archived ECC customers, BP sold-to-parties in CRM are not deleted with delta load. Do I need to archive BP in CRM after archiving customers in ECC? Or are there any settings fo

  • No print preview

    Office Jet 5742 has no print preview option. Anyway to attain this option?

  • Regd select query.

    I have a variable 'z' where a value is coming dynamically in the program. This value is the name of one of the date type field of my infotype 0041. eg. z = dar** (any 1 of the 12 fields). My requirement is that i hv to select the value of another fie

  • Problem with menu buttons

    Hi there, I have been using encore cs5 for a while now but have suddenly come across unusual activity when authoring DVD... I render mpg2 and bring it into Encore. I then make chapters on timeline and link to 5 buttons as required. When I preview it

  • TFS Data Bases to New Server

    Hi , we are having TFS 2013 version ..we need to migrate only TFS database server to new server. Please let me know the steps for doing this ..need to restore databases from existing server to new server and Need to point TFS application to Point to