Call to the stored procedure parameter passing script

Hello

I have a database on linux server. On the same server, there is a shell script which takes 3 parameters.

Now I want to do a procedure (stored procedure) that will have 3 parameters pass and run this script with these settings.

I had created object directory pointing to the correct directory granted all privileges on it (I hope).

Now, I wondered how the code of procedure?

I also did a program within the database which takes 3 parameters, but I don't know how to operate it. I don't know if I can use work to run the program, because

It is a multi user thing and I think that this will not work as expected if 2 or more users run it.

In any case, I was hoping that I can solve this problem by creating the procedure that will run the script that is provided with 3 parameters, that I need.

I hope I'm clear on what I want to do.

Please if you have an idea how to Edifier post your ideas.

Thank you!

Hello

first I want to thank you for the reply.

option 1... I don't want not to use java or c because I have no skills in programming languages.

option 2 you mentioned dbms_scheduler.

If I understand the procedure should go like that.

I create whitin database program. Then I create a job which runs this program. And whenever I want to run my shell script, I'll do the work.

WHA happen if 2 different users will want to run the script at the same time?

Thank you for your response.

Tags: Database

Similar Questions

  • How to pass the content of the table as OUT of the stored procedure parameter

    Hi all

    I am writing a stored procedure where he must accept date as one of the parameters IN and it must interrogate the table of database on this criterion and should address data in a temporary table.

    in the end, he must send all the data from the temporary table as the OUT parameter.

    How to get there? should I create a new TYPE with all the columns in the Temp table and use this Type as a parameter? or SYS_REFCURSOR is the best option.

    Thanks in advance.

    Hello

    The best way to do what you want depends on what you want.  Start by describing what you need to do.  It is best to post some data examples (CREATE TABLE and INSERT statements), and what results you want from this sample data.  (See the FAQ forum: https://forums.oracle.com/message/9362002)

    If you have any ideas on how to do the work (for example, populating a temporary table) it may be useful to include those who, too, but a clear distinction between WHAT you do and HOW you do it.

    Bencol suggested, a SYS_REFCURSOR may be the best way to transmit the results.

    Since you only post your table, or even describe what you wanted to do with it, I will illustrate using scott.emp, which is probably on your system.

    Say you want a procedure that takes a DATE as an argument, then returned a certain designated columns (empno, ename, and hiredate in the example below) for all employees hired from the given DATE.  You can write a procedure like this:

    CREATE OR REPLACE PROCEDURE hired_since

    (IN start_date DATE

    out_data ON SYS_REFCURSOR

    )

    AS

    BEGIN

    OPEN FOR Out_data

    SELECT ename, empno, hiredate

    FROM scott.emp

    WHERE hiredate > = start_date;

    END hired_since;

    /

    DISPLAY ERRORS

    You can test it in SQL * more like this:

    VARIABLE c REFCURSOR

    EXEC hired_since (DATE ' 1982-01-01',: c);

    PRINTING: c

    The output I received this test was:

    ENAME, EMPNO, HIREDATE

    ---------- ---------- ---------

    7788 SCOTT APRIL 19, 87

    7876 ADAMS MAY 23, 87

    7934 MILLER JANUARY 23, 82

  • Question about handling apostrophe in the stored procedure parameter

    I was wondering how people have dealt with this problem.  In my process I use the operation to execute stored procedure (sp) to write data to a database, and it is by the way the field values to the sp as parameters.  Works fine when everything is normal but as soon as an apostrophe is added in one of the fields, ka-boom.  It breaks .  So I have been messing around with the means to fight against this problem and did not really come wih an appropriate option.  I know that I can go on the form and write a few RegEx and change the single apostrophe double that would work, but I have to write in several events since the form is sent to someone else and I can't have them seeing "clerk"s"instead of"clerk".  Right now I'm writing an xpath statement that would replace the single apostrophe with a double bed with no luck.  I was wondering if anyone else has had this problem and found an easy solution.  Thank you

    Mike

    Why not use the parameterized query option.

    In this way, your settings are replaced by some? and you don't get messed up with the '

    Your select statement would look like: select * from table where column1 =? and column2 =?

    Then you can map the? s in the process variables.

    Jasmine

  • two related issues: to call the stored procedure and passing in an array of elements using htmldb_Get

    I need to save items of ApEx generated dynamically via AJAX.  I use the APEX_ITEM API to generate the elements.  At runtime, I have no idea how much of elements are generated on the page, but I know that they're all separate and discreet 'name' attributes, i.e. f01, f02, f03, etc..  As a basic example, if I have to generate a selection list, I know that the parameter "p_idx" of the APEX_ITEM call is to say '3', so select all lists that get generated have a "name" attribute in "f03" DOM, all text elements will be "f01", etc.

    I want to record these data in the database using AJAX.  It is common to call the javascript htmldb_Get function that is standard for the use of an application process, but I am interested in the use of the rarely called upon 'internal' and queryString"options of this javascript function so that I can build the query string to the fly according to what is on the DOM when it tries to save the data they have entered into these items generated by APEX_ITEM.  Someone at - there are good examples of the use of the 'procedure' and 'queryString' the javascript htmldb_Get function parameters?

    I have found a handful of some blogs, messages, etc. online linked to this, but just for most people regurgitate the documentation.  I found this post (https://forums.oracle.com/thread/2549237), which has had a glimpse of hope to move from a table (which is something I need) as a parameter, but as someone in their right mind would check this before you go this route.

    Shane.

    ApEx 4.2.1

    Shane

    Since you mention that you are on 4.2 APEX I advise to use apex.server.process which is replacing the htmldb_Get officially undocumented documented.

    In the literature, it is that the first parameter is the ajaxidentifier but it's actually the name of the process.

    The data object would be something like

    var lData ={f01 : get_value_array('f01')}
    

    Where is get_value_array

    function get_value_array(pColumnName) {
      var l_values =[];
      apex.jQuery('[name="'+pColumnName+'"]').each(
       function(){
        var l_value;
        l_value = apex.item(this.id).getValue();
        l_values.push(l_value);
       }
      );
      return l_values
    }
    

    For an example see this demo.

    Nicolette

  • Unable to create the stored procedure batch Oracle Script from Windows

    Hello
    I put my code here please let me know where I have error
    Cmd
    -------
    DNAME SET = %3
    SET UerName = %1
    SET Pssword = %2
    SET Opdir = C:\Users\testuser\
    sqlplus-s '% UerName%/%Pssword%@%DNAME%' @%Opdir%procdure.sql

    procedure. SQL
    --------------
    WHENEVER SQLERROR EXIT SQL. SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT SQL. OSCODE RESTORATION
    SET SERVEROUTPUT ON
    SET ECHO ON
    AUTOPRINT SET ON
    RUN THE DBMS_OUTPUT. ENABLE (1000000)
    COIL Seq.log
    SET linesize 1000
    CREATE PROCEDURE test "()" ""
    AS
    BEGIN
    NULL;
    END test;
    SPOOL OFF
    OUTPUT
    -----------

    Demostrating how I executed


    C:\Users\nikhilgk > otherobj AAA AAA TEST
    C:\Users\nikhilgk > SET DNAME = TEST
    C:\Users\nikhilgk > SET UerName = AAA

    C:\Users\nikhilgk > SET Pssword = AAA

    C:\Users\nikhilgk > SET LOG = C:\Users

    C:\Users\nikhilgk > SET Opdir = C:\Users\testuser\

    C:\Users\nikhilgk > sqlplus s 'AAA/AAA@TEST' @procdure.sql

    PL/SQL procedure successfully completed.

    ------------------------
    Journal is is created with size 0 KB.

    I connected to SQLPLUS and questioned
    SQL > select object_name from user_objects where type_objet = 'PROCEDURE '.

    no selected line.

    you have'nt actually run the code to create procedure.

    create PROCEDURE TEST()
    AS
    BEGIN
    NULL;
    END test;
    /  -- you need this 
    

    also if you want to access without double quotes all the time, do not put double quotes on the name

    And I think you should go out; rather than leave. That's why you have a size zero.

    Published by: Keith Jamieson 31 August 2012 13:21

  • Passing an array as a parameter of java (java controls) for the stored procedure

    Hello

    I use java controls (BEA Weblogic Workshop 8.1) to call a stored procedure and send an array as a parameter to the stored procedure of java. The following code throws an exception 'Fail to convert the internal representation.

    Java code
    import com.bea.control.DatabaseControl.SQLParameter;

    Here I create the java
    int [] = {12,13,14} javaArray.

    The code below is used to create the table from sql to oracle for the procedure
    SQLParameter [] params = new SQLParameter [1];
    Object obj0 = javaArray;
    params [0] = new SQLParameter (obj0, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);

    the code below calls the myFunc in file OJDBCtrl.jcx
    String success = dbControl.testFunc (params);

    OJDBCtrl.jcx
    /**
    * @jc: = sql statement ' call CMNT_TST_PROC (?)).
    */
    String Myfunc (SQLParameter [] param);

    The stored procedure that is used:

    SL_tab IS NUMBER TABLE INDEX BY PLS_INTEGER;
    Procedure cmnt_tst_proc (cmnt_tst sl_tab);
    Procedure cmnt_tst_proc (cmnt_tst sl_tab) is
    BEGIN
    dbms_output.put_line ('Hello');
    END;


    I'm getting the following exception

    Failure = Java.Sql.SqlException: Internal failure to convert the representation: [I@438af4 [ServiceException] >]
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:861)
    at oracle.sql.ARRAY.toARRAY(ARRAY.java:210)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7768)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7449)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7837)
    at oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4587)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:244)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl._setParameter(DatabaseControlImpl.jcs:1886)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1732)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2591)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:249)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(JcsContainer.java:85)
    at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:224)
    at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:109)
    at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:153)
    ...

    Can you please let me know, what am I doing wrong and how can I pass an array to a procedure/function using java controls.

    Any help will be much appreciated.



    Published by: user12671762 on February 24, 2010 05:03

    Published by: user9211663 on February 24, 2010 21:04

    Try using an oracle.sql.ARRAY with a nested table or varray instead of a table index. Create the type SQL and Java object as follows

        SQL> create type sl_tab as varray(3) of integer;
        Java:
            ArrayDescriptor ad = ArrayDescriptor.createDescriptor
                (".SL_TAB", java.sql.Connection);
            Object elements = new Object[3];
            elements[0] = new Integer(12);
            elements[1] = new Integer(13);
            elements[2] = new Integer(14);
            oracle.sql.ARRAY array =
                new oracle.sql.ARRAY(ad, oracle.jdbc.OracleTypes.ARRAY, elements);
            SQLParameter[] params = new SQLParameter[1];
            params[0] =
                new SQLParameter(array, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
            String succ = dbControl.testFunc(params);
    

    I don't think that you can pass an array of Java, this is why you have more success using an oracle.sql.ARRAY with a SQL varray. -Michael-

  • Call the stored procedure, and bind parameters by name

    Hello

    I use the Oracle ODBC 12 c driver to pass values from one Interface to our database Oracle 11.2. The Interface software collects data from modbus protocoll and calls a stored procedure. Right now my syntax to call the stored procedure looks like this:

    CALL procedure-name ('STRING', 'Timestamp as String', numValue1);

    It works very well. Now, I have to add a default setting to my procedure. To stay flexible to make other changes, I want to call the procedure and bind the parameters by name. Release 10.2.0.1.0 ISC ODBC Notes:

    Added support for the named parameter, binding the parameters by name. ODBC Oracle driver now allows the application to specify the parameters of a stored procedure by name, in the procedure call. Named parameters are to be used in calls to stored procedures and should not be used in other SQL statements.

    So, it shouldn't be a problem to use named notation, but how do I do this in ODBC? I tried like this, but oracle returns an ora-00936 error of missing expression:

    call procedure-name (paramName1 = > 'STRING',= paramName2 > 'Timestamp as String',paramName3 = > numValue1).


    Thank you for your help.

    Finally, I was able to find the error. The syntax of the statement was very good. The problem was caused by another declaration that I edited before and the error has not attracted Attention immediately.

    Thanks for reading and looking for an answer.

  • In a table - looping through the rows and the stored procedure call

    APEX version: 3.2.0.00.27

    Hello

    I searched the forum and tried a few things but could not make it work.

    I have a tabular presentation, developed with the help of the ATD (Cascading LOV - method of tabular presentation - AJAX - ATD )

    What I'm trying to do now:
    -After submit and validations, loop through all the lines and
    -call a stored procedure passing 3 parameters obtained from each of the lines on the form of tables. This procedure will be an update of a database table.

    On the forum, I found that I could do the loop "* FOR i IN 1..." APEX_APPLICATION.g_f03. "LOOP COUNT *" syntax.

    Only for testing purposes, I tried just to view information with the following (On Load - after a footer) process (example of Denes Kubicek == > http://deneskubicek.blogspot.com/2009/05/execute-javascript-throuhg-plsql.html):
    declare
      v_today  varchar2 (200);
    begin
    --  :P40_test := APEX_APPLICATION.g_f03(1);
    --  :P40_test2 := APEX_APPLICATION.g_f04.COUNT;
      :P40_test2 := 100;
    
      v_today := to_char (sysdate, 'dd.mm.yyyy');
    
    --FOR i IN 1.. APEX_APPLICATION.g_f03.COUNT LOOP 
    
      :P40_test := APEX_APPLICATION.g_f02(2);
    
      HTP.p ('<script type="text/javascript">');
      HTP.p (   'alert(''Today is '
              || v_today
    --          || APEX_APPLICATION.g_f04(APEX_APPLICATION.g_f03(i))
              || '.\n'
              || 'end!'');'
             );
      HTP.p ('</script>');
    
    --    :P40_test := APEX_APPLICATION.g_f02(APEX_APPLICATION.g_f02(i));
    
    --END LOOP;
    
    end;
    The foregoing would give me a ' * ORA-01403: no data found * ' message. I tried through various variants of APEX_APPLICATION.g_f0* #*, but still can't get anything to display correctly. In commenting on all the lines referring to APEX_APPLICATION.g_f0x above, the date would be are they displayed fine.

    I tried uncomment the FOR... LOOP and play with the code (defining the process runs "On submit - after calculations" and Validations), I got was a ' * ORA-06502: PL/SQL: digital error or value: character conversion number error * "message.

    Here is the script of the form in a table:
    select 
    "V"."MSLINK",                                       -- hidden (number)
    "V"."INSTALLATION_DATE",                        -- editable date picker
    "V"."MANUFACTURER_INDICATOR",              -- editable (cascading LOV -- text)
    "V"."MODEL_INDICATOR",                           -- editable (cascading LOV -- text)
    "V"."DIAMETER_INDICATOR",                      -- editable (LOV -- number)
    "V"."PURPOSE_INDICATOR",                        -- editable (LOV -- text)
    "V"."VALVE_NUMBER",                                -- shown but not editable -- number
    "V"."MODIFY_DATE",                                  -- shown but not editable
    "V"."MODIFY_USER",                                   -- shown but not editable
    "V"."VALVES_STYLE"."FEATURE"                  -- shown but not editable -- number
    from "#OWNER#"."VALVES" "V"
    Where
      "V"."PROJECT_ID" = :P1_PROJECT_NUMBER AND
      "V"."VALVES_DFLAG" = 0
    Regarding the parameters for the stored procedure, it would the MSLINK, VALVE_NUMBER and the VALVES_STYLE. FEATURE.

    Help, please!
    (Sorry for the long post).

    Thank you

    Tan

    Hi, Tan,

    I have not seen that type of object - I've only used custom types for purposes of test years ago and have never used their within Apex!

    One possibility is that the value of checksum being is based on all of the content of these fields, rather than only the part of the FEATURE. If there are other parts of the object, you could include those items as well.

    Otherwise, as you f01 KP for a record, you will need to retrieve the values of the FUNCTION in your PL/SQL code directly from the table (because the user cannot modify these fields, you can be sure that the values in the table will be still valid).

    Andy

  • How to call the stored procedure from javascript? (Google suggest, AJAX)

    Hi I want to set up a text field so that it behaves like [Google Suggest | http://www.google.com/webhp?complete=1 & hl = en].

    I read this post .

    Now, I installed everything according to this document. But it simply doesn't. And I don't know why.

    I think that problems can fall into the following three categories:
    1. the text field and the page invoking the appropriate javascript?
    2 - is the JavaScript call the stored procedure?
    3. the stored procedure correctly returns the result formatted?

    I'm assertive for 1 and 3, but I'm not sure 2. Because I don't know how if a stored procedure has been called? Is there a PL/SQL statement that I can query in SQL * more?

    Also, I would like to know how to debug AJAX in the APEX. It involves a lot of things.

    Finally, I used APEX 3.2 and Oracle XE. I can't find file dads.conf or marvel.conf. Is ' / apex / "the virtual directory for APEX?

    Thank you very much!

    Buffalo,

    I managed to make it work on XE with APEX 3.2!
    It took more time than expected because my XE installation was still on an earlier version of the Apex and I had put it first...

    But that's what I did:
    -in the ac.js file, I changed the path ' / apex / "and I added the ac.js file to my candidacy as a static file. So as you did.
    -J' copied my request to the XE and copied my procedure on the schema that is related to my request
    -J' gave to run anonymous rights my procedure

    Now at first, it did not work...
    Then I suddenly remembered something: If you want to run a procedure through the pl/sql gateway in the XE, XE please how it is.
    Do you this by changing the APEX_030200.wwv_flow_epg_include_mod_local function!

    This is the code for the function changed for my example:

    CREATE OR REPLACE function APEX_030200.wwv_flow_epg_include_mod_local(
        procedure_name in varchar2)
    return boolean
    is
    begin
        --return false; -- remove this statement when you modify this function
        --
        -- Administrator note: the procedure_name input parameter may be in the format:
        --
        --    procedure
        --    schema.procedure
        --    package.procedure
        --    schema.package.procedure
        --
        -- If the expected input parameter is a procedure name only, the IN list code shown below
        -- can be modified to itemize the expected procedure names. Otherwise you must parse the
        -- procedure_name parameter and replace the simple code below with code that will evaluate
        -- all of the cases listed above.
        --
        if upper(procedure_name) in (
              'MATTHIASH.INCSEARCH') then
            return TRUE;
        else
            return FALSE;
        end if;
    end wwv_flow_epg_include_mod_local;
    /
    

    After that, the AJAX function worked as expected...

    HTH
    Matthias Hoys

    Published by: mhoys on August 13, 2009 15:24

  • call the stored procedure in a column in the report

    Hi all
    I'm new to APEX. I did a search on this forum, but could not get an exact answer.
    I know how to call or execute a procedure from a button. as to create a PL/SQL anonymous bloack and partner is key.

    My question is a little different. I have a report with 11 columns. the last column shows just "delete" for all lines (I did it in my request to report as SELECT x, y, z,..., 'remove' AS delete). When I click on this cell for any line (this column can be a hyperlink or any clickable element), I would like to call a stored procedure that takes parameters as values in columns 2 and 4 for this particular line.

    for example, my report looks like somethnig like below,

    FILE_ID MEMBER_CD ACTION
    112 ABCD Remove
    WXYYZ 113 remove
    114 PQRS remove

    I want to click on the 'delete' in the first line which should call a stored procedure and pass of 112 and ABCD as parameters to the procedure.

    I now have the procedure as a process. sturggling to link this column to procedure but without success :(

    Hope realized. Please, any help is appreciated.

    Thank you

    Hello

    I work in the drudgery of google and firefox if ever the reliased, the thanks of the error to report

    exact code in URL should e

    javascript:document.getElementById('P1_RECORDID').value = '#recordid#';doSubmit('DELETE_RECORD');
    
  • Key of the stored procedure

    Hello

    I have a function in the db that returns a numeric value after passing an Id (digital). How do I create a join in physical layer as funtion will return a digital and given that it is a function, it can return only a single column.

    is it possible that I can keep the id (parameter) in the phycisal layer which I'm passing to the function, so that I can join neccasy in the physical layer with fact/Sun to the stored procedure.

    is the possible creation of mutiple stored procedure in physics if my function to only return a single column.

    Concerning
    Issue

    If I understand your question, you have a function that returns a numerical value based on an ID, we'll call it Customer ID as a sample. What you need to do is to create a view like this:

    CREATE THE VIEW IN CIRCULATION
    SELECT CUSTOMER_ID, get_outstanding (CUSTOMER_ID) FROM CLIENT

    You can then query this view like this:

    SELECT * EXCEPTIONAL WHERE CUSTOMER_ID = 999

    You could also use this point of view in your physical layer and attach it by customer ID. If you already have a table of facts, you could put a top view to add the extra column with your function. It of all good and should work fine with a warning. PL/SQL execution on SQL functions is not effective. Oracle has switch context between SQL and PL/SQL for each line and change in context is an expensive operation. In a proper system of DWH you préremplira your fact table with the results of get_outstanding for all customers so that there is no delay in the calculation it when OBIEE queries data.

  • Execution of the stored procedure Oracle EF6 error.

    Hello

    Need help with the oracle error

    {"ORA-06550: line 1, column 8:"}

    PLS-00306: wrong number or types of arguments in the call to "sp_name".

    ORA-06550: line 1, column 8:

    {"PL/SQL: statement ignored '}

    This error occurs when the code runs the line in Vb.net application in Model Designer

    MyBase.ExecuteFunction ("sp_name" para1, para2, para3, dOBpara4, para5)

    I create the SSDL and CSDL, MSL files for oracle to MS SQL connection by the method mentioned in the link JasonShort - professional profile - CodeProject it worked perfectly fine without the stored procedures. I managed to insert, update, and delete records. Then, I created stored procedures for Insert, Update, Delete. It worked fine with MS SQL. I copied and updated oracle files respectively. I gives me the error mentioned above.

    I executed stored procedures in Oracle SQL Developer, and it works without error. But when it is executed via the model there is light of the error. Can anyone let me know the solution for this error. I'm using VS2010, EF6, Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Thank you

    Prachin Soparkar

    Hello

    Sorry for the inconvenience. After I posted this question I took a break and saw that the error was nothing, but I had given FNAME as parameter name in MS SQL. In oracle when I created the sp I created the parameter with p_FNAME. Where the schema defined in the language SSDL and CSDL, MSL had to be changed to MS, but since I want to that it would be same in different databases, I choose to have changed it in oracle stored procedure. The error msg is confusing, it should be something not found parameter or incompatibility etc.

    Thank you

    Prachin Soparkar

  • Block based on the stored procedure cannot modify Default_where clause

    Hi all

    I tried to create a block based on the stored procedure that it works very well with the result set for the refcursor. But if I need to add filters on the block using where clause in the palette of goods or

    using the property block set in where clause, it does not error but does not review filters .

    tried everything to you please let me know. This is a restriction whereby we can set filters on the block when we create the block based on the stored procedure.

    Thank you

    Check in Form Builder Help:

    Creating a block of data from a procedure that uses a ref cursor

    ... You can't pass a WHERE or ORDER BY clause clause in a stored procedure.

    But you can send your WHERE condition using the query Source Arguments.

    If the procedure is on the side of the database (not in the forms module), ensure that the procedure is not vulnerable to injection of SQL code.

    Kind regards

    Zlatko

  • user_table should be used in the stored procedure.

    Hello

    I want to find my permanent table user_tables and then drop and recreate it,

    I can use this user_tables in my stored procedure for above purpose or is there any notice that must be used.

    SP is admin sp, used to run in offline mode.

    yorus truly

    Published by: 944768 on 10 February 2013 23:44

    Published by: 944768 on 10 February 2013 23:44

    944768 wrote:
    but I wanted to know that can I use user_table in above proc stored to conclude and then drop and create it when Everitt runs?

    Oracle manages two "flavors" of the stored procedure - copyright and rights of the Summoner. Rights of the DEFINER (default) is always performed under stored security area of the owner of the procedure no matter who calls it. So, if you ask USER_TABLES (or any display USER_, besides) within DEFINER rights stored procedure, you will get a list of tables owned by the owner of the stored procedure, not stored calling procedure. Rights (AUTHID CURRENT_USER) stored Invoker procedure is always carried out under the domain of the calller security. Therefore, if you are querying USER_TABLES (or any display USER_, besides) within the Summoner rights stored procedure you will get a list of tables belonging to the appellant a stored procedure. Hope it answers your question.

    SY.

  • Error on the definition of the stored procedure in the simultaneous program

    Hello

    I created a stored procedure and wanted it attached to the concurrent program. The purpose of this stored procedure when you run it in simultaneous program, the system retrieves the data from the csv file downloaded from the server, then it will insert in the tables of SO / the Interface API. Below, the error occurred.


    * Starts * 18 April 2012 18:18:42
    Error ORACLE 6550 in FDPSTP

    Cause: FDPSTP failed due to the ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'SPKO1 '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Steps I did to set the stored proc
    < < simultaneous executable program > >

    Executable: RDRAGON_SO_IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Method of execution: PL/SQL, stored procedure
    Run file name: SPKO1

    < < concurrent program - set > >

    Program: RDRAGON SO IMPORT
    Short name: RDRAGON_SO_IMPORT
    Application: Order management
    Name of executable: RDRAGON_SO_IMPORT
    Method: PL/SQL, stored procedure

    Format: text
    No set

    -Here are my stored procedure-


    CREATE OR REPLACE PROCEDURE APPS. SPKO1 IS
    FH UTL_FILE. TYPE_DE_FICHIER;
    v_line VARCHAR2 (32767).
    v_source_id NUMBER (10);
    v_created_by NUMBER (10);
    v_creation_date DATE;

    v_org_id NUMBER (10);
    v_orig_sys_docref VARCHAR2 (50);
    V_Customer VARCHAR2 (360);
    v_customer_prev VARCHAR2 (360);
    v_sold_to_org NUMBER (10);

    v_orig_line_ref NUMBER (10);
    v_item_code VARCHAR2 (2000);
    v_ordered_qty NUMBER (10);
    v_selling_price NUMBER (10);
    v_count NUMBER (10);
    v_stat NUMBER;


    /******************************************************************************
    NAME: SPKO
    PURPOSE:

    REVISIONS:
    Worm Date Description of the author
    --------- ---------- --------------- ------------------------------------
    1.0 16/04/2012 administrator 1. Created this procedure.

    NOTES:

    Keywords to replace automatically available Auto:
    Object name: SPKO
    SYSDATE: 16/04/2012
    Date and time: 16/04/2012, 17:55:42 and 16/04/2012 17:55:42
    Username: admin (set in Options of TOAD, editor of the procedure)
    Name of the table: (defined in the dialog box "New PL/SQL object")

    ******************************************************************************/
    BEGIN
    v_source_id: = 6;
    v_created_by: = - 1;
    v_org_id: = 204;
    v_customer_prev: = null;
    v_orig_line_ref: = 0;
    v_stat: = 0;

    SELECT header_id in (DE) v_orig_sys_docref
    Select header_id
    of OE_ORDER_HEADERS_ALL
    creation_date desc order
    ) WHERE ROWNUM = 1;


    FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'myfile1.csv', 'R', 32767);
    < < file_read_lines > >
    LOOP
    BEGIN
    UTL_FILE. GET_LINE (fh, v_line);

    V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
    v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
    v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
    v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
    v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
    v_orig_line_ref: = (v_orig_line_ref + 1);

    If v_stat = 0 then
    v_orig_sys_docref: = (v_orig_sys_docref + 1);
    end if;

    SELECT hca.cust_account_id from v_sold_to_org
    OF hz_cust_accounts AOB.
    HP hz_parties
    WHERE hca.party_id = hp.party_id
    AND hca.request_id is null
    AND hp.party_name = v_customer;

    If v_stat = 0 then
    INSERT INTO OE_HEADERS_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    org_id,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code,
    sold_to_org_id,
    booked_flag)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_org_id,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT."
    v_sold_to_org,
    'Y') ;
    commit;
    end if;

    INSERT INTO OE_LINES_IFACE_ALL)
    order_source_id,
    orig_sys_document_ref,
    orig_sys_line_ref,
    inventory_item,
    org_id,
    ordered_quantity,
    unit_selling_price,
    unit_list_price,
    CREATION_DATE,
    created_by,
    last_update_date,
    last_updated_by,
    operation_code)
    VALUES)
    v_source_id,
    ('TEST' | v_orig_sys_docref).
    v_orig_line_ref,
    v_item_code,
    v_org_id,
    v_ordered_qty,
    v_selling_price,
    v_selling_price,
    v_creation_date,
    v_created_by,
    v_creation_date,
    v_created_by,
    "INSERT");
    commit;

    v_customer_prev: = v_customer;
    If v_customer_prev = v_customer then
    v_stat: = 1;
    on the other
    v_stat: = 0;
    end if;
    -DBMS_OUTPUT. Put_line ('Col1: ' | v_source_id |', Col2: ' | v_creation_date |', Col3: ' | v_created_by |', Col4: ' | v_updated_date |', Col5: ' | v_updated_by);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    OUTPUT file_read_lines;
    END;
    END LOOP;
    SELECT count (*) in the OE_HEADERS_IFACE_ALL v_count;
    DBMS_OUTPUT. Put_line (' record Total inserted successfully: ' | v_count);
    UTL_FILE. FCLOSE (FH);

    END SPKO1;
    /


    But when I run the stored procedure using TOAD his work.

    Help, please. This is my first time to attach the stored procedure in the concurrent program.

    Thank you very much.

    Kind regards
    Diane

    Published by: peopsquik08 on April 18, 2012 03:58

    as clive_t solier
    >
    You must explicitly reference the settings out
    >

    Try

    DECLARE
    VFILE VARCHAR2(32767);
    V_SOURCE_ID NUMBER;
    --
    ERRBUF VARCHAR2(200);
    RETCODE NUMBER;
    
    BEGIN
    VFILE := 'myfile1.csv';
    V_SOURCE_ID := 6;
    
    --APPS.OMORDERLOADER.SPKO1 ( VFILE, V_SOURCE_ID );
    --COMMIT;
    
    APPS.OMORDERLOADER.SPKO1(
        ERRBUF => ERRBUF,
        RETCODE => RETCODE,
        VFILE => VFILE,
        V_SOURCE_ID => V_SOURCE_ID
      );
    END;
    

    but the code above to test your proc

    to run concurrent SQL, you can use fnd_submit.submit_program

