HANA equivalent of oracle's sql%rowcount to get affected rows.

I want to get the number of rows affected from an insert or update statement inside a stored procedure.
Is there any equivalent to oracle's sql%rowcount that can be called after the query.
For example:
create procedure procedure_name
begin
     declare l_c integer;
     insert into table values ('somevalue');
     l_c := sql%rowcount; -- This would return 1 for the row inserted.
end;

Yes, after the INSERT statement....
SELECT ::ROWCOUNT into L_C FROM DUMMY;
Cheers,
Rich Heilman

Similar Messages

  • SQL XMLExplicit equivalent in oracle

    Hi
    Is there any equivalent in oracle for SQL XMLExplicit?
    In SQL the XMLExplicit will add all the retunded nodes under the single root node like that any equivalent is available in oracle.
    Thanks
    Surendra

    I hope you will get better answers if you post this in Sql/Plsql Forum ..
    PL/SQL
    This one is one of the genuine and active forums .. :)

  • Error while trying to call external  web service from oracle PL/SQL 10.2 g

    Hi I am trying to call an external web service from oracle PL/SQL .I am getting following run time error when I try to set the opeartion style.
    But as per the oracle documentation this is one of the 2 valid values.
    ORA-29532: Java call terminated by uncaught Java exception: operation style: "document" not supported.Teh webservice does expect the operation style as document.
    Following is the code I am executing.
    FUNCTION email
    return varchar2
    AS
    service_ SYS.utl_dbws.SERVICE;
    call_ SYS.utl_dbws.CALL;
    service_qname SYS.utl_dbws.QNAME;
    port_qname SYS.utl_dbws.QNAME;
    operation_qname SYS.utl_dbws.QNAME;
    string_type_qname SYS.utl_dbws.QNAME;
    retx ANYDATA;
    retx_string VARCHAR2(1000);
    retx_double number;
    retx_len number;
    params SYS.utl_dbws.ANYDATA_LIST;
    l_input_params SYS.utl_dbws.anydata_list;
    l_result ANYDATA;
    l_namespace VARCHAR2(1000);
    begin
    -- open internet explorer and navigate to http://webservices.imacination.com/distance/Distance.jws?wsdl
    -- search for 'targetNamespace' in the wsdl
    l_namespace := 'http://service.xmlservices.global.freedomgroup.com/';
    -- search for 'service name' in the wsdl
    service_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanService');
    -- this is just the actual wsdl url
    service_ := SYS.utl_dbws.create_service(HTTPURITYPE('http://hostname/GlobalWebServices/services/ClientCoreWebService?wsdl'), service_qname);
    -- search for 'portType name' in the wsdl
    port_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanPort');
    -- search for 'operation name' in the wsdl
    -- there will be a lot, we will choose 'getCity'
    operation_qname := SYS.utl_dbws.to_qname(l_namespace, 'postalCodelookup');
    -- bind things together
    call_ := SYS.utl_dbws.create_call(service_, port_qname, operation_qname);
    -- default is 'FALSE', so we make it 'TRUE'
    SYS.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
    -- search for 'operation soapAction' under <wsdl:operation name="getCity">
    -- it is blank, so we make it ''
    SYS.utl_dbws.set_property(call_, 'SOAPACTION_URI', '');
    -- search for 'encodingstyle' under <wsdl:operation name="getCity">
    SYS.utl_dbws.set_property(call_, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
    -- search for 'binding style'
    SYS.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'DOCUMENT');
    -- search for 'xmlns:xs' to know the value of the first parameter
    -- under <wsdl:message name="getCityResponse"> you will see the line <wsdl:part name="getCityReturn" type="xsd:string" />
    -- thus the return type is 'string", removing 'xsd:'
    string_type_qname := SYS.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    -- in the line <wsdl:operation name="getCity" parameterOrder="zip">
    -- the parameterOrder is 'zip', thus we put in 'zip'
    -- the 'ParameterMode.IN' is used to specify that we will be passing an "In Parameter" to the web service
    -- the 'ParameterMode.IN' is a constant variable in the sys.utl_dbws package
    --vj this cud be either params or xml
    SYS.utl_dbws.add_parameter(call_, 'param1', string_type_qname, 'ParameterMode.IN');
    SYS.utl_dbws.add_parameter(call_, 'param2', string_type_qname, 'ParameterMode.IN');
    SYS.utl_dbws.set_return_type(call_, string_type_qname);
    -- supply the In Parameter for the web service
    params(0) := ANYDATA.convertvarchar('<TFGGlobalBasicXMLDO><systemCd>GLOBAL</systemCd><username>GlobalAdmin</username><password>GlobalAdmin</password><localID>1</localID></TFGGlobalBasicXMLDO>');
    params(1) := ANYDATA.convertvarchar('<TFGGlobalPostalCodeLookupIDDO><postalCode>02446</postalCode><countryCode>USA</countryCode><stateCode>MA</stateCode><cityDisplay>BROOKLINE</cityDisplay><countyDisplay>NORFOLK</countyDisplay><include_inactive_flag>True</include_inactive_flag></TFGGlobalPostalCodeLookupIDDO>');
    -- invoke the web service
    retx := SYS.utl_dbws.invoke(call_, params);
    dbms_output.put_line(retx.gettypename);
    -- access the returned value and output it to the screen
    retx_string := retx.accessvarchar2;
    dbms_output.put_line('done' || retx_string);
    dbms_output.put_line('PL/SQL DII client return ===> ' || retx_string);
    -- release the web service call
    SYS.utl_dbws.release_service(service_);
    return retx_string;
    end email;

    thsi is urgent anybody ????

  • Error in setting datasource location from oracle to sql server

    Post Author: jonathanaramburo
    CA Forum: Data Integration
    Hello,
    I have an application that uses a table named "events" which conflicts the sys.events view in master database in sql server. The error i was encountering is that, whenever i tried to set the datasource location of my crystal report from its previous connection oracle to sql server, i get an error saying that some of the fields has not been updated because theres no matching fields to the current connection. It seems that crystal is pointing on sys.events view on master db and not on the events table in myDb database. How can I tell crystal reports to not pick up sys.events and get only myDB.events table.
    Thank you in advance,
    Thanks,
    Jonathan

    The exact statement in oracle side which causing this error (O2SS0050:
    Conversion of identifier 'to_date(VARCHAR2, CHAR)' is not supported.) is below:
    dStartDate:= to_date(sStartDate,'MON-YYYY');
    Statement causing error O2SS0050:
    Conversion of identifier 'regexp_replace(VARCHAR2, CHAR)' is not supported is below.
    nCount2:= length(regexp_replace(sDataRow,'[^,]'));
    So there is no statement which is using to_date(VARCHAR2,
    CHAR) and regexp_replace(VARCHAR2, CHAR) in as such. 'MON-YYYY'  and '[^,]'
    are CHAR values hence SSMA is unable to convert it from varchar2 to char.
    Regarding SYSDATE issue, you mean to put below code in target(SQL) side in SSMA ?
    dDate date := sysdate;
    Thanks.

  • SQL%ROWCOUNT problem in Oracle 9i

    We have migrated our application from 8i to 9i. There is a PL/SQL procedure which returns number of rows inserted in the table. In Oracle it was returning correct number of rows but when we have migrated same procedure on Oracle9i it is returning 0 (ZERO) number of records even though procedure inserts successfully more than 100,000 rows in the table. It is used as:
    tmpCount := SQL%ROWCOUNT;
    Is there any change on Oracle9i?

    From MetaLink
    The behaviour you are observing is due to bug 2286387. You can set event 10943 to level 4194304 in your init<SID>.ora to get the old Oracle 8i behaviour.
    NOTE : The new behaviour in which SQL% attributes are affected by commit and rollback will be the DEFAULT behaviour going forward (Oracle 10i) so it is recommended to change the code so that you check the SQL% attrubutes before a commit or rollback.
    The event 10943 will also be removed in the future releases.

  • Oracle 10g SQL Profiler Equivalent?

    As per the subject, I can monitor sessions via the web gui, but I need to see actual SQL statements that are hitting the 10g server. Is there an Oracle 10g SQL Profiler equivalent?

    XE?
    You might want to hunker down with some of the docco available at http://www.oracle.com/pls/db102/portal.portal_db?selected=1
    In particular, you could look at the 'Reference' manual (not SQL Reference, or any other ... Reference) and browse through the DBA_ and V$ views listed. The Concepts and Administration manuals are interesting as well.
    The specific views of interest include, but are not limited to, V$SQLAREA and V$SQLTEXT

  • Does SQL Server has an equivalent to Oracle's OEM?

    I am not sure if this is the correct area to ask my question.  My manager asked me if SQL Server has an equivalent to Oracle's OEM.  Does it?  I mean OEM is not like Microsoft SQL Server Management Studio.
    lcerni

    Hello,
    You can use SQL Server Management Studio to manage SQL Server instances as you do with Oracle Enterprise Manager, and you can have a management and performance
    data warehouse using SQL Server Management Data Warehouse (MDW) as explained on the following article:
    http://msdn.microsoft.com/en-us/library/dd939169(v=SQL.100).aspx
    MDW data collection can be customized.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • DMBS_SQL.to_refcursor equivalent in Oracle 10g

    Hello,
    Is there any other way to get result as a refcursor in Oracle 10g with DBMS_SQL? I have the function that function generate dynamic query and execute with DBMS_SQL. This function called by java code for viewing result as report. How can I do this, is there equivalent in Oracle 10g for DMBS_SQL.to_refcursor? Please help.
    Thanks,

    ilkinesrefli wrote:
    Is it difficult to understand my answers?Yes, because they are not accurate. You keep saying you can't use ref cursors and must use DBMS_SQL, but you have failed to show us why that is so.
    It is impossible because there is dynamic where clause in my query. Show us why it's impossible.
    BluShadow     please solve this one:
    p_sql := 'select empno, ename, deptno from emp where deptno=:pdeptno';
    if ... then
    p_sql := p_sql || ' AND empno=:pempno';
    end if;
    ...Is it possible by your way?Yes, ref cursors can be used for dynamic queries. basic example...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function get_refcursor(p_sql in varchar2
      2                                          ,p_whereclause in varchar2 := null
      3                                          ,p_whereval in number := null) return sys_refcursor is
      4    v_rc sys_refcursor;
      5  begin
      6    if p_whereval is not null then
      7      open v_rc for p_sql||' where '||p_whereclause using p_whereval;
      8    else
      9      open v_rc for p_sql;
    10    end if;
    11    return v_rc;
    12* end;
    SQL> /
    Function created.
    SQL> var rc refcursor;
    SQL> exec :rc := get_refcursor('select empno, ename, deptno from emp');
    PL/SQL procedure successfully completed.
    SQL> print rc;
         EMPNO ENAME          DEPTNO
          7369 SMITH              20
          7499 ALLEN              30
          7521 WARD               30
          7566 JONES              20
          7654 MARTIN             30
          7698 BLAKE              30
          7782 CLARK              10
          7788 SCOTT              20
          7839 KING               10
          7844 TURNER             30
          7876 ADAMS              20
          7900 JAMES              30
          7902 FORD               20
          7934 MILLER             10
    14 rows selected.
    SQL> exec :rc := get_refcursor('select empno, ename, deptno from emp', 'deptno = :1', 20);
    PL/SQL procedure successfully completed.
    SQL> print rc;
         EMPNO ENAME          DEPTNO
          7369 SMITH              20
          7566 JONES              20
          7788 SCOTT              20
          7876 ADAMS              20
          7902 FORD               20
    SQL>So, please explain to us again why ref cursors are impossible to use and you have to use DBMS_SQL?

  • How can I display SQL%ROWCOUNT in the "Process Success Message"

    Hi all;
    I am trying to display SQL%ROWCOUNT in the "Process Success Message" of a custom update Process.
    Any ideas?

    Chris,
    I assume,
    ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID );
    is a package / procedure you call to do something. Change the procedure and add an
    out parameter to it, which will get the
    SQL%ROWCOUNT
    value. Then, call this package like this:
    DECLARE
      in_DEPARTMENT_UID NUMBER;
    BEGIN
      in_DEPARTMENT_UID := :P4_DEPARTMENT_UID;
      ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID,  :P4_ROW_COUNT );
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Oracle.xml.sql.OracleXMLSQLException:Cannot enable auto commit within JTS transaction

    Hi All,
    OracleXMLSave class in the Oracle XDK is being used to load XML data into an 8170 database. The Java code is running in IBM WebSphere with container-managed transactions. When JTA is enabled with the Merant JDBC driver for Oracle, we get the following error when the XML is loaded:
    oracle.xml.sql.OracleXMLSQLException: Cannot enable auto commit within JTS
    transaction
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2213)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(Compiled Code)
    This suggests the OracleXMLSave class is not aware of the fact that it is now operating in a JTS transaction where control is managed elsewhere. i.e. should also not attempt to commit or rollback, as this is the responsibility of the container.
    Is there a property which needs to set to prevent the above or does the XDK not work with J2EE (JTS) transactions?.
    If you have any useful comments, let me know. Testing the above presents me with a number of problems so if this is easily explained , let me know.
    Thanks,
    Malcolm

    Clearly , there does seem to be something a bit odd with the above stack.
    <Bug:1917808> mentions OracleXMLSave in context of plsql equivalent : dbms_xmlsave . i.e dbms_xmlsave is a wrapper around OracleXMLSave class.
    disabling autocommit on connection as follows should help:
    conn = DriverManager.getConnection("connect string","scott","tiger");
    conn.setAutoCommit(false);
    to disble auto commit and see if this has an effect.
    This issue might be <Bug:1497506>. If disabling autocommit does not work then it appears that it could be this issue .
    Malcolm
    Hi All,
    OracleXMLSave class in the Oracle XDK is being used to load XML data into an 8170 database. The Java code is running in IBM WebSphere with container-managed transactions. When JTA is enabled with the Merant JDBC driver for Oracle, we get the following error when the XML is loaded:
    oracle.xml.sql.OracleXMLSQLException: Cannot enable auto commit within JTS
    transaction
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2213)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(Compiled Code)
    This suggests the OracleXMLSave class is not aware of the fact that it is now operating in a JTS transaction where control is managed elsewhere. i.e. should also not attempt to commit or rollback, as this is the responsibility of the container.
    Is there a property which needs to set to prevent the above or does the XDK not work with J2EE (JTS) transactions?.
    If you have any useful comments, let me know. Testing the above presents me with a number of problems so if this is easily explained , let me know.
    Thanks,
    Malcolm

  • Dyn sql execute immediate  A plsql block returning sql%rowcount of rows inserted

    I would like to get the number of rows inserted in a dynamic sql statement like following.
    execute immediate
    'begin insert into a(c1,c2,c3)
    (select ac1,ac2,ac3 from ac where ac1=:thekey
    UNION select tc1,tc2,tc3 from tc where tc1=:otherkey); end;' using in key1,in key2;
    I have tried per the oracle8i dyn sql chapter in doc RETURN sql%rowcount won't compile.
    also add this to statement 'returning sql%rowcount into :rowcount'
    no luck.
    any ideas.?
    thanks.

    Quick comment first - I'm not sure why you are even using dynamic SQL here. There is nothing dynamic about your statement. It is equivalent to just:
    insert into a (c1, c2, c3)
      select ac1, ac2, ac3
        from ac
       where ac1 = key1
      UNION
      select tc1, tc2, tc3
        from tc
       where tc1 = key2;Unless you are really dynamically changing a table or column name here and just didn't show it in your example, you certainly don't want the overhead of NDS for this insert in this situation.
    In any case, you just need to evaluate SQL%ROWCOUNT in the next statement.
    insert ...;
    if sql%rowcount = 0 then
      -- nothing was inserted
    end if;

  • Sqlcode and sql%rowcount as test conditions

    I am translating a procedure from Ingres to oracle. I use the Oracle sqlcode and sql%rowcount
    variables in place of Ingres's iierrornumber and iirowcount.
    I replaced the ingres names with the oracle names, and now am wondering how how oracle uses these
    values.
    I am using DBMS_OUTPUT.PUT_LINE to display the contents of sqlcode and sql%rowcount.
    What happens when I get "no rows selected". I run the same query in standalone command line
    and get no rows selected .. and it's correct because I don't have data that matches).
    But when I run it in the procedure, I don't get any values in sqlcode or sql%rowcount ... the
    program just exits. The author was using the ingres code to test if there was data there and then
    continue to do something else.
    If you get no rows returned, does that mean, the sqlcode is 0 ? and the sql%rowcount is emtpy?
    which is why my DBMS_OUTPUT.PUT_LINE doesn't display anything ?
    my example........
    before this section in the procedure ... after running a different select that returns data ...
    I am using the DBMS to debug the values I have going in ...
    DBMS_OUTPUT.Put_line ('BEFORE sqlcode is' || sqlcode);
    DBMS_OUTPUT.Put_line ('BEFORE sqlrowcount is' || sql%rowcount);
    Select value from table
    where condition ='Y'; > this select will product "no rows return" and ignore the 2 DBMS_OUTPUTS beow ---
    DBMS_OUTPUT.Put_line ('AFTER sqlcode is' || sqlcode);
    DBMS_OUTPUT.Put_line ('AFTER sqlrowcount is' || sql%rowcount);
    When i run the procedure... I get the DBMS BEFORE statements, and nothing afterwards ...
    BEFORE sqlcode is 0
    BEFORE sqlrowcount is 1 >>>> that is all that displays
    Since I am getting the "no rows returned" ... how does oracle handle it to anyone's experience ?
    Thank you. I am learning much from your comments and information.

    Thanks to your answers .... The procedure is below. I've had to hand type it in, so typos are my mistakes.
    The procedure compiles . When there is data to be found, I get the DBSM_OUTPUT lines of code ....
    msg_read is Y
    sql_error is 0
    row_count is 1
    p_vol_id is 880091
    When I enter in a file name that does not return ANY rows back I will get the msg_read
    DBMS_OUTPUT line
    msg_read is Y
    Call completed.
    It doesn't show any 0 for sqlcode or sql%rowcount
    The original author used the Ingres return codes as input to process the rest of the code...
    It seems like oracle bounces the procedure once there are no rows to be found.
    I just added this part ....
    having an exception in the clause shows that Oracle is bouncing it to the WHEN OTHERS
    exception ...
    Any ideas of how to get Oracle not to do this ?
    I am trying to keep things simple, and all I am testing for is if I get records back the code does things,
    if not, I do something else
    create or replace procedure userfile(vms_fil_name IN varchar2, msg_read IN Varchar2)
    authid current_user
    is
    p_vms_file_name varchar2(255);
    p_vol_id varchar2(255);
    p_orig_id varchar2(255);
    p_incoming_message varchar2(255);
    sql_error number;
    n_count number;
    begin
    p_vms_fil_nam :=vms_fil_nam;
    DBMS_OUTPUT.PUT_LINE ('msg read is '|| msg_read); >> verify incoming parameter
    IF (msg_read ='Y')
    then
    select vol_id,
    orig_id,
    incoming_message
    into p_vol_id,
    p_orig_id,
    p_incoming_message
    from
    table one_table a
    where
    a.vms_fil_nam = p.vms_fil_nam
    and incoming_msg ='I';
    n_count :='sql%rowcount';
    sql_error :='sqlcode;
    DBMS_OUTPUT.PUT_LINE ('row count is '|| n_count);
    DBMS_OUTPUT.PUT_LINE ('sql_error is '|| sql_error);
    DBMS_OUTPUT.PUT_LINE ('p_vol_id is '|| p_vol_id);
    end if;
    exception >>>> just added this part as the last test....
    when others
    DBMS_OUTPUT.PUT_LINE ('other condition has been met');
    end;
    call userfile ('GEORGE','Y');

  • How to convert Oracle to SQL (Dual)

    Hello everyone,
    Thanks in advance for your time and help. I am using an application to try to generate a report, and it relies on SQL in the syntax that the database back-end is using. In my case, this is SQLServer.
    I have a colleague who is using the same application reporting functionality, but he is using Oracle, and he has developed the report code that I need. However, I cannot use it because of one line in the code that uses an Oracle command that seems to have no equivalent in SQLServer.
    The line of code is this:
    (select trunc(current_date) - 1*(level-1) CalDt from DUAL connect by level <= 30)
    Does anyone have any suggestions?

    Jonathan Lewis has been doing a series of articles on SQL Server and he has a small piece of data generation. Maybe you can adapt it for your needs:
    Oracle to SQL Server: Crossing the Great Divide, Part 2

  • [OT] User-Defined string Functions  Oracle PL/SQL

    Ladies and Gentlemen,
    I am pleased to offer the following string functions Oracle PL/SQL:
    GETALLWORDS(): Inserts the words from a string into the table.
    GETWORDCOUNT(): Counts the words in a string.
    GETWORDNUM(): Returns a specified word from a string.
    OCCURS(): Returns the number of times a character expression occurs within another character expression (including overlaps).
    OCCURS2(): Returns the number of times a character expression occurs within another character expression (excluding overlaps).
    PADC(): Returns a string from an expression, padded with spaces or characters to a specified length on the both sides.
    STRTRAN(): Searches a character expression for occurrences of a second character expression, and then replaces each occurrence with a third character expression. Unlike a built-in function Replace, STRTRAN has three additional parameters.
    STRFILTER(): Removes all characters from a string except those specified.
    RAT(): Returns the numeric position of the last (rightmost) occurrence of a character string within another character string (including overlaps). The search performed by RAT() is case-sensitive. RAT similar to the PL/SQL function INSTR.
    ATC(): Returns the beginning numeric position of the first occurrence of a character expression within another character expression, counting from the leftmost character (including overlaps). The search performed by ATC() is case-insensitive. ATC similar to the PL/SQL function INSTR.
    RATC(): Returns the numeric position of the last (rightmost) occurrence of a character string within another character string (including overlaps). The search performed by RATC() is case-insensitive. RATC similar to the PL/SQL function INSTR.
    AT2(): Returns the beginning numeric position of the first occurrence of a character expression within another character expression, counting from the leftmost character (excluding overlaps). The search performed by AT2() is case-sensitive. AT2 similar to the PL/SQL function INSTR.
    REPLICATE(): Returns a character string that contains a specified character expression repeated a specified number of times.
    ROMANTOARAB(): Returns the number equivalent of a specified character Roman numeral expression (from I to MMMCMXCIX).
    Plus, there are versions for MS SQL SERVER, SYBASE ASA, DB2, MS SQL SERVER 2005 SQLCLR.
    More than 8000 people have already downloaded my functions. I hope you will find them useful as well.
    For more information about string UDFs Oracle PL/SQL please visit the
    http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,54,33,29233
    Please, download the file
    http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,29233
    With the best regards.

    >
    I am using the Oracle Data Provider in vs2012. I am having trouble calling a function that returns an object type defined.
    >
    Returning a collection like that is a bad idea to begin with. That isn't scaleable and wastes memory.
    Either return a REF CURSOR and let the client FETCH the rows or use a PIPELINED function and let the client query it like they would a table.
    Here is an example similar to yours that uses a PIPELINED function.
    create or replace
        package pkg2
          as
            CURSOR emp_cur is (SELECT empno, ename, job, mgr, deptno FROM emp);
            type pkg_emp_table_type is table of emp_cur%rowtype;
            function get_emp(
                             p_deptno number
              return pkg_emp_table_type
              pipelined;
      end;
    create or replace
        package body pkg2
          as
            function get_emp(
                             p_deptno number
              return pkg_emp_table_type
              pipelined
              is
              begin
                  for v_emp_rec in (SELECT empno, ename, job, mgr, deptno
                                    FROM emp where deptno = p_deptno) loop
                    pipe row(v_emp_rec);
                  end loop;
              end;
      end;
    select * from table(pkg2.get_emp(20));
           EMPNO ENAME      JOB              MGR     DEPTNO
            7369 DALLAS     CLERK2          7902         20
            7566 DALLAS     MANAGER         7839         20
            7788 DALLAS     ANALYST         7566         20
            7876 DALLAS     CLERK           7788         20
            7902 DALLAS     ANALYST         7566         20

  • Oracle 8, Sql

    I have a question about top-n analysis in Oracle 8 Sql.
    How to use top-n analysis in Oracle 8 Sql using orderby cluse in sub-query?
    (or) Give any equivalent code to solve the problem given below.
    Increase the salary of SENIOR 4 and JUNIOR 4 employees in Employee table
    using Sql and pl/sql only in oracle8

    You might consider reading the following:
    http://www.devx.com/gethelpon/10MinuteSolution/16608/0/page/1
    Pages 4 & 5 are using 8i analytics, There are also a couple of long threads at ASKTOM.oracle.com

Maybe you are looking for

  • HELP NEW USER HERE

    Please help...I was able to put my music on my ipod video but I can not get the movies that I have in my itunes file onto my ipod. They show in itunes under library and not video. I bought quick time 7 pro and followed the directions to export to ipo

  • Question about windows printer canon bj5200 can't print or see in Leopard

    Hello; this has been a problem for me in Tiger as well, I have a windows workgroup network and have a canon bj5200 share on a windows xp machine, I've done some research and can't seem to find the solution on how print from Leopard (previous Tiger) t

  • How do I get my info from the phone that was stolen

    My phone was stolen. How can I recover the info from the cloud on another device ?

  • FCP 7 issue with exporting reference movie?

    I've used FCP 6 to export reference movies -- no problem.  Now, using FCP 7.0.3 , I can't seem to export a reference movie period.  On old projects, where I've done reference movies, no luck.  On newer ones created in FCP 7, I render everything -- I

  • JavaMapping Error

    Hi, I exploring on JAVA Mapping in SAP-XI. Can someone help me to resolve below runtime error: <SAP:Code p1="Error during mapping" p2="--- Creating Java mapping JavaFileMapping --- Using MappingResolver with context URL /sapmnt/TX1/global/xi/mapping/