stored procedure returns zero results

Hello, please help me. I'm quite new to oracle stored procedures. I have a proc that returns data to the MTC, but he keeps giving no results. But if I don't use a stored procedure, the same query gives me something. Help, please. my stored proc and cfm goes something like below:

************************************ stored procedures **************************************
CREATE OR REPLACE PACKAGE IN THE PACK_REFCURSOR_NHM_TRANSACTION
TYPE TRANS_TableRows IS REF CURSOR;
PROCEDURE REFCUR_NHM_TRANSACTION)
IN_sTMPACC IN varchar2,
IN_sITEM_TYPES IN varchar2,
OUT_TRANS to TRANS_TableRows);
END PACK_REFCURSOR_NHM_TRANSACTION;
/

CREATE OR REPLACE PACKAGE BODY PACK_REFCURSOR_NHM_TRANSACTION AS
PROCEDURE REFCUR_NHM_TRANSACTION)
IN_sTMPACC IN varchar2,
IN_sITEM_TYPES varchar2,
OUT_TRANS ON TRANS_TableRows)
IS


BEGIN

OPEN FOR OUT_TRANS
SELECT T.TRANSACTION_ID, T.TRANSACTION_TYPE, T.TRANSACTION_DATE, T.TRANSACTION_TIME,
T.ITEM_CODE, 0 OE_DETAIL_ID,
T.QUANTITY, T.LIST_PRICE, T.DISCOUNT, T.SALE_PRICE, T.GST_AMOUNT, 'I' INSURER_TYPE
OF NHM_TRANSACTION T
WHERE DISPENSED_FLG = 'Y '.
AND T.ACCOUNT_ID = IN_sTMPACC
AND T.TRANSACTION_TYPE ('01', ' 02', ' 09')
AND NVL (T.STATUS, 'F'). = « C »
AND T.BILLED_FLG = N
AND T.ITEM_TYPE IN (IN_sITEM_TYPES)
AND T.BILL_ITEM_FLG = 'Y '.
UNION ALL
SELECT TRANSACTION_ID, TRANSACTION_TYPE, T.TRANSACTION_DATE, T.OE_TRANSACTION_ID
T.TRANSACTION_TIME, NVL (T.ITEM_CODE, T.PACKAGE_CODE) ITEM_CODE, T.OE_DETAIL_ID,
T.QUANTITY, T.LIST_PRICE, T.DISCOUNT, T.SALE_PRICE, T.GST_AMOUNT, THE OF ' INSURER_TYPE
OF NHC_OE_TRANSACTION T, NHC_MASTER_ITEM M, NHM_PACKAGE P
WHERE T.ACCOUNT_ID = IN_sTMPACC
AND T.ITEM_CODE = M.ITEM_CODE (+)
AND T.PACKAGE_CODE = P.PACKAGE_CODE (+)
AND (DECODE (T.ITEM_CODE, NULL, P.BILL_OPTION, M.BILL_OPTION) ('P', 'O', 'F'))
AND NVL (T.STATUS, 'F'). = « C »
AND T.BILLED_FLG = N
AND ((T.TRANSACTION_TYPE = ' 09 "AND STATUS IN ('P', 'R'))
OR T.TRANSACTION_TYPE IN ('01', '02', '11', '12', 10'))
AND T.BILL_ITEM_FLG = 'Y '.
AND T.ITEM_TYPE IN (IN_sITEM_TYPES);


END REFCUR_NHM_TRANSACTION;
END PACK_REFCURSOR_NHM_TRANSACTION;


cfm code (Note: I use coldfusion MX *)

< datasource = "" #application.datasource # cfstoredproc "procedure =" NSCOCT. PACK_REFCURSOR_NHM_TRANSACTION. REFCUR_NHM_TRANSACTION">
< cfprocparam type = 'IN' cfsqltype = "CF_SQL_VARCHAR" value = "' #TMPACC # ' dbvarname ="IN_sTMPACC">"
< cfprocparam type = 'IN' cfsqltype = "CF_SQL_VARCHAR" value = "#QRYLOCITEM. "ITEM_TYPE # ' dbvarname ="IN_sITEM_TYPES">
< name cfprocresult = "getPrescItems" >
< / cfstoredproc >

I getPrescItems of dumping and not return any data. It's supposed to return something. Any help is very appreciated. Thank you. *********

I've already found the solution and it worked. I guess that's the Oracle. In any case, just in case you might need it some time, here is the link: ask Tom

Tags: ColdFusion

Similar Questions

  • relative to the parameter in a stored procedure returns

    I'm doing a sp sp / sql with select and update, the idea is to return the value assigned in the select, but when I test the procedure about adding the parameter to the method PPerformance does not, in fact I am new to oracle, I searched some tutorials but I have not managed to solve the problem


    my source its:
    create or replace
    PROCEDURE PA_CONSECUTIVO (TipoConsecutivo in  VARCHAR2, AUXI OUT int )
    
    AS
    aux2 int;
    BEGIN
    
     SELECT consecutivo + 1 into aux2 FROM  tbl_consecutivo
        WHERE UPPER(ltrim(rtrim(Tipo_Consecutivo))) = UPPER(ltrim(rtrim(TipoConsecutivo)));
        
        UPDATE tbl_Consecutivo SET consecutivo = aux2 
    WHERE upper(ltrim(rtrim(Tipo_Consecutivo))) = upper(ltrim(rtrim(TipoConsecutivo))) ;
    
     AUXI:=aux2;
        
    
    
    END PA_CONSECUTIVO;
    the table og the request her:
    TIPO_CONSECUTIVO     VARCHAR2(20 BYTE)
    CONSECUTIVO     NUMBER(38,0)
    FECHAULTIMO     DATE
    I appreciate the help.

    Published by: 1008490 on 29-may-2013 07:49

    Your stored procedure has 2 settings while you provide 1. Use something like:

    SET SERVEROUTPUT ON
    DECLARE
        V_AUXI NUMBER;
    BEGIN
        PA_CONSECUTIVO('ENTRADA',V_AUXI);
        DBMS_OUTPUT.PUT_LINE('AUXI = ' || V_AUXI);
    END;
    /
    

    SY.

  • Cursor to another stored procedure return package

    Hello
    I am new to Oracle, and I have the following problem:

    I have a slider in a package that is defined like this:
    create or replace
    PACKAGE 'TestPACKAGE' AS
    DOWNLOAD_CURSOR cursor's select A.* from A Table1, Table2 B
    END TestPACKAGE;
    In reality, there is more than one package with different cursors. I want to use this DOWNLOAD_CURSOR in a stored procedure, function, or another package, to return to the client in a ref cursor
    Something like this:
    create or replace
    procedure aa_test (retCURSOR to sys_refcursor) is
    Start
    retCURSOR: = TestPACKAGE.DOWNLOAD_CURSOR;
    end;
    or replace this procedure with another method to return data and use in a .NET application.

    961449 wrote:
    There are so any solution to access TestPACKAGE. DOWNLOAD_CURSOR to .NET web application. I found how to access a stored procedure that returns a ref cursor
    And the package cannot be change, add a stored procedure that returns a ref cursor

    In this case, it is not possible. Your .NET code cannot directly access the static cursor declaration, because at this point it's just a statement, not an open cursor.
    Cursors declared that are opened using the PL/SQL code, using the OPEN cursor_name statement or variable IN the syntax of other cases.
    .NET and other external applications require a ref Cursor, so the only way you can get this query in a Ref cursor is to open the ref cursor in the query itself.

  • Error when the stored procedure returns a cursor in c pro


    Hello

    I tried to make things work, explained to the
    [2537153 m]

    He runs a stored procedure from pro c which returns a cursor.
    But when I compllie to c pro I get following error. My name of the procedure's TEST.
    If I change the output to an int value parameter. It compiles okay.



    PLS-S-00306, wrong number or types of arguments in the call to 'TEST '.
    Error on line 34, column 5 in file E:\C\Test\tt.pc
    TEST(:test_cursor);
    +.... 1 +.
    PLS-S-00000, ignored statement
    A semantic error on line 33, column 1, folder E:\C\Test\tt.pc:
    BEGIN
    + 1 +
    PCC-S-02346, PL/SQL found semantic errors

    Can make a point about what could be the error?
    I work from oracle 8i client. that connects to oracle 9.0.1.
    Operating system is win 2000 sp4

    Oh yes - differs from the code snippet I posted your with the declaration of the host cursor variable. A difference in the case. Is how important it?

    ( it's been almost 10 years since I've coded last in Pro * C, so be careful with these questions! ) ;-) )

  • Procedure returns no result

    Hi all

    I'm something of a novice to writing stored procs etc and have treid to build this suite docs of Oracle and other examples, it compiles OK but not return results (no line fits), during a test of the statement select because the cursor retrieves the data correctly, so I guess I'm not using ROWTYPE correctly, it's completely new to me.  The database is 11 GR 2.

    Thanks for your help.

    create or replace procedure SP_BI_GROUPS AS

    user_id varchar2 (10);
    DG_1 varchar2 (15);
    DG_2 varchar2 (15);
    DG_3 varchar2 (15);
    DG_4 varchar2 (15);
    DG_5 varchar2 (15);
    DG_6 varchar2 (15);
    DG_7 varchar2 (15);
    DG_8 varchar2 (15);

    cursor user_cur is

    SELECT user_id
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +', 1, 1) AS DG_1
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +', 1, 2), DG_2
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +' 1, 3) AS DG_3
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +' 1, 4) AS DG_4
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +' 1, 5) AS DG_5
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +', 1, 6) AS DG_6
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +' 1, 7) AS DG_7
    , REGEXP_SUBSTR (groupname_alt_017, "[^;]") +' 1, 8) AS DG_8
    OF s_nq_sched. BI_GROUPS where groupname_alt_017 is not null order by user_id;

    l_groupmembers groupmembers % ROWTYPE;
    Start

    for userid IN user_cur
    loop
    l_groupmembers.g_member: = user_id;
    l_groupmembers.g_name: = dg_1;


    -dbms_output.put (userid.user_id);
    Insert into groupmembers
    values l_groupmembers;
    commit;
    end loop;
    end;

    As others have said, probably (and more effective) for this using a single SQL statement instead of a PL/SQL loop. Yet, in the interest of education, the reason that your procedure does not work is here:

    l_groupmembers.g_member: = user_id;

    l_groupmembers.g_name: = dg_1;

    You have never assigned all values to the variables user_id or dg_1, then nothing goes in the two columns of l_groupmembers, and he will try to insert a row with two NULL values in it in your table (which may or may not be accepted, if they are NOT NULL columns). What you need to get this sort of work is this:

    l_groupmembers.g_member: = userid.user_id;

    l_groupmembers.g_name: = userid.dg_1;

  • How to test a procedure returns the result set

    Hello

    I have a following code:

    {color: #0000ff} create or replace the TYPES of PACKAGING
    AS
    type cursorType is ref cursor;
    end;

    create or replace PROCEDURE GetAllCategories (p_cursor in the Types.cursorType)
    AS
    Start
    Open p_cursor for SELECT * CATEGORY;
    end; {color}

    I would like to test the procedure of * {color: #000000} visualization output resultset {color} *. How can I do with SQL Developer?
    In fact, when select RUN in SQL Developer, I got the following code:

    DECLARE
    P_CURSOR types.cursorType;
    BEGIN

    GetAllCategories (P_CURSOR = & gt; P_CURSOR);
    END;

    When I run it, it is successful but there is no result set displayed. However if I execute SELECT * FROM category only in the SQL Editor, I see the result set in the grid. Then where the result set did when he went through the procedure?

    Thanks in advance for any help.

    Published by: CarbonFiber Sep 22, 2008 20:52

    Is a simple way with sqlplus

    SQL> create or replace package types
      2  as
      3     type cursortype is ref cursor;
      4  end;
      5  /
    
    Package created.
    
    SQL> create or replace procedure getallemp(p_cursor in out types.cursortype )
      2  as
      3  begin
      4     open p_cursor for select * from emp;
      5  end;
      6  /
    
    Procedure created.
    
    SQL> var lcursor refcursor
    SQL>
    SQL> exec getallemp(:lcursor)
    
    PL/SQL procedure successfully completed.
    
    SQL> print lcursor
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO        DIV
    ---------- ---------- --------- ---------- --------- ---------- ---------- ---------- ----------
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20         10
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30         10
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20         10
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30         10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30         10
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10         10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20         10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10         10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30         10
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20         10
    
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO        DIV
    ---------- ---------- --------- ---------- --------- ---------- ---------- ---------- ----------
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30         10
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20         10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10         10
    
    14 rows selected.
    

    Thank you
    Knani.

  • Double games of results returned on stored procedure call

    Hello

    I have a stored procedure created Java and called using the Spring JDBC using StoredProcedure class, stored procedure returns duplicate rows, is this a known problem?

    When I run the stored procedure even in DBVizualiser it not show correctly.

    The class below is used to execute the stored procedure:

    public class CustomerSearchProcedureRunner extends StoredProcedure {
     public CustomerSearchProcedureRunner(JdbcTemplate jdbcTemplate) {
      super();
      this.setJdbcTemplate(jdbcTemplate);
      this.declareParameter(new SqlReturnResultSet(RETURN_RESULTS, new CustomerRowMapper()));
      this.declareParameter(new SqlParameter(CUST_SP_IN_PARAM, Types.VARCHAR));
      this.setSql("{CALL INSURANCE.SEARCHCUSTOMER (?) ON ALL}");
      this.setSqlReadyForUse(true);
      this.compile();
     }
    }
    


    and Java Stored Procedure that runs SQLFire is given below:

    public class CustomerSearchProcedure {
     
     private static final String DOLLAR = "\\$";
     private static final String COLON = ":";
     private static final String CUST_NAME = "CUST_NAME";
     private static final String CUST_NO = "CUST_NO";
     private static final String GENDER = "GENDER";
     
     
     public static void searchCustomer (String customers, ResultSet[] outResults,
       ProcedureExecutionContext context) throws SQLException {
      StringBuilder sql = new StringBuilder();
      StringBuilder whereCondt = new StringBuilder();
      String[] tokens = new String[]{};
      
      if (customers != null && customers.trim().length() > 0) {
       tokens = customers.split(DOLLAR);
      }
      
      sql.append("<global>SELECT * FROM INSURANCE.CUSTOMERS ");
      whereCondt.append("WHERE CUST_PRIMARY IN ('Y', 'N') ");
      // Apply dynamic where condt
      for (int i=0; i < tokens.length; i++ ) {
       String token = tokens[i];
       if (token.startsWith(CUST_NO)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NO = " + token.substring(token.indexOf(COLON)+1));
       }
       if (token.startsWith(CUST_NAME))  {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NAME LIKE '"+ token.substring(token.indexOf(COLON)+1).trim() + "%'");
       }
       if (token.startsWith(GENDER)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("GENDER ='"+ token.substring(token.indexOf(COLON)+1).trim() + "'");
       }
      } //End of for
      
      if (whereCondt.length() > 0) {
       sql.append(whereCondt.toString());
      }
      
      Connection cxn = context.getConnection();
      Statement stmt = cxn.createStatement();
      ResultSet rs = stmt.executeQuery(sql.toString());
      outResults[0] = rs;
     } //END OF METHOD
    }
    

    A correction preceding: "for the case on the information in the TABLE of the DataSet to be targeted on each node is also sent for the tag requests will target only this dataset (and avoids duplicates).»

    should read "in the case of on TABLE query Tags will only target the local primary data on the node for tables partitioned, while for replicated tables, it is sent to only one of the lines (and so avoids duplicates in both cases).» WHERE clause to TABLE is not used for cutting data only for the size of the set of nodes to the target.

    The tag prunes yet the query to all of the local primary buckets in all cases (i.e. which WE ALL and on GROUPS of SERVERS) so the comment about and equivalent was incorrect. However, this will always be looking for data in duplicate for replicated tables and TABLE is the only way to avoid it for now.

  • Button action result depends on a call to a stored procedure

    Hello

    I'm developing an application using JDeveloper 10.1.3.4, JSF, and ADF BC 10.1.3.4.

    I have an "Update" button, its outcome of the action depends on the result of a stored procedure called by a method in my ApplicationModuleImpl (actionListener to the button - #{bindings ['call_stored_procedure'] .execute}).
    In particular, if the stored procedure returns "OK" the program can navigate to a new page of JSP, more of a case of navigation. If the stored procedure returns 'ERROR' no navigation should occur, the program must stop the JSP page. I need something like "raise form_trigger_failure" Oracle Forms. I tried to throw an oracle.jbo.ValidationException, but navigation take place instead.

    Thank you very much in advance

    Husband

    Load the SRDemo to jdev10.1.3 and see the classes ADFUtils nd JSFUtils. I guess they are also on the blog of Steve Muenchs here.
    Locate the getApplicationModuleForDataControl (...) method.

    Timo

  • How to return a value from stored procedure.

    Hello

    I have an insert in which insert a username through generated sequence number.

    I need this generated sequence number stored procedure return.

    Kindly help me to achieve this goal.

    It might be useful if there is a code sample for the same thing.

    Thank you
    Ahmed Shareefuddin

    Something like this:

    create or replace procedure xproc (num out number) is
    begin
     insert into mytab values (myseq.nextval);
     select myseq.currval into num from dual;
    end;
    /
    

    Max
    http://oracleitalia.WordPress.com

  • disconnected rowset select CachedRowSet of a statement within the stored procedure?

    Hello everyone

    I'm using CachedRowSet returned from a parameterized select statement and it works very well.

    If I put the same select statement in a simple read only then stored procedure I get this exception: "a result set has been generated for the update.

    I'm not trying to update all lines in my code.

    I tried to make the CachedRowSet to be read-only, but this does not help, same error.

    Question 1: a stored procedure returns a single result set can be called to fill a CachedRowSet read-only? (in a similar way to a method of CallableStatement prepareCall with input/output settings).

    Question 2: in general is something to be encouraged for future development or are they deprecated or replaced with something else or better using CachedRowSet, FilteredRowSet (disconnected) and WebRowSet, JDBCRowSet (connected)?

    Thank you very much in advance

    It work? (be sure that your stored procedure done * nothing * before running this query)

    PreparedStatement p = conn.prepareStatement ("{call dbo.p_testCachedJDBCRowSet (?)}" ");

    p.setInt (1, 10);

    CRS CachedRowSetImpl = new CachedRowSetImpl();

    CRS. Populate (p.ExecuteQuery ());

  • Find the stored procedure performance

    Hello

    which of these two options is faster? (cpu/memory load is not a problem)

    -A selection on a view using a statement WHERE
    -A stored procedure returns a REF_CURSOR

    Queries:
    1.) SELECT * FROM View_AllUsers WHERE userId = 1;
    (2.) SP_GetUser (1);


    Scenario:

    Users table)
    UserID INT,
    username VARCHAR
    )

    View_AllUsers 'userId', 'user name '.
    SELECT username, username OF THE USERS;

    SP_GetUser (@UserID)
    SELECT username, username OF USERS WHERE userId = @userId;

    Top hand, retrieving a result using SQL directly is going to be faster wrapping it in a stored procedure because you add another layer to it.

    Here is an example to prove:

    SQL > CREATE TABLE test AS SELECT MOD(OBJECT_ID,17) AS USERID, OBJECT_NAME AS USER_NAME FROM ALL_OBJECTS;
    
    Table created.
    
    SQL > CREATE VIEW test_vw AS SELECT * FROM test;
    
    View created.
    
    SQL > CREATE OR REPLACE PROCEDURE test_sp(ID IN test.userid%TYPE, cur OUT SYS_REFCURSOR)
      2  AS
      3  BEGIN
      4     OPEN cur FOR SELECT * FROM test WHERE USERID = ID;
      5  END;
      6  /
    
    Procedure created.
    
    SQL > set timing on
    SQL > set autotrace traceonly
    SQL > var ID NUMBER;
    SQL > var ref REFCURSOR;
    SQL > exec :ID := 15;
    
    SQL > SELECT * FROM test_vw WHERE USERID = :ID; -- Just to "warm" up the cache
    
    847 rows selected.
    
    Elapsed: 00:00:00.23
    
    SQL > exec test_sp(:ID,:ref);
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.03
    SQL > print ref -- Again "warming" up the cache
    
    847 rows selected.
    
    Elapsed: 00:00:00.32
    SQL > SELECT * FROM test_vw WHERE USERID = :ID;
    
    847 rows selected.
    
    Elapsed: 00:00:00.17
    SQL > exec test_sp(:ID,:ref);
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.03
    SQL > print ref
    
    847 rows selected.
    
    Elapsed: 00:00:00.21
    SQL > SELECT (.21-.17)/.17*100 AS PERCENT_DIFF FROM DUAL;
    
    PERCENT_DIFF
    ------------
      23.5294118
    

    As you can see, the view was much faster because there is no overhead associated with MS and PL/SQL context switching.

  • Recordset Paging with a stored procedure in MSSQL

    Hi all
    I have a problem with the paging recordset using a recordset of a procedure stored in MSSQL 2000.

    The page works fine without the Recordset pagination feature. That is, it returns a recordset and displays the information on the screen as expected. However, as soon as I add this feature in, the page of the database server indicating that a parameter has not been supplied to the stored procedure returns an error. I suspect that this could be to do with the refresh in the service.

    Has anyone encountered this problem before and all the ideas how to get around?

    Any help appreciated.

    Thanks in advance.

    Ben.

    Thanks for all your help. This works a treat!

    I didn't know it was possible to run a stored procedure from the behavior of the recordset object. I was under the impression that the stored procedures must be accessible by the behavior of 'command '. A new day to dawn!

    Thank you!

  • Passing the params in mysql stored procedure

    Makes no mistake, but when I hard code the values in the stored procedure, I get results, I leave as params - if not.
    Something must be a miss with how I said, but I can't understand that:

    Can anyone help? details below:

    : the stored procedure:

    Create procedure keyword_getBySource (in sourceRecordName varchar (20), in sourceRecordId varchar (50))
    Start
    Select
    tblkeyword.*
    Of
    tblkeyword,
    tblrecordlink
    where
    tblrecordlink.sourceRecordName = @sourceRecordName
    and
    tblrecordlink.sourceRecordId = @sourceRecordId
    and
    tblrecordlink.linkRecordName = 'keyword'
    and
    tblkeyword.keywordId = tblrecordlink.linkRecordId
    ;
    end

    : cfm:

    "< cfstoredproc procedure ="keyword_getBySource"datasource =" "username =" "password =" ">
    < cfprocparam type = 'in' cfsqltype = "CF_SQL_VARCHAR" dbvarname = "sourceRecordName" value = "Log" / >
    < cfprocparam type = 'in' cfsqltype = "CF_SQL_VARCHAR" dbvarname = "sourceRecordId" value = "0d8a6d3e-cf1e - 19(d) 5-2b9fc8ee1de01ad0" / >
    < name cfprocresult = resultset "getBySource" = "1" / >
    < / cfstoredproc >

    @... seems mysql does not use these to designate the params in a stored procedure

    Take them out - it works.

  • I need to return the result of a query on a stored procedure

    I need to return the result of a query to a stored procedure, I mean when I run a stored procedure it returns a result set in a select statement.
    Best regards...

    Hello.

    Do you really want a stored procedure for this?
    Why not just a script that contains the query?

    Assuming that you don't really want a stored procedure, you'll have to decide what to do with the results.
    An option is a slider.

    For example, you can write a procedure of this type to hold the query:

    CREATE OR REPLACE PROCEDURE USP_TEST
    (     out_cursor     OUT     SYS_REFCURSOR
    )
    IS
    BEGIN
         OPEN  out_cursor
         FOR     SELECT     *
              FROM     scott.emp;
    END  USP_TEST;
    /
    SHOW ERRORS
    

    You can move the cursor to another procedure for handling.

    You could test this in SQL * more by creating a variable blond:

    VARIABLE     usp_test_cursor     REFCURSOR;
    
    EXEC  usp_test (:usp_test_cursor);
    
    PRINT     :usp_test_cursor
    
  • How to do a select on the results of a stored procedure?

    Hello

    I am new to Oracle. I work with SQL Developer.

    I'm doing a simple select on the results of a stored procedure call. I don't know how to do it. Here's what I have so far:

    declare
    type ref_cursor is ref cursor;
    results ref_cursor;
    Start
    MyStoredProcedure (123 results);
    Select * from results;
    end;
    /

    but he said to me:

    Error from the 1 in the command line:
    declare
    type ref_cursor is ref cursor;
    results ref_cursor;
    Start
    GET_TAX_TYPE_BY_TAX_ENTITY_KEY (60670100000000, results);
    Select * from results;
    end;
    Error report:
    ORA-06550: line 6, column 15:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 6, column 1:
    PL/SQL: SQL statement ignored
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:

    Obviously, select * results; is not the right way to do it. But what is?

    Thanks for any advice forthcoming.

    If a SQL cursor is built by a reporting system, a Java application, a c# program, or a PL/SQL call - the database doesn't care, because he doesn't know the difference. A Select SQL cursor created in PL/SQL through the ref cursor interface, won't be faster than the same SQL select in Eclipse. If the SQL source code is the same, the same cursor SQL program will be used by both.

    What give you BIRT is the flexibility of the use of code Server (PL/SQL) to create the slider - this code doing business and technical decisions on how to design side than SQL, Select. Which is a good thing because it summarized the data model and the complexity BIRT server technique.

    So my choice would be to use the procedural interface and return to the reporting system for the rendering of the ref Cursor.

    The question of a slider running via the slider (selection of a cursor), is questionable. Yes, there are a set of specifications that allows to do this kind of thing. But it must be very firmly justified and careful design because it really is an exception. I personally (blame my DBA) would need a justification because it is much more of an exception. I have never seen it put in place in production in more than a decade of DBA'ing, despite the developers try to use such a hack - as it has always been much more powerful and the deployment of alternatives.

    The concept for robust and efficient code for Oracle is: Maximise SQL. Minimize the PL/SQL (or Java / c# / etc.).

    That means when it comes to database power, write an SQL program to do. Stop thinking of SQL as a language of data recovery a single simplistic statement. Think of it as a programming language. Extremely complex problems can be resolved with a single SQL, which requires easy code 100 + lines of PL/SQL, Java, or c#. Write SQL programs. Not SQL one-liners for a grinding program PL/SQL or Java data.

    Why then PL/SQL? It is the best language to manage the creation of SQL, dealing with the process flow, conditional processing, and so on of exception handling. It is less than SQL (such as Java and c#) in the treatment of the data.

Maybe you are looking for