Hiding button after successfull call to databse procedure

Hi,
This is my first post and my first APEX app.
I have a submit button that calls a database procedure passing parameters from the form.
The procedure then updates the database record and the page shows the update which means its successfull.
However the user can press the button again.
I do not want the user to press the button again, so i want to hide it after successful completion of the databse procedure.
I tried using Dynamic action and hide it that way by comparing the value that was updated by the database (P1_STATUS) and the
value that the user wanted it updating to (passed as a parameter to db procedure P1_PARAM) but it does not work for the button for some reason.
Is there a way round this by using javascript/apex computations etc.
Any help would be appreciated or if you could point me in the right direction
Thank you

You can also hide it with javascript:
onclick="$x_Hide(this);"However that will hide it at the outset and not when the DB procedure finishes. Don't know if that would be a functional problem for you or not. The advantage is that it will hide immediately so the user cannot press it again while the DB procedure is going.

Similar Messages

  • ADF call stored Oracle procedure - make transaction dirty

    Hi all,
    I have the next question:
    my ADF application is doing massive data processing that I placed in Oracle stored procedure/package to improve performance.
    Data processing takes 1-2 sec. I'm not doing any commit/rollback in my PL/SQL code.
    I have "Save"/"Undo" button in the GUI and I want, that an end user to make corresponding action to commit/rollback data by pressing one of the buttons.
    Normally those buttons are disabled since transaction is not dirty.
    Is it possible to mark transaction dirty, so that "Save"/"Undo" buttons are available?
    I know I can make buttons always available, but I not allowed to do so.
    Are any other workarounds? Or can it be done in another proper way?
    Thanks.
    Alexander

    Hi Timo!
    well , good idea!
    and I've already tried to fight with issue when I was getting transaction dirty by clicking on transient checkbox-attribute and tried to find a way to make a dirty transaction to clean :).
    What do you think if I run something like:
    this.saveButton.setDisabled(false);
    this.undoButton.setDisabled(false);
    after a call to stored procedure and use the next code
    this.saveButton.setValueExpression("disabled",getValueExpression("#{!bindings.Commit.enabled}"));
    this.saveButton.setValueExpression("disabled",getValueExpression("#{!bindings.Rollback.enabled}"));
    in commit/Save & rollbak/Undo button handlers? Would it work?
    Alexander

  • Calling of Stored Procedure in After Insert Trigger

    Can I call a Stored Procedure in After Insert Trigger ?
    Please send a sample code (good example) of After Insert Trigger.
    Thanks.

    Kishore,
    I have two table WLCS_ORDER, WLCS_ORDER_LINE
    WLCS_ORDER - It holds order header information like
    ORDER_ID
    CUSTOMER_ID
    TRANSACTION_ID
    STATUS
    ORDER_DATE
    SHIPPING_METHOD
    SHIPPING_AMOUNT
    SHIPPING_CURRENCY
    PRICE_AMOUNT
    PRICE_CURRENCY
    SHIPPING_GEOCODE
    SHIPPING_STREET1
    SHIPPING_STREET2
    SHIPPING_CITY
    SHIPPING_STATE
    SHIPPING_COUNTRY
    SHIPPING_POBOX
    SHIPPING_COUNTY
    SHIPPING_POSTAL_CODE
    SHIPPING_POSTAL_CODE_TYPE
    SPECIAL_INSTRUCTIONS
    SPLITTING_PREFERENCE
    ORDER_SUBTOTAL
    WLCS_ORDER_LINE - It holds all order lines information like
    ORDER_LINE_ID
    QUANTITY
    PRODUCT_ID
    TAX_AMOUNT
    TAX_CURRENCY
    SHIPPING_AMOUNT
    SHIPPING_CURRENCY
    UNIT_PRICE_AMOUNT
    UNIT_PRICE_CURRENCY
    MSRP_AMOUNT
    MSRP_CURRENCY
    DESCRIPTION
    ORDER_ID
    TOTAL_LINE_AMOUNT
    Relation between WLCS_ORDER, WLCS_ORDER_LINE is one to many.
    For each WLCS_ORDER row, one or more order lines will insert into WLCS_ORDER_LINE table.
    For each new row in WLCS_ORDER table, I have to update the following columns in both the tables with my maths.
    WLCS_ORDER
    shipping_amount
    price_amount
    order_subtotal
    WLCS_ORDER_LINE
    shipping_amount
    I thought I can do this in after insert trigger, But if it is not possible, Please give the best way to fulfill this requirement.
    I appreciate your help.
    Have a great day.
    Srinivas

  • Calling PLSQL Stored Procedure From HTML Form Submit Button

    Hi there,
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
    Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
    So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
    Seems pretty simple but I am not sure how to make this happen... My thoughts were:
    Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
    Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
    Thanks so much in advance!
    - Jeff

    795018 wrote:
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
    The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2 );
    end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
    URL:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
    PL/SQL call:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2, birthdate => :value3 );
    end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
    Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
    The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
    You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
    All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
    Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on.

  • Close current swf after a button clicked to call for another swf

    daftar_isi.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);
    import fl.display.ProLoader;
    var fl_ProLoader_2:ProLoader;
    var fl_ToLoad_2:Boolean = true;
    function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void
      if(fl_ToLoad_2)
      fl_ProLoader_2 = new ProLoader();
      fl_ProLoader_2.load(new URLRequest("daftarisi_c.swf"));
      addChild(fl_ProLoader_2);
      else
      fl_ProLoader_2.unload();
      removeChild(fl_ProLoader_2);
      fl_ProLoader_2 = null;
      fl_ToLoad_2 = !fl_ToLoad_2;
    What script should i add to kill this current swf after i clicked on "daftar_isi" button which will play daftarisi_c.swf?
    thanks.

    Thx ned. The new swf is added above the first swf. I need to kill the first swf when i click on the "daftar_isi" button inside first swf after it call out the new swf.
    So the button have 2 function at the same time when clicked:
    1. Call out the new swf
    2. Kill the current swf itself

  • Can rs.last() be used after calling the stored procedure?

    Can rs.last() be used after calling the stored procedure? If yes what should be the CURSOR types?

    Can rs.last() be used after calling the stored
    procedure? If yes what should be the CURSOR types?That would depend on the driver/database.
    And as I said in your other post it is far more efficient to count records by just returning a count rather than a complete collection regardless of how you get to the end.

  • Problem with JDBC results calling simple stored procedure in VC 7.0

    Hi all,
    I am building a simple VC model which calls a stored procedure on a JDBC database. I have created the system in the portal, defined the alias and user mapping, the connection test is fine and the VC "find data" lists my bespoke stored procedure.
    The stored procedure is :
    CREATE PROCEDURE dbo.dt_getBieUsers
    AS
    select * from dbo.emailuserlink
    GO
    When I test it using query analyser, it returns 3 records each with the two fields I expect - user and email address.
    I drag the model onto the workspace in VC and create an input form ( with just a submit button ). i drag the result port out to create a table. This has no fields in it.
    I build and deploy as flex and the app runs, I click the submit button and SUCCESS! I get 3 records in my table each with 2 fields. The data is all correct. The problem with this is the fields are determined at runtime it seems.
    I go back to the table and add 2 columns "email" and "address".
    i build and deploy and run the app. Again I get 3 records, but this time the contents of all of the rows is not data, but "email" and "address". The data has been replaced by the header texts in all of the rows.
    Can anyone help? Why isn't the data being put in my columns as I would expect?
    I tried to build and deploy the app as Web Dynpro rather than Flex to see if it was a bug in Flex. The application starts but when I click the submit button to run the JDBC stored procedure I get a 500 Internal Server Error
    com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No configuration is defined for the entry JDBCFunction
        at com.sap.tc.wd4vc.xglengine.XGLEngine.createComponentInternal(XGLEngine.java:559)
        at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstanceFromUsage(XGLEngine.java:362)
        at com.sap.tc.wd4vc.xglengine.XGLEngine.getCompInstance(XGLEngine.java:329)
        at com.sap.tc.wd4vc.xglengine.wdp.InternalXGLEngine.getCompInstance(InternalXGLEngine.java:167)
        at com.sap.tc.wd4vc.xglengine.XGLEngineInterface.getCompInstance(XGLEngineInterface.java:165)
    The JDBC connection I am using has a connection URL of jdbc:sap:sqlserver://localhost;DatabaseName=BIEUSERS
    and a driver class of com.sap.portals.jdbc.sqlserver.SQLServerDriver
    Can anyone solve my wierd problems?
    Cheers
    Richard

    Hi Richard,
    After you drag and drop the data service, right click on it and choose "Test data service". Then click on "Execute" and after you see the result on the right, click on "Add fields" button (inside the same window). Now you'll see that the fields are on the tabel. This is required only for JDBC data services, since this data (how the resultset is built) is not know in DT and it needs to be run firest - then analysed and only then you have to add the fields to the table).
    Regards,
    Natty

  • Forms - Calls to stored procedures instead of standard database actions

    After discovering Reports, I'm now getting started with Forms in APEX. :)
    While I like the basic functionalities offered by the different Wizards, there's one thing that bothers me. After creating your form, you basically get 3 buttons (not counting cancel) for the different actions, each corresponding with a Database Action (SQL INSERT/UPDATE/DELETE). This is nice, but it's not exactly what I want. I would like to replace the direct database actions by calls to stored procedures (in a package), one for each action. It would be nice, of course, to keep the Wizard advantages, especially considering the fact I would like to find a standard, easy way to create forms. So, basically, I would like to create my forms this way, but instead of linking the button to a predefined database action, have it call a stored procedure. Is this somehow possible and what would be the easiest way to realize this?
    I'm running APEX 4.0.1.00.03 on an Oracle XE database.
    Erwin

    Okay, this was working nicely. But I must be missing something...
    I made an (interactive) report and added two link columns, one for the update and one for the delete (the insert is handled by a non-row related create button). I also created 3 forms on a procedure, one for each action (I/U/D). Now, when I call my form page from the report, I want to pass the values of the different columns of the selected record to this form, so the user can view and adapt them. Seems quite logical to me. There's only one problem. The column link seems to be limited to 3 items? Euh... am I missing something or is this not the way to do this.
    Let me illustrate this with an example.
    I created an UPDATE form, linked to a procedure to modify a given city.
    This procedure has the following parameters:
    - ID (hidden on the form)
    - PROVINCE
    - ZIP CODE
    - NAME
    - DESCRIPTION
    On the other hand, I have my report which gives an overview of the cities. This report has the following columns:
    - ID
    - PROVINCE
    - ZIP CODE
    - NAME
    - DESCRIPTION
    I also added 2 empty columns to contain the UPDATE and DELETE links. Basically, I just use these to place a nice icon for the different actions.
    Now, when I click on one of these icons, I want to pass the field values of the selected row to my form. In this case, that means I want to pass 5 values to the 5 items of my form. BUT, under the link column, I see only 3 items? Am I missing something really stupid or am I handling this the wrong way?
    Erwin

  • I am getting ORA-01403: no data found error while calling a stored procedur

    Hi, I have a stored procedure. When I execute it from Toad it is successfull.
    But when I call that from my java function it gives me ORA-01403: no data found error -
    My code is like this -
    SELECT COUNT(*) INTO L_N_CNT FROM TLSI_SI_MAST WHERE UPPER(CUST_CD) =UPPER(R_V_CUST_CD) AND
    UPPER(ACCT_CD)=UPPER(R_V_ACCT_CD) AND UPPER(CNSGE_CD)=UPPER(R_V_CNSGE_CD) AND
    UPPER(FINALDEST_CD)=UPPER(R_V_FINALDEST_CD) AND     UPPER(TPT_TYPE)=UPPER(R_V_TPT_TYPE);
         IF L_N_CNT >0 THEN
              DBMS_OUTPUT.PUT_LINE('ERROR -DUPlicate SI-1');
              SP_SEL_ERR_MSG(5,R_V_ERROR_MSG);
              RETURN;
         ELSE
              DBMS_OUTPUT.PUT_LINE('BEFORE-INSERT');
              INSERT INTO TLSI_SI_MAST
                   (     CUST_CD, ACCT_CD, CNSGE_CD, FINALDEST_CD, TPT_TYPE,
                        ACCT_NM, CUST_NM,CNSGE_NM, CNSGE_ADDR1, CNSGE_ADDR2,CNSGE_ADDR3,
                        CNSGE_ADDR4, CNSGE_ATTN, EFFECTIVE_DT, MAINT_DT,
                        POD_CD, DELVY_PL_CD, TRANSSHIP,PARTSHIPMT, FREIGHT,
                        PREPAID_BY, COLLECT_BY, BL_REMARK1, BL_REMARK2,
                        MCC_IND, NOMINATION, NOTIFY_P1_NM,NOTIFY_P1_ATTN , NOTIFY_P1_ADDR1,
                        NOTIFY_P1_ADDR2, NOTIFY_P1_ADDR3, NOTIFY_P1_ADDR4,NOTIFY_P2_NM,NOTIFY_P2_ATTN ,
                        NOTIFY_P2_ADDR1,NOTIFY_P2_ADDR2, NOTIFY_P2_ADDR3, NOTIFY_P2_ADDR4,
                        NOTIFY_P3_NM,NOTIFY_P3_ATTN , NOTIFY_P3_ADDR1,NOTIFY_P3_ADDR2, NOTIFY_P3_ADDR3,
                        NOTIFY_P3_ADDR4,CREATION_DT, ACCT_ATTN, SCC_IND, CREAT_BY, MAINT_BY
                        VALUES(     R_V_CUST_CD,R_V_ACCT_CD,R_V_CNSGE_CD,R_V_FINALDEST_CD,R_V_TPT_TYPE,
                        R_V_ACCT_NM,R_V_CUST_NM ,R_V_CNSGE_NM, R_V_CNSGE_ADDR1,R_V_CNSGE_ADDR2, R_V_CNSGE_ADDR3,
                        R_V_CNSGE_ADDR4,R_V_CNSGE_ATTN,     R_V_EFFECTIVE_DT ,SYSDATE, R_V_POD_CD,R_V_DELVY_PL_CD,R_V_TRANSSHIP ,R_V_PARTSHIPMT , R_V_FREIGHT,
                        R_V_PREPAID_BY ,R_V_COLLECT_BY ,R_V_BL_REMARK1 ,R_V_BL_REMARK2,R_V_MCC_IND,
                        R_V_NOMINATION,R_V_NOTIFY_P1_NM, R_V_NOTIFY_P1_ATTN, R_V_NOTIFY_P1_ADD1, R_V_NOTIFY_P1_ADD2,
                        R_V_NOTIFY_P1_ADD3, R_V_NOTIFY_P1_ADD4, R_V_NOTIFY_P2_NM, R_V_NOTIFY_P2_ATTN, R_V_NOTIFY_P2_ADD1,
                        R_V_NOTIFY_P2_ADD2, R_V_NOTIFY_P2_ADD3, R_V_NOTIFY_P2_ADD4, R_V_NOTIFY_P3_NM, R_V_NOTIFY_P3_ATTN,
                        R_V_NOTIFY_P3_ADD1, R_V_NOTIFY_P3_ADD2, R_V_NOTIFY_P3_ADD3, R_V_NOTIFY_P3_ADD4,
                        SYSDATE,R_V_ACCT_ATTN,R_V_SCC_IND,R_V_USER_ID,R_V_USER_ID
                        DBMS_OUTPUT.PUT_LINE(' SI - REC -INSERTED');
         END IF;

    Hi,
    I think there is a part of the stored procedure you did not displayed in your post. I think your issue is probably due to a parsed value from java. For example when calling a procedure from java and the data type from java is different than expected by the procedure the ORA-01403 could be encountered. Can you please show the exact construction of the call of the procedure from within java and also how the procedure possible is provided with an input parameter.
    Regards, Gerwin

  • How to call a parametrized procedure from a htp.formsubmit

    Hi there, i'm trying to call a procedure with parameters from my formsubmit. i would like to call that procedure once my submit button is pressed. I did this :
    HTP.formOpen(twbkwbis.f_cgibin||'MyPackage.MyProcedure(param1, param2, param3, param4)');
    twbkfrmt.P_PrintText('<input type=submit name=ACTION  value="Soumettre">');
    HTP.formClose;
    but i had that 404 error page not found .
    i also did this :
    twbkfrmt.P_PrintText( htf.formSubmit(NULL, 'Soumettre', cattributes=>'ONCLICK= " return MyProcedure(param1, param2, param3, param4) " ') );
    and still the same error...does anyone have an idea to help me with this...thank you
    Edited by: user11146505 on 2009-07-10 06:49
    Edited by: user11146505 on 2009-07-10 06:51
    Edited by: user11146505 on 2009-07-10 06:52
    Edited by: user11146505 on 2009-07-10 06:52
    Edited by: user11146505 on 2009-07-10 06:54
    Edited by: user11146505 on 2009-07-10 06:55
    Edited by: user11146505 on 2009-07-10 06:55
    Edited by: user11146505 on 2009-07-10 06:57

    Hello and welcome to the list,
    To call your MyPackage.MyProcedure procedure as the submit action of a form use code like this:
    HTP.formopen('MyPackage.MyProcedure ','POST');
    HTP.formtext('param1');
    HTP.formtext('param2');
    HTP.formtext('param3');
    HTP.formtext('param4');
    HTP.formsubmit(cvalue=>'Soumettre');
    HTP.formclose;Note that when your code gets called it will be passed named parameters corresponding to each of the fields defined in the form, so if your procedure has 4 paramters named param1, param2, param3, param4 then you need 4 fields on your form with the same names, additionally the should each be defined with a default value such as NULL since unfilled fields on the report are not guaranteed to be passed to your procedure. If you have fields in your form with names other than the paramter names in your procedure you will get an error.
    As you can see there is no need to define the parameters in the formopen procedure, and no need to define an onclick handler on the submit button. Also you don't want to name the submit button unless you are going to pass the value of the buttons label (the cValue) to your procedure as a paramter.

  • Ssrs 2008 r2 report dataset call a stored procedure

    I am modifying an existing SSRS 2008 r2 report. In a dataset that already exists within the ssrs 2008 r2 report I need execute
    a stored procedure called StudentData and pass 3 parameter values to the stored procedure. The stored procedure will then return 5 values that are now needed for the modified ssrs report. My problem is I do not know how to have the dataset call the stored procedure
    with the 3 parameter values and pass back the 5 different unique data values that I am looking for.
    The basic dataset is the following:
    SELECT  SchoolNumber,
            SchoolName,
            StudentNumber,      
     from [Trans].[dbo].[Student]
     order by SchoolNumber,
              SchoolName,
              StudentNumber
    I basically want to pass the 3 parameters of SchoolNumber, SchoolName, and StudentNumber to the
    stored procedure called StudentData from the data I obtain from the [Trans].[dbo].[Student]. The 3 parameter values will be obtained from the sql listed above.
    The  columns that I need from the stored procedure called  StudentData will return the following data columns
    that I need for the report: StudnentName, StudentAddress, Studentbirthdate, StudentPhoneNumber, GuardianName.
    Thus can you show me how to setup the sql to meet this requirement I have?

    Hi wendy,
    After testing the issue in my local environment, we can refer to the following steps to achieve your requirement:
    Create three multiple parameters named SchoolNumber, SchoolName and StudentNumber in the report. Those available values from the basic dataset SchoolNumber, SchoolName and StudentNumber fields.
    If you want to pass multiple values parameter to stored procedure, we should create a function as below to the database:
    CREATE FUNCTION SplitParameterValues (@InputString NVARCHAR(max), @SplitChar VARCHAR(5))
    RETURNS @ValuesList TABLE
    param NVARCHAR(255)
    AS
    BEGIN
    DECLARE @ListValue NVARCHAR(max)
    SET @InputString = @InputString + @SplitChar
    WHILE @InputString!= @SplitChar
    BEGIN
    SELECT @ListValue = SUBSTRING(@InputString , 1, (CHARINDEX(@SplitChar, @InputString)-1))
    IF (CHARINDEX(@SplitChar, @InputString) + len(@SplitChar))>(LEN(@InputString))
    BEGIN
    SET @InputString=@SplitChar
    END
    ELSE
    BEGIN
    SELECT @InputString = SUBSTRING(@InputString, (CHARINDEX(@SplitChar, @InputString) + len(@SplitChar)) , LEN(@InputString)-(CHARINDEX(@SplitChar, @InputString)+ len(@SplitChar)-1) )
    END
    INSERT INTO @ValuesList VALUES( @ListValue)
    END
    RETURN
    END
    Use the query below to create a stored procedure, then use it to create a dataset to return 5 values:
    create proc proc_test(@SchoolNumber nvarchar(50),@SchoolName nvarchar(50),@StudentNumber nvarchar(50))
    as
    begin
    select StudnentName, StudentAddress, Studentbirthdate, StudentPhoneNumber, GuardianName
    from table7 where SchoolNumber in (SELECT * FROM SplitParameterValues (@SchoolNumber,','))  and SchoolName in(SELECT * FROM SplitParameterValues (@SchoolName,','))  and StudentNumber in (SELECT * FROM SplitParameterValues (@StudentNumber,','))
    end
    Right-click the new dataset to modify the parameter value in the Parameters pane as below:
    =join(Parameters!SchoolNumber.Value,",")
    =join(Parameters!SchoolName.Value,",")
    =join(Parameters!StudentNumber.Value,",")
    For more details about pass multi-value to stored procedure, please see:
    http://munishbansal.wordpress.com/2008/12/29/passing-multi-value-parameter-in-stored-procedure-ssrs-report/
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • How to call an Oracle Procedure and get a return value in Php

    Hi Everyone,
    Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
    The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
    My code after the connection call is as follows:
    $cur = ora_open($this->conn);
    ora_commitoff($this->conn);
    $requestid = '144937';
    echo $requestid;
    $rc = ora_parse($cur, "begin p_ins_gsdata2
    (:requestid, :returnval); end;");
    if ($rc == true) {
    echo " Parse was successful ";
    $rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
    if ($rc2 == true) echo " Requestid Bind Successful ";
    $rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
    if ($rc3 == true) echo " Returnval Bind Successful ";
    $returnval = "0";
    $rc4 = ora_exec($cur);
    echo " Result = ".$returnval." ";
    if ($rc4 == false) {
    echo " Exec Returned FALSE ";
    echo " Error = ".ora_error($cur);
    echo " ";
    echo "ErrorCode = ".ora_errorcode($cur);
    echo "Error Executing";
    ora_close ($cur);
    The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
    CREATE OR REPLACE procedure p_ins_gsdata2 (
    p_requestid IN varchar2 default null,
    p_retcode OUT varchar2)
    as
    BEGIN
    SELECT COUNT (*) INTO p_retcode
    FROM S_GSMRY_DATA_SURVEY
    WHERE request_id = p_requestid ;
    COMMIT;
    RETURN;
    END;
    Nothing much there. I want to do an insert into a table,
    from the procedure later, but I figured that I start with a select count since it's simpler.
    When I ran the Php code, I get the following:
    144937
    Parse was successful
    Requestid Bind Successful
    Returnval Bind Successful
    Result = 0
    Exec Returned FALSE
    Error = ORA-00000: normal, successful completion -- while
    processing OCI function OBNDRA
    ErrorCode = 0
    Error Executing
    I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
    Thanks again in advance for your help. Have a great day.
    Regards,
    Rudi

    retcode=`echo $?`is a bit convoluted. Just use:
    retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
    replace the EXEC line with :
    select 'hello' from dual;
    and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea.

  • SQLException while calling a Stored Procedure in Oracle

    Hi all,
    I am getting this error while calling a Stored Procedure in Oracle...
    java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
    at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
    at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
    The Program is ...
    import java.sql.*;
    public class StoredProcedureDemo {
         public static void main(String[] args) throws Exception {
              Connection con = null;
              ResultSet rs = null;
              Statement st = null;
              CallableStatement cs = null;
              int i;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
                   System.out.println("Got Connection ");
                   st = con.createStatement();
                   String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
                             +" Emp_name VARCHAR2(10);"
                             +" CURSOR c1 (Depno NUMBER) IS"
                             +" SELECT Ename FROM emp WHERE deptno = Depno;"
                             +" BEGIN"
                             +" OPEN c1(Dept_num);"
                             +" LOOP"
                             +" FETCH c1 INTO Emp_name;"
                             +" EXIT WHEN C1%NOTFOUND;"
                             +" END LOOP;"
                             +" CLOSE c1;"
                             +" END;";
                   System.out.println("Stored Procedure is \n"+createProcedure);
                   i = st.executeUpdate(createProcedure);
                   System.out.println("After creating the Stored Procedure "+i);
                   cs = con.prepareCall("{call Get_emp_names(?)}");
                   System.out.println("After calling the Stored Procedure ");
                   cs.setInt(1,20);
                   System.out.println("Before executing the Stored Procedure ");
                   rs = cs.executeQuery();
                   System.out.println("The Enames of the given Dept are ....");
                   while(rs.next()) {
                        System.out.println("In The while loop ");
                        System.out.println(rs.getString(1));
              catch (Exception e) {
                   e.printStackTrace();
    Stored Procedure is ...
    create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
    Emp_name VARCHAR2(10);
    CURSOR c1 (Depno NUMBER) IS
    SELECT Ename FROM emp WHERE deptno = Depno;
    BEGIN
    OPEN c1(Dept_num);
    LOOP
    FETCH c1 INTO Emp_name;
    EXIT WHEN C1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;
    Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
    thanks and regards
    Shyam Krishna

    The first solution is to not do that in java in the first place.
    DDL should be in script files which are applied to oracle outside of java.
    Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation.

  • Calling a stored procedure

    hello,
    i am using ADF JSF technology.in my JSF page , i have a button. when button pressed, i need to call a stored procedure. How to write this in my backing bean that responce to the Event. and also how to pass the parameters from my JSF page( values in fields)!!!!!!!!!!
    Please Reply as soon as possible and provide me with example..
    thanks

    Hi,
    the documentation provides all this
    http://download-uk.oracle.com/docs/html/B25947_01/toc.htm
    See chapter 25.5
    Frank

  • Calling a stored procedure with argument as column name

    hi
    i am calling a stored procedure mapping_audit_errors_inserts
    whose definition is as follows
    PROCEDURE mapping_audit_errors_inserts (
    in_ma_seq_id IN ETL_MAPPING_AUDIT_ERRORS.ma_seq_id%TYPE,
    in_etl_stage IN ETL_MAPPING_AUDIT_ERRORS.etl_stage%TYPE,
    in_sqlerrcode IN ETL_MAPPING_AUDIT_ERRORS.sqlerrcode%TYPE
    IS
    BEGIN
    mapping_audit_ora_errors (in_ma_seq_id,
    in_etl_stage,
    in_sqlerrcode,
    get_error_message (in_sqlerrcode)
    END;
    now i need to call this procedure as
    mapping_audit_errors_inserts(MA_SEQ_ID.currval,1,v_error_code)
    [ v_error_code:=SQLCODE;]
    it is giving error as
    PLS-00201: identifier 'MA_SEQ_ID.CURRVAL' must be declared
    can anyone calrify me on this.
    Thanks

    Anwar is likely correct about the reason for your error. The other possibility is that the owner of the procedure calling mapping_audit_errors_inserts does not have SELECT on the sequence granted directly to them.
    However, even after creating the sequence, if the session calling the procedure has not got a value from the sequence prior to trying to use CURRVAL, you will get:
    SQL> CREATE PROCEDURE p(p_id IN NUMBER) AS
      2  BEGIN
      3     DBMS_OUTPUT.Put_Line('ID is '||p_id);
      4  END;
      5  /
    Procedure created.
    SQL> DECLARE
      2     l_no NUMBER;
      3  BEGIN
      4     SELECT ma_seq_id.CURRVAL INTO l_no
      5     FROM dual;
      6     p(l_no);
      7  END;
      8  /
    DECLARE
    ERROR at line 1:
    ORA-08002: sequence MA_SEQ_ID.CURRVAL is not yet defined in this session
    ORA-06512: at line 4And, just to reinforce Anwar's point about selecting it into a variable, if you try to pass CURRVAL to a procedure, you will get:
    SQL> DECLARE
      2     l_no NUMBER;
      3  BEGIN
      4     SELECT ma_seq_id.NEXTVAL INTO l_no
      5     FROM dual;
      6     p(ma_seq_id.CURRVAL);
      7  END;
      8  /
       p(ma_seq_id.CURRVAL);
    ERROR at line 6:
    ORA-06550: line 6, column 16:
    PLS-00357: Table,View Or Sequence reference 'MA_SEQ_ID.CURRVAL' not allowed in
    this context
    ORA-06550: line 6, column 4:
    PL/SQL: Statement ignoredTTFN
    John

Maybe you are looking for

  • Java sun Application Server  9 error

    When trying to deploy an application i get sql error. Using Netbeans 5.5. The database is mysql. Using Create Entity from Database wizard Any idea what i can do to fix this? Deploying application in domain failed; Internal Exception: java.sql.SQLExce

  • Trying to install CC apps, Progress bar stuck

    I have spent most of my day trying to get the Creative Cloud desktop application installed (I have had to now create a new user on my computer which has seemingly fixed that), and when I tried to install Audition as a test, the progress bar got stuck

  • Importing and moving MP3 playlist from CD to hard disk

    Hi, The source of one of my playlists is a CD with files in MP3 format. I've addded the playlist to iTunes but want to physically move the playlist into my iTunes library on the hard disk so that I don't need the CD in the drive to play it. I know ho

  • HT1491 how do I sync my device with the new itunes software???

    With the new upgraded itunes software, I can purchase new music but can't figure out how to sync it to my Ipod.  I've looked everywhere to find how to do it.  Before it was so easy to drag and drop.  Can anyone help me?

  • BI Publisher Admin Rights

    HI, I need to know how we can block admin in bi publisher.. as all the users are able to see the Admin in bi publisher.. as users need to have reports history and schedules.. but we are unable to block admin..how can we do this any help on this..