Calling a procedure from a form of Oracle database

Hello

I have a question, we will be calling the procedure from a form of Oracle, and through that we can spend as input values from 1000 to this procedure and that we must return values back to the Oracle form also. Here the damaged take two or more parameters. Please advice.

To receive the input values, we have the input parameter of the procedure as a type object, so that we can receive several parameter values.

Thanks and greetings
Srinivas

user2626293 wrote:
Hi François,

Thanks for your response, please suggest me as to how we can achieve the passage of the parameters that can contain multiple values, by a call to the procedure of the form of the Oracle database

Hi Srinivas,

Here is an example of how...

CREATE OR REPLACE PROCEDURE P_GET_SAL (P_EMPID NUMBER, P_SAL OUT NUMBER)

IS

BEGIN

     SELECT SALARY
     INTO P_SAL
     FROM EMPLOYEE
     WHERE EMPLOYEE_ID=P_EMPID;

END;

SQL> VAR G_SAL NUMBER;

SQL> EXEC P_GET_SAL(100,:G_SAL);

PL/SQL procedure successfully completed.

SQL> PRINT G_SAL;

 G_SAL

----------

      2300

Hope this helps

Hamid

If someone answer is useful or appropriate, please mark accordingly. *

Tags: Oracle Development

Similar Questions

  • Call a procedure from javascript

    Hello

    I would like to help on the following please.

    I have a JavaScript in page region 'function and Global Variable declaration ':
    function openUrl(pUrl) {
      window.open(pUrl,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=1024, height=768");
    }
    In the same page one have a number of standard reports. A number of columns in each of these reports sets a link. The binding for all the columns settings are defined as follows:
    Target: URL
    URL: javascript:openUrl('http://#SERVERNAME#:9704/xmlpserver/Publications/Dock_Report.xdo?_xpf=&_xpt=0&_xdo=%2FPublications%2FDock_Report.xdo&_xmode=4&_paramsID_USU=#ID_USU#&_paramsIDCR=#IDCR#&_paramsIDCU=#IDCU#&_xt=DPol_Layout&_xf=pdf&_xautorun=true');
    As you see, the user of the application, click on the link on the column of the report and a popup is generated showing the report. It all works very well.

    My requirement is to call a procedure from the augments that are included in the column link that was clicked by the user of the application.
    #ID_USU#
    #IDCR#
    #IDCU#
    My question is how to achieve this as the url is inside a call to javascript?

    Can I use the Javascritp set in the page to extract the details, and then use javascript to call a procedure?

    Any help, pointers, ideas, everything is welcome.

    Request Express 4.0.2.00.07

    Thank you

    Published by: zooid on 4 April 2013 22:47

    Have you seen this javascript API? http://docs.Oracle.com/CD/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#BGBJHEHG

    It has very convenient function: apex.submit (pOptions);

    Specify the target URL as:

    JavaScript:rowClick('#ID_USU#',_'#IDCRM#',_'#IDCU#');

    Then add a function to your page somewhere:

    function rowClick(idUsu, idcrm idcu){
    
      openUrl(/*url*/);
      apex.submit({request: "SOME_REQUEST_VALUE", set: {Px_ID_USU: idUsu, Px_IDCRM: idcrm, Px_IDCU: idcu}});
    
    }
    

    (Where you have page elements for each of the items that you want to set.

    Then you can have a process of PL/SQL page, under condition of request = expression 1, term 1 = SOME_REQUEST_VALUE

    And do you want to ;-)

  • Huh?  Or, call a procedure from a dynamic page portlet

    I have a procedure which returns the number of records in a table. Works very well.
    I want to call this procedure from a dynamic page portlet in Oracle portal.
    Here is (close to the) the content of the page:
    < HTML >
    < TITLE > example < /title >
    < ORACLE >
    HTP. P (SCHEMANAME. PROCEDURENAME());
    < / ORACLE >
    < / BODY >
    < / HTML >

    I get an error
    ORA-00900 invalid sql statement.
    Could not be parsed as portal_app - HTP. P (SCHEMANAME. PROCEDURENAME()); WWV-08300
    (The procedure has been granted execute privileges to the public and anonymous.)

    So, it is a FUNCTION and not a PROCEDURE that you are trying to call from a dynamic page? Then try something like the following:

    
    DECLARE
    v_test VARCHAR2(4000);
    BEGIN
    v_test := SCHEMA.FUNCTION();
    htp.p(v_test);
    END;
    
    
  • Migration from SQL Server to Oracle database

    I have 2 questions:

    1. we intend to convert our sql server databases oracle OLTP databases. I tried to use SQL Developer to migrate a database of small sql server to oracle (size 5 GB) database. It was fine. When I tried to migrate to a different database (size 90G), it takes too much time. The problem with sql developer is I can not pick and choose tables. 250 paintings, I need to migrate tables abt 80 (the size will be abt 50 G). What is everyone can share their experiences, as appropriate, converting databases of size average sql server for oracle databases? other options?

    2. I intend to convert the sql server ddl to oracle ddl. I have tested bcp out and use sql loader to import the data. Right now I am manually creating the oracle tables sql server tables. I use http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12069/apa.htm#BABCIIDI to convert the code. Are there other ways better to convert sql DDL DDL Oracle Server?

    Thanks in advance

    DDLS must be converted manually. Oracle is not SQL-Server.

    If for example, you have the option of partitioning, you should consider using the partitioning index and when it is possible. Not all tables must be hash tables. Do postpone you creation of segment or not? What type of tablespace? Set yourself free percentages and allows you to manage when the data block is on the free list and how much is reserved in the block of data to update rows in this block?

    There are many considerations to be taken with regard to the physical database design.

    Using BCP and SQL * Loader sound good. SQL * Loader is fast and scalable - use it to load up to 3.6 million lines every 60 seconds. Direct and parallel charges will give the best performance in this regard (assuming that the underlying table structure and use supports this approach).

  • How to insert the value from the FORM to another database table?

    Hi all

    I have the following problem.

    I have a form that has a tabular layout for the MATURED_FD_DTLtable. (all about 20 line items)

    CREATE TABLE MATURED_FD_DTL

    (

    ACCT_FD_NO VARCHAR2 (17 BYTE) NOT NULL,

    CUST_CODE NUMBER (9),

    FD_AMT NUMBER (15),

    FD_INT_BAL NUMBER (15),

    TDS NUMBER (15),

    CHQ_NO NUMBER (10),

    CREATED_DATE DATE,

    CREATED_BY VARCHAR2 (15 BYTE),

    PREV_YR_TDS NUMBER (15),

    ADD_FD_AMT NUMBER (15),

    DESCRIPTION VARCHAR2 (100 BYTE),

    P_SAP_CODE NUMBER (10),

    P_TYPE VARCHAR2 (1 BYTE)

    )

    By clicking on 'SAVE' button, all values will be automatically is stored in the MATURED_FD_DTLdatabase table.

    But I want to insert these values in another table called TEMP.

    I want to insert values of form only, no table select.

    How can I do this?

    Help me.

    Is Oracle Designer 6i.

    Answer:

    BEGIN

    Commit_form;

    PREMIER_ENREGISTREMENT;

    LOOP

    insert into TEMP_MATURED_FD_DTL

    SELECT * FROM MATURED_FD_DTL WHERE ACCT_FD_NO =: acct_fd_NO;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";

    NEXT_RECORD;

    END LOOP;

    PREMIER_ENREGISTREMENT;

    COMMIT;

    MESSAGE ("RECORD UPDATED AS PAID '");

    MESSAGE (' ', no_acknowledge);

    END;

  • Unable to sent data from jsp to the oracle database

    I'm creating a web application. to do this, I want to create a registration page. and this registration details should be stored in the database.

    I get the error while trying to send data below

    The requested resource (/ cmd/InsertRegtodb) is not available.

    the project name of cmd and InsertRegtodb is the name of the servlet.

    in reality the servlet is this is the address. but it does not connect to it

    There is a servlet as well in the same folder and is accessible from an another jsp. but this servlet is not accessible, even if I used the same code it is used for the servlet which has already worked for me

    Published by: kanna2280 on January 31, 2013 17:30

    Check the map for this servlet and make sure that you send to the path that you have mapped the servlet to.
    Also, write the resuable, testable code by pulling all these calls database of servlet in Java classes that are reusable and testable outside of servlet technology. You will find that your code will be easier to read and write if the concerns are well separated like that.

  • Call the procedure this file download, but not from the URL

    Hello

    Oracle 11g, Apex 4.1.1.00.23.

    I have a procedure that generates a CSV of a query (BLOB). The query uses the apex collections.
    As it seems impossible to use collections of the apex outside Apex, I can't call this procedure from the URL to download the file (the query fails).

    How can I call my procedure on click of a button, without reloading the page, and without calling the URL ?

    I have some ideas like the creation of a new page, with a conditional header process that calls my procedure to download the file, then call it in a popup, etc... but I need a simple solution...

    Thank you.

    Yann.

    PS: actually, I need the same functionality when you change a process, let us say a process page, in the source attribute, you link < police = "courier" > [Download Source] < / font >, this link simply calls < police = "courier" > javascript:doSubmit('DOWNLOAD') < / font >, but it seems that the page is not reloaded. That's exactly what I need, it does not call for any procedure in the URL, and it does not reload the page.

    Use an application process. These run in the security model for APEX, including the use of the collections.

  • Procedure runs in SQL, but not in my form of Oracle

    Hello. I have this code to send a warning message that the user is updating a file on my my form of Oracle database table. I use dbms_scheduler so that it is presented as a background task and so the treatment of electronic mail does not delay my Oracle to quickly record form. If I submit this code in SQL Plus, she runs and I receive the email as expected.
    begin
    dbms_scheduler.create_job (  
         job_name            => 'IMMEDIATE_JOB',  
         job_type            => 'PLSQL_BLOCK',  
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (62547, ''01-SEP-11'', ''02-SEP-11''); end;',  
         number_of_arguments => 0,  
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute  
         enabled             => TRUE,  
         auto_drop           => TRUE,  
         comments            => 'Immediate, one-time run');
    end;
    However if I submit this a subsequent update trigger code in my form, the code runs without error, but my email is never received (the same parameter values would be conveyed to this trigger):
    begin
    
    -- Submit the email notification in the background so as to not slow down the screen while saving.    
    dbms_scheduler.create_job (  
         job_name            => 'IMMEDIATE_JOB',  
         job_type            => 'PLSQL_BLOCK',  
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (:dropper_vacations.dropper_id, :dropper_vacations.begin_dt, :dropper_vacations.end_dt); end;',  
         number_of_arguments => 0,  
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute  
         enabled             => TRUE,  
         auto_drop           => TRUE,  
         comments            => 'Immediate, one-time run');
    end;     
    Any ideas why this might be happening?

    Oh, and of course after that you have a lot of other type conversions that may fail.

    Let's take a look. You propose the work like this:

    job_action => 'begin TTMS.dropperVacationemailurl_new ('||p_dropper_id||','|| p_begin_date||','||p_begin_date||'); end;', 
    

    p_begin_date and p_begin_date (why 2 times start date? in any case). are concattenated in a varchar2, so a type conversion occurs; the date format used is the nls_date_format of your session. If this will result to

    begin TTMS.dropperVacationemailurl_new (1234,01-FEB-11,01-FEB-11); end;
    

    now take this block and run it in SQL * more. I can see miles it won't work, because the date data types that you pass are not yet passed as strings.
    It might work, if you pass them as strings:

    begin TTMS.dropperVacationemailurl_new (1234,'01-FEB-11','01-FEB-11'); end;
    

    but then I say I just change the nls_date_format of my session and break your code, because the implicit conversion from varchar2 to date will fail.

    the very ugly solution for this should be

    job_action => 'begin TTMS.dropperVacationemailurl_new ('||p_dropper_id||',to_date('''|| to_char(p_begin_date,'dd-mon-yy')||''', ''dd-mon-yy''),to_date('''|| to_char(p_begin_date,'dd-mon-yy')||''', ''dd-mon-yy'')'); end;'
    

    If you have a tank that is converted to a date that you go to the external procedure which then gets converted to a tank which then gets converted to a date once again. My head hurts. If simply insert you dates into a table and select the dates in dropperVacationemailurl_new instead of 10000 conversions and pass them you wouldn't make 10000 converts and don't care the date format.

    see you soon

  • Train stuck compilation when I call a procedure

    Hello

    I call a WHEN BUTTON PRESSED trigger procedure in a form.

    The compilation is caught in the Middle when compiling reaches this trigger.

    But when I compile the procedure that is called the form from the outside, its getting compiled successfully.

    Any body can help me on this. Please let me know what could be the reason for this.

    Thank you
    Sameer

    You use a completely outdated version of the forms. At the very least, you should spend the last forms 6i forms, by applying the Patch 18. That will bring you to 6.0.8.27.0 the same level, Oracle does not support, but some of us still use it.

    I think that there has always been problems using the links in the database, so I don't know what would be your solution. .. perhaps build procedures that run on the database to do the work, instead of starting in your form when they need to use the links in the database. Then call the procedures of your form.

  • Hi friends I want to know how to call a procedure that has values arrary as parameter?

    I have a procedure as shown below, and I am using oracle 11g.

    create or replace procedure procedureName (v_hospital_id in NUMBER,

    v_process_id VARR_VARRY,

    v_cnt OUT NUMBER);

    Now, how to call this procedure from PLSQL. If v_process_id values ('abc123', 'xyz234', 'sfs234')

    Please present the definition of VARR_VARRY

    If it's a simple table of varchar2.

    declare

    v_cnt NUMBER;

    Start

    procedureName (1, VARR_VARRY('abc123','xyz234','sfs234'), v_cnt);

    end;

  • call a procedure of package DB type complicated if the type defined in the package itself

    Hello world

    I use jdev 11.1.1.7.0

    I defined a package of data with a procedure and internal two types as follows:

    Create Or Replace Package Db_Package As 
    
    Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) );                        
    Type recordList Is Table Of rec;
    
    Procedure Test_Procedure(p_out out recordList);
    END db_package;
    
    
    

    evil

    I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,

    but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.

    below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not

            CallableStatement plsqlBlock = null;
            String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;";
            try {
                plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
                plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work
                plsqlBlock.executeUpdate();
                Object object = plsqlBlock.getObject(1);      
    
    
            } catch (Exception e) {
                e.printStackTrace();
            }
    
    
    
    

    I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:

    plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
    

    but I wonder how you can call a procedure from the package if the types defined in the package itself.

    Kind regards

    Habib

    JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).

    Dario

  • Error calling a procedure of h

    Hello

    I get the following error when trying to call a procedure from h. I checked and all the settings are correctly transferred. Not sure why it's throwing error. Here is the error message.

    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'AbcPositionDetails '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored


    Any help is appreciated.

    Thanks in advance
    PK

    PK,

    The exception ' wrong number or types of arguments in the call to 'AbcPositionDetails' ' means that you pass incorrect parameters to procedure types or parameter argument is differrent.
    for example, if the procedure definition is AbcPositionDetails (* x * in varchar2, varchar2 y ), you call in AM
    As the appeal procedure (start AbcPositionDetails (* z * =>: 1, t =>: 2); end;)

    To resolve this problem, you must call the procedure (start AbcPositionDetails * (x * =>: 1, => y : 2); end;)
    that is the definition of the procedure does not change
    (or) You can call it that (begin AbcPositionDetails (: 1: 2); end;)

    Thank you
    Kumar

  • Calling a procedure stored since SQL * PUS

    Hi all

    I want to call a procedure from SQL * MORE who returns the number, varchar2 and one OUT parameter as table index.
    I can declare a variable for the number and varchar2.
    How can I manipulate the array index passed into the procedure output parameter.

    Thanks, Sandeep

    declare
    a number, varchar2 (20) b;
    type t as table of varchar2 (10) index directory. -identical to your procedure declaration
    c t;
    Start
    procedure (a, b, c);
    end;
    /

  • Call a procedure only once for the last place of the trigger FOR EACH ROW

    Hello world

    I wonder if someone could help me in the execution of the trigger. My use case what follows:

    -a trigger after each INSERT or UPDATE operation;
    -use FOR EACH ROW algorithm for relaxation;
    -collect certain values inserted/updated fields as: new.uuid and store in a set defined on the layer of the package;
    -only for the last inserted/updated line call a procedure from the global collection with the values collected as a parameter;

    Is it possible to be implemented for the type of the LINE FOR EACH of the trigger? Fact one: new identifier or trigger itself have special attributes such as COUNTY, SIZE to set a size of data inserted or changed to conditional logic? Is there another solution to possible workaround for thoughtful use cases.

    Thank you

    Andrey

    Hi, Andrey,

    I suggest you use 2 triggers:
    (1) A FOR EACH ROW trigger, as you described, to collect relevant data and store it in a temporary table overall or variable poackage. Whenever the trigger is activated, it will overwrite all the data from the previous row.
    (2) AFTER ( NOT FOR EACH ROW) trigger that calls the procedure by using the saved data.

  • MBRC and SYSTEM STATISTICS in Oracle database 10g.

    Hi all

    I am performing the upgrade of Oracle 8i Solaris database to Oracle 10 g HP - UX using the exp/IMP.

    But I have some doubts about the MBRC and system statistics.

    MBRC in Oracle 10 g is adjusted automatically if MBRC parameter is not defined, but I found the value 128 as shown below.
    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    
    SQL> sho parameter multi
    
    NAME                                 TYPE                             VALUE
    ------------------------------------ -------------------------------- ------------------------------
    db_file_multiblock_read_count        integer                          128
    Also, I made a simple full table scan to test... but read scattered file db performs on 128 blocks. So I don't think that 128 and is automatic, I mean MBRC is not defined in consequence he always uses 128.

    The MBRC value affects the performance of the whole base?

    About SYSTEM STATISTICS, I found below result:
    SQL> select * from AUX_STATS$
    SNAME                          PNAME                               PVAL1 PVAL2
    ------------------------------ ------------------------------ ---------- --------------------------------------------------
    SYSSTATS_INFO                  STATUS                                    COMPLETED
    SYSSTATS_INFO                  DSTART                                    11-09-2009 04:59
    SYSSTATS_INFO                  DSTOP                                     11-09-2009 04:59
    SYSSTATS_INFO                  FLAGS                                   1
    SYSSTATS_MAIN                  CPUSPEEDNW                     128.239557
    SYSSTATS_MAIN                  IOSEEKTIM                              10
    SYSSTATS_MAIN                  IOTFRSPEED                           4096
    SYSSTATS_MAIN                  SREADTIM
    SYSSTATS_MAIN                  MREADTIM
    SYSSTATS_MAIN                  CPUSPEED
    SYSSTATS_MAIN                  MBRC
    SYSSTATS_MAIN                  MAXTHR
    SYSSTATS_MAIN                  SLAVETHR
    Now if it is better NOWORKLOAD or workload, and this server is still in the process of building... so how can I accumulate the workload statistics, as it is not possible to make a high load on this server? Is he really need to collect system statistics, what will happen with stats NOWORLOAD?

    I saw no single database where system stats are gathered in our organization with more than 2000 databases.

    -Yasser

    Perhaps what this article written by Tom Kite help:

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:499197100346264909

Maybe you are looking for