Maybe you are looking for

  • Virus on safari

    So I don't know exactly what happened to my mother (not a computer expert) wanted to watch videos online, and it arises (screenshot). She showed it to me. I noticed that it is wrong because the site is not official and the phone number is not apple.

  • crashing every 10 minutes

    I get those... continue or stop the script whenever I do something. and then everything crashes. Date of the ID report2f646acc-abfe-4CE6-bde1-6c2489a9a0dc 06/03/2015 13:04BP-75e9a631-1b28-4BBB-aa33-c93452150305 05/03/2015 15:0504/03/2015 f082c10e-E34

  • Satellite P series shuts up to 20 times per day

    Hello everyone.I was wondering if you could help with this problem. Computer portable Satellite to my son kept totally extinguish up to 20 times a day, so I tried to do a re-installation using the recovery CD offered 2.I put the laptop to boot from t

  • System UI Tuner for quick settings

    Hello So, recently, I upgraded to 6.0 for Moto G Marshmallow 2nd generation 2014. One of the reasons why I wanted to it was to customize Quick settings without root. However after following various tutorials on how to activate the tuner of the interf

  • HP Deskjet 3051 a won't scan to my computer

    Hello, my mother gave me this printer, it was previously connected to his computer, and when I try to scan on my computer it says "not found computer. Ensure that HP software has been installed on the computer. "How to install the HP software?  It pr