Execute Store procedure from derived table

I would like to create a devired table to use in the LOV for my prompt.  Can I execute a store procedure in the defintion of the derived table instead of a sql statement ?  My store procedure is in a sql 2008 database

Derived Table and SP are not the same. Derived table is more like a database view and is not a replacement for SP. I'd suggest you to use Derived table only if it is not possible to create a database table/view.
Is it necessary for you to use your stored procedure as a data source? Are you trying to join it's result set to another table or view?
You can create Materialized view in the database. Use that as a table in Universe.
Try to use this object LOV in your prompt.

Similar Messages

  • Execute store procedure from form

    How do I execute a store procedure from FORM
    I have a store procedure in the database
    all it does insert a value to table test.
    in 'WHEN-NEW-INSTANT-TRIGGER' of the form MODLUE I put
    test_curor; (name of the store procedure)
    The module does have block or any thing it.
    There was no syntax errors or form error
    but it did not insert into the table.
    Why????

    I just tested this myself and you are right. If you have one block with no items in it the when-new-form-instance trigger will not be fired. I got a message back saying 'block had no items', though it ran OK. This kinda makes logical sense, since there is nothing for the form to do. I put a button onto the block and the procedure fired no problem. I must admit I have never tried creating a form with no items in it so I haven't seen this behaviour before.
    Shucks you live and learn every day!

  • Executing Stored procedure from host file

    Hi all,
    I am trying to execute a procedure from a host file.I don't know where I am doing wrong but the procedure is not executing.
    #!/bin/bash
    echo "*********************** Initializing Global Variables ***********************"
    export CONNECT_STRING=$1
    export START_TIME=`date +%m/%d/%Y:%H%M`
    #export DATE_FROM=`date +%m/%d/%Y:%H%M`
    #export DATE_TO=`date +%m/%d/%Y:%H%M`
    DATE_FROM=$5
    DATE_TO=$6
    sqlplus -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S ${CONNECT_STRING} <<EOF
        WHENEVER SQLERROR EXIT FAILURE
        set echo off
        execute xxjy_extract_ar_transactions.main_preinterface('$DATE_FROM','$DATE_TO');
    EOF
    echo "From Date is $DATE_FROM"
    echo "To Date is $DATE_TO" In my log i can see the From Date is 1-Jan-2013 and To date is 28-Feb-2013 which are my input parameters to concurrent program.But I don't understand why my procedure is not getting called.
    Please advice.
    Thanks,
    Sandeep

    Please post the details of the application release, database version and OS.
    Is the issue with this specific host concurrent program?
    Did you follow the steps in these docs?
    How to Register a Host Concurrent Program in Applications [ID 156636.1]
    How To Create A Custom Concurrent Program With Host Method and Pass Parameters To The Shell Script [ID 266268.1]
    How Do You Run A Unix Host Script From Concurrent Managers On MS Windows Platform? [ID 412392.1]
    How To Setup A Custom Concurrent Host Program [ID 147455.1]What is the reason of using more than one "-S" in the sqlplus command?
    Please enable trace and generate the TKPROF file to find out what is happening when you kick off this concurrent program?
    FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
    How To Trace a Concurrent Request And Generate TKPROF File [ID 453527.1]
    Thanks,
    Hussein

  • Calling Oracle store procedure from Crystal 11 command

    I need to call Oracle store procedure from Crystal Command. The Store proc has ref cursor. Is it possible. Can you post few examples?
    Also, is it possible to have multiple sql statements in a Crystal Command, when working with Oracle 10g?
    It is working for SQL server.

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly.

  • Execute oracle procedure from SSIS

    is it possible to execute Oracle procedure from within SSIS?
    thanks

    Hi,
    I used
    begin
    test1;
    end;
    and it is giving - SSIS package "Package.dtsx" finished: Success, but it is not doing anything.
    "test1" procedure has couple of insert statements and a commit statements but the package is not inserting anything.
    Also when I use "exec test1;" it is failing with the error mentinoed here in the forum.
    Any idea what is wrong here?

  • How to execute a procedure from BODI?

    Hi Pals ,
    I have procedure in my database say EMP_PROC. I want to execute this procedure from the BODI environment.Please do let me know.
    Thanks in advance.
    Regards,
    Diras

    you have to import the stored procedure in the datastore
    and after importing you can call the stored procedure in the mapping
    use import by name option in datastore, and select function in type and enter the name of stored proc that you want to use in DI
    check technical manual for more details on importing functions and stored procedure

  • Execute Stored Procedures from Stellent

    Can we execute stored procedures from stellent 7.5.2 ?
    By using java, I dont find any method to execute stored procedure from WorkSpace interface.
    Please guide me to solve this..
    Appreciate your help and efforts.

    May not be exactly what you're looking for, but I hope this helps:
    http://www.corecontentonly.com/Blog/Calling-A-Stored-Procedure-From-Oracle-Fusion-ECM-Stellent
    For java based execution basically:
    1. Create your stored proc in the db
    2. Create a component
    3. Create a query resource
    4. In your java code use the createResultSet method of the Workspace object and pass in the name of your query resource and then the current databinder object

  • APEX_MAIL.SEND() not seen executing MY procedure from TOAD

    Hi,
    I have a procedure that calls APEX_MAIL.SEND and works fine when executed from within the app or in the APEX Workshop window.
    Trying to execute MY procedure from an Oracle job we get an error unknown procedure APEX_MAIL.SEND
    anyone have this problem?

    Hello,
    Why don't you use utl_smtp package if you are wanting to send email from pl/sql?
    If you look at the help for APEX_MAIL its says:
    APEX_MAIL
    You can use the APEX_MAIL package to send an email from an Oracle Application Express application. This package is built on top of the Oracle supplied UTL_SMTP package. Because of this dependence, the UTL_SMTP package must be installed and functioning in order to use APEX_MAIL.
    So APEX_MAIL will only work within a valid apex session and it won't be available to a toad session .
    Cheers,
    Paul.

  • Execute ORACLE STORE PROCEDURE from DATABASE

    Hi Everyone...
    i have a store procedure, it has a 5 params, 3 are IN parameters and 2 left are OUT parameters, I need execute this store procedure using a SQL Intruction like this
    DECLARE integracion_sia_kac PROCEDURE FOR KACTUS.SP_SIAKAC_NMDHODO
    :ll_horario,
    :ll_ide_doc,
    :ls_con_kac,
    @PINDREGI=:ls_ind_registro output, @PVALERRO=:ls_error_int output
    USING gt_kactus;
    i think this function is using from MSSQL Server, this has a three IN params but the declaration of the OUT params I don't understand.
    HELP ME!!!!!.... I need know way to execute the SP
    Thanks

    Well it is very simple!
    example:
    CREATE OR REPLACE PROCEDURE PROC1 (P1 IN NUMBER, P2 IN NUMBER, P3 OUT NUMBER) IS
    BEGIN
    P3 := P1 + P2;
    END;
    This is how to use PROC1 from, say, PROC2 :
    CREATE OR REPLACE PROCEDURE SomeShema.PROC2 IS
    Var1 NUMBER(15,2);
    Var2 NUMBER(15,2);
    ReturnParamFromPROC1 NUMBER(15,2);
    BEGIN
    Select SomeField INTO Var1 from Table1 where Table1.ID = 10;
    Select SomeField INTO Var2 from Table2 where Table2.ID = 20;
    PROC1(Var1, Var2, ReturnParamFromPROC1);
    DBMS_OUTPUT.PUT_LINE('Returned value from PROC1 is : '||ReturnParamFromPROC1);
    END;

  • Execute store procedure( in Id, in out RefCursor), and data fetched in ref cursor should be sent out as excel sheet.

    I am trying to make a ssis package that get the data calling the store proc with two param one is ID and other is Sys_refcursor. Say Store Proc as ListName(Id int, myCur sys_refcursor), which gets the datas with the conditions inside it.
    REATE OR REPLACE PROCEDURE schemaName.LISTNAME (P_ID  IN INT, LST_NAME_REFCUR   IN OUT SYS_REFCURSOR)
    IS
    P_NAMESOURCE_ID INT;
    BEGIN
        SELECT SOURCE_ID INTO P_NAMESOURCE_ID FROM SEARCHING_TABLE ST WHERE ST.ID = P_ID;           
                   IF (P_NAMESOURCE_ID=1)
                   THEN
                      OPEN LST_SOURCE_REFCUR FOR 
                            SELECT ST.ID,
                                   ST.TRANSACTION_DATE AS TRAN_DATE,
              IF (P_NAMESOURCE_ID=1)
                   THEN 
                      OPEN LST_SOURCE_REFCUR FOR             ....     
    then i need to get the data from that refcursor and fetch those data to excel sheet to a virtual directory.
    Any help would be appreciated. I am new to SSIS. and i need to do this assignment this friday. 

    Hi 11srk,
    To fetch data from Oracle store procedure, you can use a Script Component as source to call the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please
    see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx  
    Regards,
    Mike Yin
    TechNet Community Support

  • Store data from a table into excel sheet and email

    Hi all,
    I am just wondering, i m not sure where to start. I want to insert data from a table into an excel spread sheet.
    I'm working on a stored procedure with 3 input parameters:
    1. the actual query
    2. userid
    3. the column headers (comma separated) - these will be in the same order as the outer select statement in the query itself. I will use the column headers for the respective columns in Excel worksheet.
    When the proc is executed, the excel is populated. If the record count is > 65536, then I need to create multiple worksheets in the same excel file.
    How can i do that? Can any body please help with this..?

    We are doing like this ( Not sure whether it is the best method available)
    --Get the output of the query (Since the number of columns is not fixed you would have to use dbms_sql package)
    --loop through the output and write into a file, for example test.csv, using UTL_FILE package
    --load the file into a blob variable(we are doing it by loading it into a table)
    --For mailing You can use the below package
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
    Mailing code we are using is given below:
    CREATE OR REPLACE procedure xls_mail(
        p_sender     varchar2, -- sender, example: 'Me <[email protected]>'
        p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
        p_subject    varchar2, -- subject
         p_text           varchar2, -- text
         p_filename      varchar2, -- name of xls file
         p_blob           blob         -- xls file
    ) is
      conn      utl_smtp.connection;
      i number;
      len number;
    BEGIN
      conn := demo_mail.begin_mail(
        sender     => p_sender,
        recipients => p_recipients,
        subject    => p_subject,
        mime_type  => demo_mail.MULTIPART_MIME_TYPE);
      demo_mail.begin_attachment(
        conn         => conn,
        mime_type    => 'application/xls',
        inline       => TRUE,
        filename     => p_filename,
        transfer_enc => 'base64');
        -- split the Base64 encoded attachment into multiple lines
       i   := 1;
       len := DBMS_LOB.getLength(p_blob);
       WHILE (i < len) LOOP
          IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
          ELSE
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, (len - i)+1,  i)));
          END IF;
          UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
          i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
       END LOOP;
      demo_mail.end_attachment(conn => conn);
      demo_mail.attach_text(
        conn      => conn,
        data      => p_text,
        mime_type => 'text/html');
      demo_mail.end_mail( conn => conn );
    END;

  • Call store procedure from pre-mapping

    Hi,
    I am currently working on OWB client version 10.2.0.4.36.My requirement is to call store procdure from pre-mapping tranformation.How to achieve this & how to pass parameters to the store procedure?
    Please let me know.
    Thanks,
    Siva

    Thanks for the quick reply.I am doing the same way as suggested.But am getting warning,when I validate it and is expecting to synchronize it.What warning you got exactly and i think you have not deployed the procedure.
    The reason for this procedure is to select max value from one of the table and then drop & recreate the sequence with max value + 1.
    Inside the procedure,am doing this all dynamically.which means am passing Columnname,tablename & sequencename to this procedure.
    Do you think is this good approach or any other advisable approach?Can you explain you requirement then only we can suggest the better way .
    Cheers
    Nawneet

  • How to call store procedure from an oci program

    Hello,
    I work on Oracle 8.1.7 under AIX.
    I must call from an OCI C++ program a store procedure that have an result set as param out.
    I'm not sure how can I call the procedure/function. I want to execute this statement and fetch the results.:
    " CALL Department.get_all (:1) " is this OK?
    " Call department.GetAll() into :1 "
    I have seen some example from an PL/SQL block but that's not ok for me.
    what i have done:
    i have created an package
    create or replace package department as
    type cursor_type is ref cursor;
    procedure get_emp( i_deptno in number, rs out cursor_type );
    procedure get_all( rs out cursor_type );
    function GetAll return cursor_type;
    end department;
    create or replace package body department as
    procedure get_emp ( i_deptno in number, rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp
    where deptno = i_deptno;
    end;
    procedure get_all ( rs out cursor_type )
    as
    begin
    open rs for
    select empno, ename
    from emp;
    end;
    function GetAll return cursor_type
    as
    l_cursor cursor_type;
    begin
    open l_cursor for select ename, empno from emp;
    return l_cursor;
    end;
    end;

    Hi,
    I am new to OCI facing the same problem you have mentioned, If you have found out how to solve it , can you post the answer for the same.
    Thanks
    Mani

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • Facing error while trying to execute stored procedure from JSF Application

    Hi, I am facing the below error when I try to execute a stored Procedure from JSF application which is deployed on WAS 7.0
    =2013-03-04 19:06:58,550 INFO [com.lloydstsb.iw.util.DBUtils] - DBUtils : executeFileNetStoredProc method started..
    =2013-03-04 19:11:58,271 ERROR [com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl] - Data Access Exception
    com.lloydstsb.iw.common.exceptions.DataAccessException: Data Access Exception Occured : Integration Stored Proc- java.sql.SQLException: java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
         at com.lloydstsb.iw.util.DBUtils.executeFileNetStoredProc(DBUtils.java:959)
         at com.lloydstsb.iw.util.DAOUtil.executeFileNetStoredProc(DAOUtil.java:117)
         at com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl.updateFileNetDetailsCustomDB(FileNetCustomDBSynchDAOImpl.java:36)
         at com.lloydstsb.iw.servlet.IndexServlet.service(IndexServlet.java:127)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
         at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
    The oracle version we are using is 11g.
    Previously it worked fine when the application was used in 10g.
    Can someone please help me in resolving this issue?
    Kiran
    Edited by: 991640 on Mar 4, 2013 8:25 PM

    java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
    Are the the JDBC JARs packaged with the application? If so, remove the applicaiton packaged JDBC JARs as the JARs are also in WebSphere application server.

Maybe you are looking for