Passing procedures/functions as arguments ?

I doubt this is possible but just to make sure: can a procedure or function be passed as an argument to another (or even the same) procedure or function, like in functional programming ? This would help a lot cleaning up a convoluted if-then-else spaggeti piece of code I'm dealing with.
Thanks,
George

It depends on what exactly you want to do. You can pass a function as an argument to a procedure, or another function. The called function gets the result of the parameter function as the argument. You cannot pass a procedure as an argument because a procedure cannot be resolved to a scalar value or collection.
SQL> CREATE FUNCTION f (p_str IN VARCHAR2) RETURN VARCHAR2 AS
  2  l_ret VARCHAR2(100);
  3  BEGIN
  4     l_ret := 'Hello '||p_str;
  5     RETURN l_ret;
  6  END;
  7  /
Function created.
SQL> CREATE PROCEDURE p (p_str IN VARCHAR2) AS
  2  BEGIN
  3     DBMS_OUTPUT.Put_Line(p_str);
  4  END;
  5  /
Procedure created.
SQL> exec p(f('World!'))
Hello World!
PL/SQL procedure successfully completed.If you want to pass a procedure or function and have the called procedure execute that function then you will need to use dynamic sql.
HTH
John

Similar Messages

  • Pass procedure/function parameters via URL

    how to pass procedure or function parameters via URL? External link processes payment, and returns some data. I have an example procedure that forms correct URL like:
    http://www.website.lt:7777/apex/f?p=109:6:1512552728675996::::P23_LOGIN_ID:UTREEP7Q84FHG
    but the other procedure returns with URL (and its wrong):
    http://www.website.lt:7777/apex/nora.pay_cancel?token=EC-76F379209K155914F
    the source of pay_cancel procedure:
    create or replace procedure pay_cancel
    (token in varchar2)
    as
    begin
    owa_util.redirect_url('f?p='||'109'||':'||'5'); --some test page
    end pay_cancel;
    whats wrong with the return variable?

    Sorry, permission problems, everything is OK with +<schema>.<procedure>?<variable>=<value>+ syntax.
    Execute sql: grant execute on pay_cancel to public;

  • Passing blank parameter to stored procedures/function

    Hi all,
    When I pass blank value ('') to a VARCHAR2 parameter in a stored procedures/function it reads the parameter as NULL, I try to use DEFAULT keyword in the parameter declaration, but it does not work. How can I make the sp/func read the paramater as '' ?
    Thanks in advance
    Setya

    This is a fundamental quirk of Oracle - it treats '' (empty string) as if it were null:
    SQL> SELECT case when '' is null then 'EMPTY STRING IS NULL' else 'EMPTY STRING IS NOT NULL' end
      2  FROM   dual;
    CASEWHEN''ISNULLTHEN'EMP
    EMPTY STRING IS NULL
    SQL> So what is it you want to do that you can do with an empty string but not with a null?
    Regards, APC

  • Sqlbase - how to run a stored procedure with SYSDATE argument

    Hi, everyone!
    I'm trying to execute a stored procedure :
    cstmt = con.prepareCall("{ call PR_MYPROCEDURE(?, SYSDATE-1, SYSDATE) }");
    cstmt.setInt(1,1);And i get and SqlException - java.sql.SQLException: prepareCall(): An unexpected character 'S' found.
    Is there any way to pass a SYSDATE like argument?

    the problem that for sqlbase current date function is SYSDATE'sqlbase' the database?
    I couldn't ensure that the syntax that you posted looks correct but it seems possible.
    That would suggest there is a driver problem.
    Best I can suggest is modify the proc so it expects nulls for two parameters and then it creates the expressions that you are passing. Or create java Timestamp values and pass those.

  • Parameter index move while executing PL/SQL stored procedure/function

    Hello, community.
    Have a question for you. It looked like very easy to write some small JDBC-wrapper to handle stored procedure/functions call for Oracle.
    Here is the code snippet of it:
    import java.io.Serializable;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.HashMap;
    import java.util.Iterator;
    import javax.sql.DataSource;
    import oracle.jdbc.driver.OracleTypes;
    import org.apache.log4j.Logger;
    public class SmallHelper {
         public static final int CALL_TYPE__PROCEDURE = 1;
         public static final int CALL_TYPE__FUNCTION = 2;
         public static final int PARAMETER__IN = 1;
         public static final int PARAMETER__OUT = 2;
         private static final Logger log = Logger.getLogger(SmallHelper.class);
         private Connection con = null;
         private CallableStatement statement = null;
         private String name;
         private int type;
         private int resultType;
         private HashMap arguments = new HashMap();
          * Creates connection using data source as parameter.
          * @param ds - data source
          * @throws EhlApplicationException
         public SmallHelper(DataSource ds) throws Exception {
           try {
                   con = ds.getConnection();
              catch (SQLException e) {
                   ExceptionHelper.process(e);
         public void registerProcedure(String name) {
              this.name = name;
              this.type = CALL_TYPE__PROCEDURE;
         public void registerFunction(String name, int resultType) {
              this.name = name;
              this.resultType = resultType;
              this.type = CALL_TYPE__FUNCTION;
          * NB! When You're dealing with stored function index should start with number 2!
         public void registerArgument(int index, Object value, int type, int inOutType) {
              arguments.put(new Long(index), new CallableStatementArgument(value, type, inOutType));
         private String getSQL() {
              StringBuffer str = new StringBuffer("{ call  ");
              if ( type == CALL_TYPE__FUNCTION )
                   str.append(" ? := ");
              str.append(name).append("( ");
              for ( Iterator i = arguments.values().iterator(); i.hasNext(); ) {
                   i.next();
                   str.append("?");
                   if ( i.hasNext() )
                        str.append(", ");
              str.append(") }");
              return str.toString();
         public void execute() throws SQLException{
              String query = getSQL();
              statement = con.prepareCall(query);
              if ( type == CALL_TYPE__FUNCTION )
                   statement.registerOutParameter(1, resultType);
              for ( Iterator i = arguments.keySet().iterator(); i.hasNext(); ) {
                   Long index = (Long) i.next();
                   CallableStatementArgument argument = (CallableStatementArgument) arguments.get(index);
                   int type = argument.getType();
                   if ( argument.getInOutType() == PARAMETER__OUT )
                        statement.registerOutParameter(index.intValue(), type);
                   else if ( type != OracleTypes.CURSOR )
                        statement.setObject(index.intValue(), argument.getValue(), type);
              log.info("Executing SQL: "+query);
              statement.execute();
         public CallableStatement getStatement() {
              return statement;
         public void close() throws EhlApplicationException {
              try {
                   if (statement != null)
                        statement.close();
                   if (con != null)
                        con.close();
              catch (SQLException e) {
                   EhlSqlExceptionHelper.process(e);
         private class CallableStatementArgument implements Serializable{
              private Object value;
              private int type;
              private int inOutType;
              public CallableStatementArgument(Object value, int type, int inOutType) {
                   this.value = value;
                   this.type = type;
                   this.inOutType = inOutType;
              public int getType() {
                   return type;
              public Object getValue() {
                   return value;
              public int getInOutType() {
                   return inOutType;
    }It was really done in 10-15 mins, so don't be very angry at code quality :)
    Here is the problem.:
                   helper.registerProcedure("pkg_diagnosis.search_diagnosis");
                   helper.registerArgument(1, null, OracleTypes.CURSOR, EhlJdbcCallableStatementHelper.PARAMETER__OUT);
                   helper.registerArgument(2, pattern, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(3, lang, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(4, EhlSqlUtil.convertSetToString(langs, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(5, EhlSqlUtil.convertSetToString(diagnosisClass, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(6, parentId, OracleTypes.NUMBER, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.execute();
                   ResultSet rs = ((OracleCallableStatement) helper.getStatement()).getCursor(1);
                   procedure definition:
    procedure search_diagnosis (l_res OUT dyna_cur,
                               in_search_string IN VARCHAR2,
                               in_search_lang IN VARCHAR2,
                               in_lang_list IN VARCHAR2,
                               in_diag_class_list IN VARCHAR2,
                               in_parent_id IN NUMBER) Procedure call has inner check that fail because of som strange reason:
    in_search_string has 2 as index, that is correct. but procedure recieves is as number 3 in parameter list (what is in_search_lang). Other parameters are moved to. It seems like a cursor takes 2 places in definition. It's clear that if I put in_search_string as 1 parameter and cursor as 0 I'll get invalid parametr bindong(s) exception. So... any ideas why 2nd parameter is actually 3rd?
    Thanks beforehand.

    hmm...moreover:
    if we change procedure to function and call it in a simple way:
    CallableStatement stmnt = helper.getConnection().prepareCall("begin ? := pkg_diagnosis.search_diagnosis(?,?,?,?,?); end;");
                   stmnt.registerOutParameter(1, OracleTypes.CURSOR);
                   stmnt.setString(2, pattern);
                   stmnt.setString(3, lang);
                   stmnt.setString(4, langs);
                   stmnt.setString(5, diagnosisClass);
                   stmnt.setObject(6, parentId, OracleTypes.NUMBER);
                   stmnt.execute();
                   ResultSet rs = (ResultSet) stmnt.getObject(1);the exception is:
    [BEA][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 14:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredif we return some string or number - it works. but when we want cursor back - it fails.
    cursor is defined like ordinary dynamic cursor:
    TYPE dyna_cur IS REF CURSOR;

  • Stored Procedure/Function

    Hi All
    I am trying to create a stored procedure that will return a line from a table.
    The basic brief I have is that we have a bunch of tables that set up the user security and they link back to a our_systems table which holds info about all internal systems.
    I need a stored procedure which can be called with a username and a system id. If the user has rights to the system then the line from the our_system table will be returned along with a rights level.
    The hard part is I want to stop the users from seeing all the tables in this section. The original idea is to denie access to the tables but allow access to a stored procedure. Would this work?
    The second point is how can I get this working? I am used to MS SQL Server and this would easily be done by creating the procedure and then doing
    SELECT * FROM spCheckRights('dave',1)
    But Oracle (9i is the version I am using) says that a function / procedure can't be placed there.
    I have 2 version of my procedure
    FUNCTION spCheckRights (login_name In varchar2, drxsystem_id In number)
    return sys_refcursor
    AS
    l_cursor sys_refcursor;
    BEGIN
    open l_cursor for SELECT ds.NAME FROM drx_systems ds WHERE ds.system_id = 1;
    return l_cursor;
    END;
    OR
    FUNCTION spCheckRights (login_name In varchar2, drxsystem_id In number)
    return drx_systems%ROWTYPE
    AS
    drxsys drx_systems%ROWTYPE;
    BEGIN
    SELECT * INTO drxsys FROM drx_systems ds WHERE ds.system_id = 1;
    return drxsys;
    END;
    As you can see neither do all the check rights stuff yet, I wanted to test the basics first. Any views on which method is better for returning a row?
    Any help would be appreciated
    Thanks in advance
    Dave R

    As long as the owner of the function has rights to the tables, the users calling the function do not need to have any rights on the table, only execute on the function.
    The choice of using a procedure or a function (in Oracle they differ) and whether to return a cursor, a collection type or a record type really depends on your front-end requirements, and the number of values you want to return.
    A function can only return a single value. That value can be a cursor or a collection of some kind (think array), or it can be a scalar variable. A procedure can return, through out parameters, multiple values. This set of types that can be returned is the same as for a function.
    So, for a function returning a cursor, you would do something analagous to:
    curvar ResultSet;
    curvar = f(p1, p2);in the language appropriate way. For testing in sqlplus, that would be something like:
    VAR curvar SYS_REFCURSOR;
    exec :curvar := f(p1, p2);
    print curvar;Note, the colon in front of curvar in the exec is required. As long as your calling code can define a variable of drx_systems%ROWTYPE to recieve it, then the second version should work similarly.
    If you will only be returning values from a single row, and if the number of coumns is relatively small, you could also consider a procedure something like:
    PROCEDURE spcheckrights (p_login_name   IN VARCHAR2,
                             p_drxsystem_id IN NUMBER,
                             p_name         OUT VARCHAR2,
                             p_allowed      OUT VARCHAR2) AS
    BEGIN
       SELECT ds.name, ds.allowed
       INTO p_name, p_allowed
       FROM drx_systems
       WHERE system_id = 1;
    END;Then call it passing in variable to get the results. Again, in sqlplus that would look something like:
    VAR name VARCHAR2(30);
    VAR allowed VARCHAR2(1);
    exec p(p1, p2, :name, :allowed);
    print name, allowed;Again, in sqlplus, the colons before name and allowed in the exec call are required.
    HTH
    John

  • Apex 4 error ORA-04042 procedure, function, package body does not exist

    Hi all,
    I was instaling Oracle Application Expres 10g on Linux ubuntu and I was download and unzip apex 4
    on /usr/lib/oracle/xe/
    then connect as SYS as sysdba with pass and
    start
    @/usr/lib/oracle/xe/apex/apexins SYSAUX SYSAUX TEMP /i/
    installation starting
    ... after 5 minutes theres end of log file>
    I. O R A C L E S Y S I N S T A L L P R O C E S S
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/dev_grants.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/core_grants.sql"
    ...CONNECT as the Oracle user who will own the APEX engine
    Session altered.
    III. I N S T A L L A P E X P A C K A G E S P E C S
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_plsql_editor.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_model_api.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_util.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_plugin_f4000.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_image_generator.sql"
    Installing Team Development objects
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/team_tab.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team_api.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team_gen_api.sql"
    Installing Application Migration Workshop objects
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_create_ddl.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_create_ddl.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_exporter_ins.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/mig_views.sql"
    ...installing Application Migration Workshop package spec
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_acc_load.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_load_xml.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_olb_load_xml.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_update_apx_app.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_utilities.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frmmenu_load_xml.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_rpt_load_xml.sql"
    ...install Application Migration Workshop package body
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_acc_load.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_load_xml.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_olb_load_xml.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_update_apx_app.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frm_utilities.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_frmmenu_load_xml.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_mig_rpt_load_xml.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_item_comps.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_translation_utilities.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy_lov.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy_item.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy_button.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_translation_utilities.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/seed.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/sync.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/layout.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_lov_used_on_pages.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_query_builder.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_sw_object_feed.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_load_data.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_load_excel_data.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy_metadata.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copyu.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_tab_mgr.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/generate_ddl.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/table_drill.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_download.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_copy_page.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/generate_table_api.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_gen_hint.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_xliff.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_create_model_app.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/apex_admin.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_help.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_data_quick_flow.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_theme_files.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_session_mon.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_sw_page_calls.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_wiz_confirm.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_page_map.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_drag_layout.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_dataload_xml.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/apex_ui_default_update.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/apex_mig_projects_update.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_install_wizard.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_dictionary.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_advisor.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_search.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_plugins.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_4000_ui.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_4050_ui.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_workspace_reports.sql"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_p4150.sql"
    timing for: Development Package Specs
    Elapsed: 00:00:00.02
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_plsql_editor.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_model_api.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_util.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_plugin_f4000.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_image_generator.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/layout.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_query_builder.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_sw_object_feed.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_load_data.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_load_excel_data.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copy_metadata.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/copyu.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_tab_mgr.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/generate_ddl.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/table_drill.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_download.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_copy_page.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/generate_table_api.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_gen_hint.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_translation_utilities.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_xliff.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_create_model_app.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_help.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_data_quick_flow.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_theme_files.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_session_mon.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_sw_page_calls.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_wiz_confirm.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_page_map.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_drag_layout.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_dataload_xml.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/apex_ui_default_update.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/apex_mig_projects_update.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_install_wizard.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_dictionary.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_advisor.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_search.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_plugins.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_4000_ui.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_4050_ui.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_translation_utilities.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team_api.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_team_gen_api.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_workspace_reports.plb"
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_flow_f4000_p4150.plb"
    ...install demonstration Oracle APEX application package specs
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/collections_showcase.sql"
    ...install demonstration Oracle APEX application package bodies
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/collections_showcase.plb"
    ...install demonstration tables
    SP2-0310: unable to open file "/usr/lib/oracle/xe/apex/coreinscore/wwv_demo_tab.sql"
    timing for: Development Package Bodies
    Elapsed: 00:00:00.03
    grant execute on wwv_mig_acc_load to public
    ERROR at line 1:
    ORA-04042: procedure, function, package, or package body does not exist
    is there any solution?
    regards
    Gordan

    Install 4.0 pass ok!
    1. I was changing apexins.sql
    as PREFIX='@/usr/lib/oracle/xe/apex/'
    and add path to coreins.sql as @/usr/lib/oracle/xe/apex/coreins.sql
    2. create two folders coreinscore and coreinsbuild and copy all files from folder core and folder build
    3. copy and rename endins.sql as coreinsendins.sql
    after 10 min instalation pass ok!
    Gordan
    Edited by: useruseruser on Jun 29, 2010 2:12 PM

  • Procedure Function to dequeue a message and return cursor

    Hi Guys,
    We are looking for ways to dequeue a message from an oracle queue and pass it to the java code.
    Namely we would like to create a procedure/function to dequeue a message which can be called by the java code for further processing.
    So far we have the following working example, but it uses DBMS_OUTPUT.PUT_LINE to display values. But the target is to pass it to java...
    Our DB - 11gR2
    CODE:
    create or replace
    PROCEDURE PRC_DEQUEUE_EVENT_1
    AS
    dequeue_options DBMS_AQ.dequeue_options_t;
    message_properties DBMS_AQ.message_properties_t;
    message_handle RAW(16);
    message our_message_type;
    BEGIN
    dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
    DBMS_AQ.DEQUEUE(
    queue_name => 'ORDERS_Q',
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    DBMS_OUTPUT.PUT_LINE('STATUS: '|| MESSAGE.CORDYS_STATUS);
    DBMS_OUTPUT.PUT_LINE('CUSTOMERNUMBER: '|| MESSAGE.CUSTOMERNUMBER);
    DBMS_OUTPUT.PUT_LINE('EINDDATUM: '|| MESSAGE.EINDDATUM);
    DBMS_OUTPUT.PUT_LINE('ERRORCODE: '|| MESSAGE.ERRORCODE);
    DBMS_OUTPUT.PUT_LINE('EXTRA1: '|| MESSAGE.EXTRA1);
    DBMS_OUTPUT.PUT_LINE('EXTRA2: '|| MESSAGE.EXTRA2);
    DBMS_OUTPUT.PUT_LINE('EXTRA3: '|| MESSAGE.EXTRA3);
    DBMS_OUTPUT.PUT_LINE('EXTRA4: '|| MESSAGE.EXTRA4);
    DBMS_OUTPUT.PUT_LINE('EXTRA5: '|| MESSAGE.EXTRA5);
    END;
    In a result we get the following on the screen:
    STATUS: ORDER_COMPLETE
    CUSTOMERNUMBER:
    EINDDATUM: 20-DEC-11 12:00:00
    ERRORCODE:
    EXTRA1:
    EXTRA2:
    EXTRA3:
    EXTRA4:
    EXTRA5:
    Question is how to sent result into a variable/cursor... whatever which might be read by the java code.
    Any help would be much appreciated.
    Thanks!
    eMarcel
    Edited by: eMarcel on Jan 16, 2012 3:56 PM

    Thanks:)

  • How to call a procedure with two arguments

    Hi,
    I have a procedure with two arguments, ie. myprocedure(p1 in number,p2 in number) to display a blob image.
    how can I call out this blob image in url.
    I tried http://127.0.0.1:7777/pls/apex/SCHEMA.myprocedure?p1=1&p2=2 , but it don't work..
    Thanks
    vincent

    Vincent,
    As long as you have been granted the ability to execute the procedure and there are no spaces in the url and you have not misspelled the parameter names then this looks right.
    Here is a link to a procedure to download a file which takes two parameters.
    http://mywebsite.com/pls/htmldev/schema.package.function.download_file?p_session_id=1221970786026206&p_seq_id=724
    Cheers,
    Tyson Jouglet

  • To run mutipal SQLs in one procedure / function

    Hi,
    First of all, your help and efforts will be highly appreciated!
    I am new to the Oracle world and learning to write PL/SQL with real world problems.
    This is what I am facing now:
    I have a bunch of SQL scripts need to run several times a year, they are simple and just to create/rebuild indexes on different tables. samples as below
    CREATE INDEX ST_CODE_INDX_JAN2013 ON TREE_JAN2013
    (CODE)
    NOLOGGING
    TABLESPACE ST_LRG_INDX
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                FREELISTS        1
                FREELIST GROUPS  1
                BUFFER_POOL      DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX ST_ID_INDX_JAN2013 ON RECORDS_JAN2013
    (M_ID)
    NOLOGGING
    TABLESPACE ST_LRG_INDX
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                FREELISTS        1
                FREELIST GROUPS  1
                BUFFER_POOL      DEFAULT
    NOPARALLEL;
    And in total we probably will need to run around 100 scripts like this every time. Basically what we are doing is to import new tables every time and recreate/rebuild indexes. As you may see in the sample scripts above, all tables keep the same suffix but different table names. So, for now, what we are doing is to manually modify the script to reflex changes then kick it off.
    Now, how can I create a procedure/function stored in database and waiting for a EXEC command to pass the suffix and then run automatically?
    Once again, appreciated your great help!

    Use DBMS_STATS package instead of 'analyze'.  'ANALYZE' is deprecated and may not exist in future releases.
    Again - what you are trying to do (build tables/indexes on the fly) is extremely wrong.
    Add a DATE column and keep everything in one table.  You can then just add the PARTITION clause for EE instances.
    (against my better judgement)
    Two methods exist to run dynamically generated DDL statements:
    EXECUTE IMMEDIATE
    DBMS_SQL -- I'm not 100% sure on this one. read the manual.
    If you are dynamically generating the SQL, help limit SQL Injection by using DBMS_ASSERT on any user provided input.

  • Pass the command line argument (argc and argv) to a LabVIEW built shared library.

    Hello,
    I have successully use this trick to build a LabVIEW application that runs on Linux without X Display.
    http://digital.ni.com/public.nsf/allkb/5D6EC36DCF43343786257449006919E6
    I'd like to know if it's possible to pass the command line arguments ( ./TEST A B C D) directly into the shared library without having to pass the arguments using a array of strings which would require to write code using DSNewHandle, DSSetHandleSize, extract the arguments and ..... (I'm not proficient in C, but if I don't have a choice I will do it and improve my C skills).
    int main(int argc, char *argv[])
            Test(argc, argv);
            return 0;
    Thanks,
    Michel
    Solved!
    Go to Solution.

    Well, you can always flatten it back into a space separated single string and pass it like that. Basically reverse what the OS does when it calls your main function with the command line parameters. And while the first element in the array is always the program name itself you can just skip that here, but then format all the rest into a single string.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Stored procedure/function deployment failure PLS-00306

    Hi there,
    I'm using
    Oracle 10g2 10.2.0.1.0 (with patch set 1 10.2.0.2.0)
    ODE 10.2.0.2.20
    ODP 10.2.0.2.21
    VS 2005
    I was able to deploy and run .NET procedure/function from within Visual Studio, but after reconfiguring tnsnames.org and listener.org a couple of times, I began to have this weird problem:
    Whenever I deploy a stored procedure (the same one that I could deploy and run without any problem), the icon beside the name of the procedure in the tree list of Oracle Explorer becomes one that has a small "red light" at the corner. The options of "run", "run debug" and "step into" are disabled in the pop-up menu, and if I choose "compile" or "compile debug" from the menu, the "PLS-00306 wrong number or types of arguments in call to 'EXECUTEPROCEDURE'" error will show up -- the same error appears if I execute the procedure in SqlPlus.
    Has anyone ever met this problem before?
    Thanks so much ...

    This is my table structure :
    SQL> desc jobs
    Name Null? Type
    JOB_ID      NOT NULL VARCHAR2(10)
    JOB_TITLE      NOT NULL VARCHAR2(35)
    MIN_SALARY NUMBER(6)
    MAX_SALARY NUMBER(6)
    My Requirement is, User will enter the above field value in the form of array. I need to store these value and after manupulating this I will return that value also.
    Here I am using procedure just for testing purpuse.
    In my case I will take one array argumentlike JOB_ID and after manupulating these data I will return that array value.
    I am also not able to run this example through SQL.
    Can U give me exact code for running this prog.
    create or replace package associative_array as
    -- define an associative array type for each column in the jobs table
    type t_job_id is table of jobs.job_id%type index by pls_integer;
    type t_job_title is table of jobs.job_title%type index by pls_integer;
    type t_min_salary is table of jobs.min_salary%type index by pls_integer;
    type t_max_salary is table of jobs.max_salary%type index by pls_integer;
    -- define the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary);
    end associative_array;
    create or replace package body associative_array as
    -- implement the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary) is
    begin
    forall i in p_job_id.first..p_job_id.last
    insert into jobs (job_id,
    job_title,
    min_salary,
    max_salary)
    values (p_job_id(i),
    p_job_title(i),
    p_min_salary(i),
    p_max_salary(i));
    end array_insert;
    end associative_array;
    Regards,
    manish Kumar

  • Calling a procedure/function in forms personalization

    Hi,
    Can any one please help me in calling a procedure/function from the forms personalization? The requirement is to create an attachment when ever a new order line is created in R12. So for this, I created a procedure which calls attachment creation API. And in the forms personalization, I am doing the following.
    Trigger Event: WHEN-VALIDATE-RECORD
    Trigger Object: LINE
    Condition: :LINE.INVENTORY_ITEM_ID is not null
    Action Type: Builtin
    Builtin Type: Execute a Procedure
    Argument: =xx_test_attachment_new(:LINE.LINE_ID,20,'OE_ORDER_LINES',1,'test123')
    This procedure works individually if I call it from TOAD.
    Help is really appreciated?
    Thanks,
    Sri.

    A question for the Forms ?
    Nicolas.

  • Status report from Procedure/functions

    All,
    I have procedures /functions in my database. I need to return a status value back to the call procedures/functions to report the sub_procedure/function executed successfully.
    What is the status value if a procedure/function executed successfully? And what is the value for un_successful execution? Where I can get it from?
    Thanks a lot!

    This is really a design choice that you have to make in your application. PL/SQL stored procedures / functions do not return any implicit status codes on there own. In your PL/SQL code, you can check the SQLCODE built-in function for the status of the last SQL statement executed, but this is hardly the same thing (and really designed for use in exception handlers).
    You may choose to design you applications such that every call must return a status value. In this case, the values used to represent success or failure are up to you (I might suggest 0 for success and the error code - which will be non-zero - for failure). You can either use functions which always return a number (probably not a good idea to place this limitation on your application); you might design all stored procedures to return an output parameter which indicates success or failure.
    But, in general, your client code should be designed to correctly handle all Oracle exceptions - if no exception is raised, then success, else failure. And your PL/SQL should avoid bad practices like exception handlers which trap WHEN OTHERS and don't re-raise the exception.

  • Do you have any procedure/function to get parent child relation ship logic?

    I am in great need. I have developed one but its has many cursor. Actually to get final leaf node, I have to keep on using cursor until last leaf found.
    Note: CONNECT BY PRIOR not to be used with this requirement. So need to create procedure/function only.

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated SQL And PL/SQL forum (you've posted there before).
    Additionally, this seems to be a duplicate of your other thread at How to get Number of NESTED CHILD on this requirement? please use the same thread instead of duplicating.
    Regards,
    K.

Maybe you are looking for

  • Error message when deleting Business transaction: Activity in CRM

    Hi All, I am trying to delete a couple of Activities from CRM (Production system) and encounter two error message: "Enter a Business Partner" and "Administration header not found." I have tried three ways to delete/archive the activity numbers in the

  • Using Data/Services to connect to NY Times API

    I'm new to flex and have been trying to use the NY Times API to import xml data.  After clicking the Data/Services tab and selecting "xml" I click the "path" button and insert my path http://api.nytimes.com/svc/books/v2/lists/BooksPaperback.xml?&api-

  • Using layers in cc

    I realize layers are a thing of the past in cc, but I am now updating my site I created in MX (yes, my program was that old), and I used layers...so, now I cannot create new ones. Is it easy to just convert the whole page to a table, hopefully creati

  • Maximum size of RSS file

    I note that my rss - http://punkcast.com/podcast.xml - shows in the iTunes store but doesn't seem to work in iTunes itself. I'm wondering if it's because it's got too big - it's around 100k. I seem to remember reading somewhere that there is a limit.

  • Default set of books driven from the responsibility?

    Hi all, when users logs into financials, they can see certain sets of books depending on the responsibilities assigned to them. Is that assumption correct? If so, is there a way of retrieving that infrormation? (List of sets of books per responsibili