Equivalent DMBS_SQL.to_refcursor in Oracle 10 g

Hello


Is there another way to get results like a refcursor in Oracle 10 g with DBMS_SQL? I have the function the function to generate dynamic query and running with DBMS_SQL. This function is called by the code java to display the result in a report. How can I do this, is it equivalent in Oracle 10 g for the DMBS_SQL.to_refcursor? Help, please.

Thank you

ilkinesrefli wrote:
I know there is no way to convert DBMS_SQL result to refcursor in Oracle 10 g, there is no method to_refcursor for DBMS_SQL, but there must be a solution.

Why should he? Why add new features if they do reproduce existing functionality.

>

odie_63 wrote:

open myRefCursor for 
using , , ...

It is impossible to use open... for my query method.

Why?

I can use only DBMS_SQL.

Why?

I need solution to send java code resultset after performance of DBMS_SQL. I do not know collections, temporary tables or other methods can help me or not.

Are you certain of collections and temporary tables are possible for you?

You could fill in as an interim step that will slow down your process and select data here, but that will involve using open impossible anyway.

If you have a variable number of input to the query variables, there are several possible solutions using native dynamic SQL code described here.

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

Tags: Database

Similar Questions

  • What is the equivalent of longbinary in oracle 11g?

    Hello

    I just want to now what is the equivalent of the LongBinary data type in oracle 11g.

    Thank you.

    BOO!

  • OPTIMIZE the equivalent FOR UNKNOWN in Oracle

    Hello

    Oracle have something like "optimize for unknow" SQL Server?
    Here is the link which explains the mechanism:
    http://blogs.msdn.com/mssqlisv/archive/2008/11/26/optimize-for-unknown-a-little-known-SQL-Server-2008-feature.aspx

    Best.

    Not sure if it is an exact equivalent, but you could achieve similar results by statistics settings using the DBMS_STATS package.

  • Is there an equivalent to dateadd in oracle?

    So I have a line of code in MS SQL
    HDATE > = DATEADD (DAY,-@V_NUMDAYS, GETDATE ()))

    I'm not sure how to translate this to oracle...

    I compared for HDATE to see if it is greater or equal to today - @V_NUMDAYS (which is a whole number) so it will compare the hdate at less than today's date 10 days...

    Just add a number

    as sysdate + 10

    SQL> select trunc(sysdate) dd , trunc(sysdate)+10 dd2 from dual
    
    DD        DD2
    --------- ---------
    21-MAY-09 31-MAY-09
    
  • Oracle equivalent of "by".

    Hello


    I need to convert sql Oracle procedure procedure and it uses the table expression common "with".

    can someone tell me if there is an equivalent of "with" in Oracle

    It is used like this.

    with bcount (Bookid, [count]) as
    (
    Select b.Bookid as ID, count (b.bookid) as [Count]
    Book b (nolock)
    B.Bookid group
    )
    Select i.Bookid, bcount. [number], count (i.Bookid)
    inventory I have (nolock)
    bcount on bcount.bookid = i.Bookid inner join
    I.Bookid group, bcount. [count]
    having bcount. [number] - count (i.Bookid) > 3




    DO you think that using a composite data type is a good option?

    Thank you

    Published by: user6287828 on March 12, 2009 16:19

    The Oracle WITH equals.

  • Use BeehiveOnline to create the internal/external email address

    I need to have an e-mail alias which will reach internal and external members. I used to be able to use the APS to create an e-mail alias and add two internal members and external to Oracle. Now I thought I should use BeehiveOnline.

    I created a group that includes an external member. How can I view the email address for the Group (if it was created automatically when I created the Group) or create an e-mail alias which sends e-mail to each Member of the Group?

    Hello

    If you have created a group on BeehiveOnline it is, by default, a distribution list with everyone in it - internal and external.

    The recommendation is to create a group, but unless you need the workspace to select No for the "required default Workspace:" option.

    Once the group is created there will be an equivalent of [email protected] e-mail address so if your group was called "Acme" your email address to send to the members of the Group would be "[email protected]".

    Phil

  • Question FIRST_VALUE in BI after migrating discoverer

    Hi all

    I migrated data discoverer of OBIEE.

    I have a problem with a column in Oracle BI answers ask who owns properties in Explorer as


    PR year sales (month)

    FIRST_VALUE (digit SUM) ON (PARTITION of Sales Force, region, territory name name, "customer account name sold", GPH Segment2 ORDER 'YEAR (7)' CSA LIE BETWEEN the '12' MONTH INTERVAL PRECEDENT AND INTERVAL '12' MONTHS PREVIOUS ")

    Could someone suggest an equivalent of this in Oracle BI answers request.

    Also with regard to the ORDER BY 'Exercise (7)' CSA RANGE BETWEEN the INTERVAL '12' MONTHS PREVIOUS AND the INTERVAL 12' MONTHS PREVIOUS)

    I the Period column (7) Fiscal OBIEE, could also somebody throw some light "RANGE BETWEEN INTERVAL '12' MONTHS PREVIOUS AND ' 12 INTERVAL" MONTHS PRECEDENT "»

    Thank you
    Vinay

    Use,

    EVALUATE (' FIRST_VALUE (%1))
    COURSE (SCORE OF 2%, 3% [NULL]...)
    ORDER BY %7
    BETWEEN THE INTERVAL %8 MONTHS PREVIOUS AND INTERVAL %8 MONTHS PREVIOUS) "ACE DOUBLE"
    col1,
    col2,
    col3,
    ..
    ..
    ..

    "Exercise (7)."
    '12')

    Kind regards
    Rambeau

  • OPENXML, sp_xml_preparedocument and sp_xml_removedocument equivalent to Oracle

    Hello

    I've stored in MSSQL, that must be translated to Oracle.

    MS in MSSQL

    CREATE PROCEDURE [dbo]. [pptChnlGrpChnl_d_xml]

    "@xmlOptinChannel nvarchar (max) - < TeamProfile > < UserProfile = companyTeamID" "userID =" "/ > < / TeamProfile >


    AS

    DECLARE @docid int

    DECLARE table (@TableOptins)

    OptinChannelGroupID int,

    ChannelID int

    )


    EXEC Sp_xml_preparedocument @docid OUT, @xmlOptinChannel

    -Populate a temporary table with records of user (s) for removal

    INSERT INTO @TableOptins (OptinChannelGroupID, ChannelID)

    SELECT tm. OptinChannelGroupID, tm. ChannelID

    OF OPENXML (@docid, "/ GroupChannels/GroupProfile")

    WITH (int OptinChannelGroupID,

    Int ChannelID) tm

    EXEC sp_xml_removedocument @docid

    Return 0

    Any suggestion?

    Oracle uses an object of type "XMLTYPE" appointed to represent an instance of XML document (or fragment) in the database.

    An instance of XMLType can be built on a file pointer (BFILE), a BLOB, a CLOB or VARCHAR2 variable or column using the corresponding XMLType constructor.

    In recent versions, Oracle recommends to use the XMLParse SQL function when dealing with an input XML string.

    If the nearest equivalent to the call to sp_xml_preparedocument and sp_xml_removedocument would simply use the XMLType constructor, or the above function.

    OPEN_XML more close 'equivalent' in Oracle's SQL/XML XMLTABLE standard function, which offers many more rich because it is based on the XQuery language.

    In your case:

    select x.OptinChannelGroupID
         , x.ChannelID
    from xmltable('/GroupChannels/GroupProfile'
           passing xmlparse(document p_input_xml)
           columns OptinChannelGroupID integer path '@OptinChannelGroupID'
                 , ChannelID           integer path '@ChannelID'
         ) x
    ;
    
  • output equivalent $action in oracle

    Hi all

    I am my code of SQL-Server migration to Oracle.

    I'm going to merge statement... I'm able to migrate oracle fusion.

    But I pulled out$ action in SQL server. I don't know the equivalent in oracle.

    Help, please.

    You can use a trigger "after the line insert/update" on the target table. to insert in the tracking table.

    would it not easier to add one or more columns to target on "insert/update", you would think that this information and who introduced data updates, when it could be useful for the audit.

    use one with a trigger for insert/update on the target table connect this info before

    Post edited by: 919871

  • Developer equivalent Edition for Oracle?

    I'm a software developer and database which currently specializes in Microsoft SQL Server, but I'd like to be able to offer Oracle to my customers as well.  I use SqlServer MS SQL Server Developer Edition on my laptop, which has all the technical features of SQL Server, but is allowed only for development purposes and is very cheap (under $ 150).

    I took some training for Oracle, but I would get something similar for learning, practice, try things and development on my laptop.  Is there something equivalent available for Oracle developers?  I tried Google this, but that just begins to turn upward of "SQL Developer for Oracle" which I * think * is just the developer GUI and not the DBMS itself. (?)

    If it's important, my laptop is running Windows 7 x 64.  Thank you...

    You can use the version business development for free and download from OTN.

    See the license here: terms of the OTN Developer license

    But if you want to go to production, you will need a permit.

    Do not use XE for development - because it has several limitations - if your customer is going to buy a license.

    Post edited by: Zoltan Kecskemethy
    Adding link license

  • SQLFire equivalent to Oracle's DECODE?

    I have a few views Oracle I need to migrate to SQLFire who have DECODING features in them - best practices to find out how to create equivalent SQL in SQLFire?

    Thanks, Jeff

    Hi Jeff

    The CASE expression provides a replacement in accordance with standards of the Oracle DECODE functions.

    concerning

    Felicia

  • equivalent of CLRSplitSting function for sql server Oracle

    Hello friends,

    I have a query in SQL Server - which becomes data.

    Select addl_info_id, sort_seq, code, row_data, addl_info_group_id, group_sort_seq, group_row_data from dbo. CLRSplitString('2406081,2410381,2427008,2430449,2466981,2495083,1586420,2406081,2410381,2427008,2430449,2466981,2495083,1586420','',',') x v join ein_addl_info_v on x.col1 = v.addl_info_id order by sort_seq
    We have same data in oracle too, so I converted the query above to sql to ORACLE like this server...


    Select addl_info_id, sort_seq, code, row_data, addl_info_group_id, group_sort_seq, group_row_data from (with t as)
    Select '2406081,2410381,2427008,2430449,2466981,2495083,1586420,2406081,2410381,2427008,2430449,2466981,2495083,1586420', ",","double str
    Select regexp_substr(str,'[^,]+',1,level) sub_str *) t connect by level < = regexp_count (str, ',') + 1) x *.

    Join cnh_cs_targ_csce_eur_1.ein_addl_info_v v x.sub_str = v.addl_info_id order of sort_seq


    but I don't get all the data. Can someone check if the query oracle above is equivalent to the above SQL query.

    Thank you/Kumar

    Published by: kumar73 on February 15, 2013 08:47

    So your query:

    select  addl_info_id,
            sort_seq,
            code,
            row_data,
            addl_info_group_id,
            group_sort_seq,
            group_row_data
      from      xmltable(
                         'ora:tokenize($str,",")'
                         passing ',2406081,2410381,2427008,2430449,2466981,2495083,1586420,2406081,2410381,2427008,2430449,2466981,2495083,1586420' as "str"
                         columns col1 varchar2(2000) path '.'
                        ) x
            join
                ein_addl_info_v v
              on x.col1 = v.addl_info_id
      order by sort_seq
    /
    

    SY.

  • SQL Server WaitFor Delay ' 00:00:15 ' equivalent in Oracle

    Does anyone know of an equivalent of the SQL Server SQL command WaitFor Delay ' 00:00:15 ' equivalent in SQL Oracle?

    Good, but I would say that if you do not understand WHY you wait 15 seconds then there is no need to wait 15 seconds.

    After all, it costs money ONCE to write a customization, it costs money to infinity to run bad code every day...

    Here's the code to put your DB in a useless loop.

    The exact time it will take depends on how quickly your database, so increase the number of zeros for scale at the break you want.

    select max(level)
    from    dual
    connect by level <= 1000000
    
  • For XML - Equivalent Oracle:

    Hey people,

    I was wondering... SQL server has the clause 'for xml path "; that the oracle has its equivalent?

    I was not able to find all the tracks online. Thought that know the experts here.

    Thank you.

    Published by: user10175043 on May 23, 2011 11:06

    Read this

    XML parent child records

    G.

  • What is the equivalent of the Oracle of the FIRST of Microsoft Access function?

    Use: Oracle 10 g 2 RAC on SUSE Linux 9 (10.2.0.3)

    In the process of conversion of a Microsoft Access database to Oracle, an Access query uses the FIRST function.
    What is the equivalent of the Oracle of the FIRST of Microsoft Access function?

    In the conversion attempt, FIRST_VALUE Oracle has been used. However, the same results was not reached.
    Thank you
    (BLL)

    Query:
    H2. ACCESS:
    SELECT
    TRE. GCUSNO,
    UCASE ([DCUSNO]) AS DCUSNO_STD,
    * FIRST (UCASE ([DNAME])) AS DNAME_STD *.
    * FIRST (UCASE ([DADDR])) AS DADDR_STD *.
    * FIRST (UCASE ([DCITY])) AS DCITY_STD *.
    TRE. DSTATE,
    FIRST (TRE. DZIP) AS DZIP,.
    TRE. DREGN,
    TRE. DDIST,
    TRE. DSLSMN,
    TRE. DCHAIN,
    TRE. MARKET,
    TRE. MKTPGM,
    TRE. EUMKT
    Of
    TRE
    GROUP BY
    TRE. GCUSNO,
    UCASE ([DCUSNO]),
    TRE. DSTATE,
    TRE. DREGN,
    TRE. DDIST,
    TRE. DSLSMN,
    TRE. DCHAIN,
    TRE. MARKET,
    TRE. MKTPGM,
    TRE. EUMKT;



    H2. ORACLE:
    SELECT DISTINCT
    TRE. GCUSNO,
    SUPERIOR (TRIM (TRE. DCUSNO)) AS DCUSNO_STD,
    SUPERIOR (TRIM (TRE. DNAME)) AS DNAME_STD,
    SUPERIOR (TRIM (TRE. DADDR)) AS DADDR_STD,
    FIRST_VALUE (UPPER (TRIM (TRE. (DNAME)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DNAME_STD,.
    FIRST_VALUE (UPPER (TRIM (TRE. (DADDR)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DADDR_STD,.
    FIRST_VALUE (UPPER (TRIM (TRE. (DCITY)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DCITY_STD,.
    TRE. DSTATE,
    TRE. DZIP,
    FIRST_VALUE (UPPER (TRIM (TRE. (DZIP)) IGNORE NULL VALUES) (TRE ORDER. DZIP ASC) AS DZIP,.
    TRE. DREGN,
    TRE. DDIST,
    TRE. DSLSMN,
    TRE. DCHAIN,
    TRE. MARKET,
    TRE. MKTPGM,
    TRE. EUMKT
    CRM. TREUP100R TRE
    GROUP BY
    TRE. GCUSNO,
    SUPERIOR (TRIM (TRE. DCUSNO)),
    TRE. DNAME,
    TRE. DADDR,
    TRE. DCITY,
    TRE. DSTATE,
    TRE. DZIP,
    TRE. DREGN,
    TRE. DDIST,
    TRE. DSLSMN,
    TRE. DCHAIN,
    TRE. MARKET,
    TRE. MKTPGM,
    TRE. EUMKT;

    A slight correction to the post of odie. I think you mean min max to replicate the primary function of access, but see below for sure. So:

    min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
    

    user10860953 wrote: how it ignores null values?

    The min and max functions automatically ignores nulls, so if there is a null value in tre.dname, it will not be returned, unless all values are null. For example:

    SQL> WITH t AS (
      2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
      3     SELECT 37, 'DEFG' FROM dual UNION ALL
      4     SELECT 65, 'DEFG' FROM dual UNION ALL
      5     SELECT 65, null FROM dual UNION ALL
      6     SELECT 70, null FROM dual UNION ALL
      7     SELECT 70, null FROM dual UNION ALL
      8     SELECT 37, 'ABC' from dual)
      9  SELECT id,
     10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
     11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
     12  FROM t
     13  GROUP BY id;
    
            ID MIN_ MAX_
    ---------- ---- ----
            37 ABC  DEFG
            65 ABCD DEFG
            70
    

    John

Maybe you are looking for

  • How to resize the partition on Portege M400?

    I tried Paragon Partition manager (bootCD).But when I loaded CD, Partition manager does not see the hard drive of my Portege M400Are there special drivers or software to perform this task?

  • Display advanced under the leadership of (digital) format

    Hello I have a question wich look be easy I have an indicator (digital I32) This indicator has 9 digitsI want to have specific display9 digits = DELAHAYE, but I want to DDD DDD 'space' DDD 'space '. can someone help me? It should be good to have a co

  • How to read data from the cell of the table hint?

    In my application, I filled the table hint with database data. Now I want, when I click on any particular line, I should be able to read the data in this row. Thank you best regards &,. Shrinivas

  • All running slow

    I have a Pavilion A305w-Yes, an old slower Computer.Everything runs slowly and hang up and sometimes hangs. Add more memory work this out? I have much 760 MB of ram Now.How might add safely, without messing anything up? Also what type of memory card

  • slow laptop

    I am running vista service pack 2, I think I'm under antivirus programs 2or3 I'm new to this, so I don't know how to check a lot of things, so my question, how do I know how many antivirus programs that I use? How can I make my laptop faster