How to convert this package from 11g to 10g (still using dbms_sql) ?

create or replace package pkg_test is
   type tab_t is table of ra_analista%rowtype;
   function pipeValues return tab_t pipelined;
   function selValues return sys_refcursor;
end;
create or replace package body pkg_test is
 function pipeValues
 return tab_t pipelined is
    cr sys_refcursor;
    tab tab_t;
    cnt int;
    cmd pls_integer := dbms_sql.open_cursor;
  begin
    dbms_sql.parse(cmd, 'select * from RA_Analista', dbms_sql.native);
    cnt := dbms_sql.execute(cmd);
    cr := dbms_sql.to_refcursor(cmd);
    fetch cr bulk collect into tab;
    if tab.count > 0 then
      for i in tab.first .. tab.last loop
        pipe row(tab(i));
      end loop;
    end if;
    return;
  end;
  function selValues return sys_refcursor is
    c1 sys_refcursor;
  begin
    open c1 for select * from table(pipeValues);
    return c1;
  end;
end;

Create Or Replace Package Body Pkg_Test Is
Function Pipevalues Return Tab_t Pipelined Is
Cr Sys_Refcursor; Tab Tab_t; Cnt Int; Cmd Pls_Integer := Dbms_Sql.Open_Cursor;
Begin
Dbms_Sql.Parse(Cmd, 'select * from RA_Analista', Dbms_Sql.Native); --**there in 10g**
Cnt := Dbms_Sql.Execute(Cmd); --**there 10g**
Cr := Dbms_Sql.To_Refcursor(Cmd); --**no need to use ref cursor here....if you want to use it go for open for instead of dbms_sql**
Fetch Cr Bulk Collect Into Tab;
If Tab.Count > 0 Then For i In Tab.First .. Tab.Last Loop Pipe Row(Tab(i));
End Loop;
End If; Return;
End;Edited by: Nicloei W on Sep 16, 2008 6:26 PM
Edited by: Nicloei W on Sep 16, 2008 6:26 PM
Edited by: Nicloei W on Sep 16, 2008 6:27 PM

Similar Messages

  • [Urgent]How to import odi procedure from 11g to 10g.

    Hi All,
    I am trying to import odi code(interface/procedure) from 11g to 10g but gettting xml error.
    Please reply as soon as possible.
    Thanks

    Forward compatibility for importing odi artifacts is not supported.

  • Help! How to convert an instance from java.lang.Object to a particula class

    * How to convert an instance from java.lang.Object class to a particular class
    witch is known only at the running time?
    Roster EJB component is make up of RosterHome, Roster and RosterBean.
    RosterHome is the home interface of Roster EJB.
    Roster is the remote interface of Roster EJB.
    RosterBean is the implement of Roster EJB.
    The following code segment is to invoke Roster EJB component.
    String jndiName="roster.RosterHome";
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    RosterHome home =
    (RosterHome)javax.rmi.PortableRemoteObject.narrow(objref,
    RosterHome.class);
    Roster myRoster = home.create();
    String team="T1"
    String player="Tom"
    myRoster.addPlayer(player,team);
    But, now, all the home interface, the remote interface and the JNDI Name of
    Roster EJB component are not been known at the compiling time. However They are
    known at the running time, throught reading from the XML config file.
    Questions:
    1,How to write code for this case ? or
    2,How to convert an instance from Object class to a particular class witch is known
    only at the running time?
    String jndiName="roster.RosterHome";// in fact, reads from XML file.
    String homeClassName="roster.RosterHome";// in fact, reads from XML file.
    String remoteClassName="roster.Roster";// in fact, reads from XML file.
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    Object objHome= javax.rmi.PortableRemoteObject.narrow(objref,
    Class.forName(homeClassName));
    /* how to do next?
    }

    I am not sure what you are trying to do. But at some point you should know which methods to call on the remote interfaces. Maybe the method names are stored in the XML file as well or you have a set of standard method names (also consider parameters).
    However, this can be solved by reflection. Look at the java.lang.reflect package, especially java.lang.reflect.Method, and also at java.lang.Class.
    If you are doing this on the app server:
    I've seen posts where people say that reflection is not permitted in EJB, but I don't think so. Check the EJB spec.
    If you are doing this in an application: reflection is always permitted. Probably also in applets and JSP.

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to remove a package from package structure?

    Hello profs,
    i have a problem. I add a package 'A' to another package 'B' in the package builder.
    Now i don't know how to remove package 'A' from the list of package 'B'.
    I have not found in the docu of package builder how to remove a package from the included list.
    Has somebody an idea how to do it?
    Thanks a lot.

    I found out that the relation between the packages saved in table TDEVC.
    Field PARENTCL contains the surrounding package 'B' of the package 'A' field DEVCLASS.
    At the moment the only way to remove the package is to modify the table.
    But i look for another possibility for this issue.
    Best regards
    Waldemar

  • How to convert a string from lower case to upper case withour using transla

    Hi all,
    how to convert a string from lower case to upper case withour using translate,
    Thanks in Advance,
    Reddy

    Refer to this related thread
    Re: hi guys this very urgent please help

  • How to find server model from 11g OEM mgmt$ views

    How to find server model from 11g OEM mgmt$ views
    server model like Dell 710, DL380 G7 etc..,

    It is included in this query (run as user SYSMAN):
    SELECT t.target_name AS host_name,
    ecm_util.HOST_HOME_LIST (t.target_name, t.target_type) AS home_info,
    hw.vendor_name AS Vendor,
    hw.system_config AS System_Config,
    hw.machine_architecture Architecture,
    os.name AS os_name,
    os.base_version os_base_version,
    os.update_level os_update_level,
    os.address_length_in_bits os_address_length_in_bits
    FROM mgmt_targets t, mgmt_ecm_snapshot s, mgmt_hc_os_summary os, MGMT_HC_HARDWARE_MASTER hw
    WHERE t.target_type = 'host'
    AND t.target_name = s.target_name
    AND s.snapshot_type = 'host_configuration'
    AND s.target_type = 'host'
    AND s.is_current = 'Y'
    AND s.snapshot_guid = os.snapshot_guid
    AND hw.snapshot_guid = s.snapshot_guid
    ORDER by t.target_type
    The asked info is available in the view MGMT_HC_HARDWARE_MASTER, column: SYSTEM_CONFIG
    Eric

  • Does anyone know how to convert the output from the standard report to xml?

    Does anyone know how to convert the output from the standard SAP report to xml?

    since it a standard report which you cannot modify you can only do the following.
    submit report exporting list to memory
    then
    list from memory and then
    use the returned itab along with CALL TRNSFORMATION key word to convert to xml.
    but this only going to place the whole list content (including data and formating lines,etc) into a xml element and not the actual data alone in the list .

  • How to convert the code from 8.2 to 7.1

    Hello friends
                   I have to convert the one vi from 8.2 to 7.1 Version.How to convert this code.
    Jayavel

    Hello Friends
                  i attached the code in 8.2 version.Convert this code into 7.1
    Jayavel
    Attachments:
    FreenrunTest.vi ‏1456 KB

  • How to install a package from a disc

    i have the file     sudo-1.7.2p3.tar    on a disk and i need to know how to install a package from a cd, what lines do i need to type to install it?:|

    If you are running as root, you can execute that command as ../../b43-fwcutter-011/b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta.o and there is no need for sudo.
    Btw, what wireless card is this? Have you tried searching for a pacman package for it?
    To access the cd drive, use the mount command. Enter man mount to read the manual. (I assume you do not have a graphical environment set up yet.)
    Last edited by fsckd (2010-05-12 04:37:52)

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • How to convert raw files from new fujifilm x-t1 ?

    how to convert raw files from new fujifilm x-t1 ?

    The work around of converting the CR2 to dng either with the dng converter or ACR 6.7 will allow working in LR and CS5 but not with the latest raw conversion engine from Adobe i.e PV 2012.
    Remember to keep a copy of the CR2 files if you wish to utilize the Canon software.

  • How to call a package from a different instance?

    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    Regards
    Terry

    Terry Chen wrote:
    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    First you have to create create dblink in A1 database as below
    CREATE DATABASE LINK INSA1
       CONNECT TO USER_NAME IDENTIFIED BY <pass>
       USING 'B!' Then you can execute exec pack_b@INSA1;

  • How to solve this error from window phone 80073cf9 lumia 630.

    any one know how to solve this error from window phone 80073cf9  lumia 630.

    Hello Muhammad,
    We appreciate the post, but this forum is for Windows Store and Phone Developer related questions. Your question can best be answered through the
    Windows Phone support page.
    Thanks!
    -Jonathan
    Windows Store Developer Support
    Office Store Developer Support

  • How to convert this 'CAPITAL' in to small letter 'capital.'

    Hi All,
    I have a variable wk_text = 'CAPITAL'.
    How to convert this 'CAPITAL' in to small letter 'capital.'

    Hi,
    Use like below code.
    DATA text TYPE string.
    text = `Careful with that Axe, Eugene`.
    TRANSLATE text TO UPPER CASE.
    Regards,
    Pravin

Maybe you are looking for

  • How do I put a shot cut to my desktop from amazon website?

    I want a link of Amazon homepage on my desktop and can't figure out how to do it.

  • Downloaded apps not showing up in apps tab

    I downloaded several apps using the itunes store, most were free, some I bought. After they all downloaded, only a few showed up in the Applications Tab on itunes. I found the ones that didn't show up on my computer and they downloaded as APP files i

  • Issue with SQL query of Oracle Apps Alert

    Hi, I have build the following SQL Query for one of the alert. But when i try to valid it it is throwing an error as "APP-ALR-04108: SQL Error - ORA-07144 in appropriate into occurred in ' My SQL is as follows: =============== SELECT details into &v_

  • BLURRY FINAL PRODUCT!!

    Very VERY FRUSTRATED.  Just spent hours and hours putting together a slide show using Premiere Elements 12 - and the final product (after rendering) turned out VERY BLURRY!  I don't understand how this happened.  All the pictures and slides added wer

  • Deploy Developer Forms

    hello i´m having problems with deploying Developer Forms in Portal problem 1: i try to create a new url portlet in portal to display the developer form. i paste the link i got when running it from form builder (http://marpolas.marpol.si:8888/forms90/