implicit cursor and type oracle

Hi all

Is it possible to copy a rowtype of a cursor implicit to an oracle type?

example of

create or replace type test_123 (as_of_date date, number of contrat_number) as an object;

declare

help_ty test_123;

Start

for r1 in (select as_of_date, contract contracts) loop

help_ty: = r1;

end loop;

end;

It is said that it may not be possible, can you help me please?

11g

concerning

Hello

You can declare it in the Package specification and can use in the world through the database.

As below

create or replace package test_pkg
is

type is record (varchar2 (40) first_name, employee_id number);

end;
/

declare

l_rec test_pkg.emp_rec;

Start

for r1 in (select first_name, number of employees)
loop

l_rec: = r1;
dbms_output.put_line (l_rec.first_name);

end loop;

end;
/

Post edited by: Suri - example added

Tags: Database

Similar Questions

  • I worked on a banner for my website.  I have my background layer, my image photo layer and I try to make my text layer.  I'm haven been able to do this all morning.  Now when I select horizontal T, place the cursor and type... I get only one

    I am designing a banner for my website.  I have a background layer, a layer of photo image and I try to create my text layer.  I select horizontal T, place the cursor in the desired position and type.  I get a horizontal line... no letters.  Can someone tell me what is the problem and how to solve this problem, so I can't see letters?  Thank you!

    Right now, your question is marked as "not responded". If my or anyone's answer solved your issue. Mark your question as answered and mark the answer displayed as 'correct', only you can do. It helps when the moderators of the forums of audit.

  • Ref Cursor and type

    Hi all

    I finally got the job of procedure stored Ref Cursor but am stuck on the following. I have this package body:

    CREATE OR REPLACE PACKAGE BODY PACK_MYCURSOR AS
    PROCEDURE REFCUR)
    theuserid IN OUT users.user_id%type,
    UserFirstName to users_TableRows) IS
    BEGIN
    OPEN FOR UserFirstName
    Select * from users
    Where user_id = theuserid
    ;
    END REFCUR;
    END PACK_MYCURSOR;
    /

    Now it works fine, but I need to have fields of explisit in the select statement, such as "select user_id from users", but when I do that then I would get the error messages of "expression is of the wrong type." Someone knows how to fix this?

    Thank you.

    Declare your as WEAK rather than STRONG type ref cursor. In other words, do not specify return rowtype % ROWTYPE in your statement in the specification.

    Declare that:
    TYPE users_TableRows IS REF CURSOR;

    Phil

  • Error with implicit cursor

    I am writing an implicit cursor and when I run that she grant an exception that cannot use Contine.


    FOR (IN) getUseDetailRec
    SELECT
    bill_seg_read.tou_cd, bill_seg_read. BSEG_ID,
    -end v2.4 *.
    reg_read.read_type_flg ReadType,
    bill_seg_read.start_reg_reading StartMeterRead,
    bill_seg_read.end_reg_reading EndMeterRead,
    -(NVL(bill_seg_read.end_reg_reading,0) - NVL(bill_seg_read.start_reg_reading,0)) quantity.
    Reg.uom_cd,
    bill_seg_read.final_reg_qty
    OF ps_ci_bseg_read bill_seg_read,.
    ps_ci_reg reg,
    ps_ci_reg_read reg_read
    WHERE reg.reg_id = reg_read.reg_id
    AND bill_seg_read.start_reg_read_id = reg_read.reg_read_id
    AND bill_seg_read.bseg_id = getReadIntervalRec.bseg_id
    AND bill_seg_read.sp_id = getElectmeterRec.sp_id
    AND bill_seg_read.end_read_dttm = getExchgRec.end_read_dttm
    AND reg.mtr_id = getExchgRec.mtr_id)

    LOOP
    -Start v2.4 *.
    If in getReadIntervalRec.rs_cd ("E-R-TOU", "E-ND-TOU") and getUseDetailRec.tou_cd =' ' then

    CONTINUE;
    end if;

    If not in getReadIntervalRec.rs_cd ("E-R-TOU", "E-ND-TOU") and getUseDetailRec.tou_cd <>' ' then

    CONTINUE;
    end if;

    Any help or suggestion is greatly appreciated.

    Thank you

    CONTINUES is available in 11g only. What is your version of Oracle? Always show the version and the exact error message!

    SY.

  • Implicit cursor with Oracle 9i R2

    Hello

    I tried to use an implicit cursor:

    FOR rowProduct, SELECT ProductID, ProductName FROM T_Product
    LOOP
    Dbms_output.put_line(rowProduct.ProductID ||) '. Name = ' | rowProduct.ProductName);
    END LOOP;

    And the procedure fails to compile with error:

    Error (55,22): PLS-00103: encountered the symbol "SELECT" when waiting for him
    one of the following values: (- + case mod new null < an ID > < a)
    quotation marks double identifier defined by the > < a variable binding > reverse avg County
    current max min prior sql stddev sum variance execute forall fusion < a
    SQL statement > timestamp date of the time interval < a string literal
    specification of character set > < number > < a SQL string between single quotes >
    lead the symbol "(" has been replaced by "SELECT" to continue.


    I had to declare the cursor first and use FOR rowProduct IN csrProduct to make it work.

    Question: Is it because the implicit cursor was not integrated into Oracle 9i R2?

    Thanks in advance for any help.

    You just join the query in parentheses, i.e.

    FOR rowProduct IN (SELECT ProductID, ProductName FROM T_Product)
    LOOP
      ...
    END LOOP;
    

    Justin

  • PLS-00362: Invalid cursor return type; 'NUMBER' must be a record type

    Hello

    Having a little trouble with the following code example provided to http://www.dba-oracle.com/plsql/t_plsql_cursor_variables.htm:
      1  DECLARE
      2    TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
      3    c_cursor  t_ref_cursor;
      4    l_row   NUMBER;
      5  BEGIN
      6    DBMS_OUTPUT.put_line('Strongly typed REF CURSOR using SCALAR type. Expect an error!');
      7    OPEN c_cursor FOR
      8      SELECT COUNT(*) cnt
      9      FROM   cursor_variable_test;
     10    LOOP
     11      FETCH c_cursor
     12      INTO  l_row;
     13      EXIT WHEN c_cursor%NOTFOUND;
     14      DBMS_OUTPUT.put_line(l_row);
     15    END LOOP;
     16    CLOSE c_cursor;
     17* END;
     18  /
      TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
                           *
    ERROR at line 2:
    ORA-06550: line 2, column 24:
    PLS-00362: invalid cursor return type; 'NUMBER' must be a record type
    ORA-06550: line 2, column 3:
    PL/SQL: Item ignored
    In the code above, SELECT COUNT (*)... returns a NUMBER. I know it's an aggregation function, but it returns a single value.
    Why can't return a value in a column of a row in a NUMBER?
    How can I change the SQL code so that I can do this?

    Furthermore, I wonder about the use of FETCH with a count (*)... FETCH is supposed to fetch the next row... How it works when you select an aggregate as County?

    Thank you very much
    Jason

    >
    TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
    *
    ERROR on line 2:
    ORA-06550: line 2, column 24:
    PLS-00362: Invalid cursor return type; 'NUMBER' must be a record type
    ORA-06550: line 2, column 3:
    PL/SQL: Ignored Element

    In the code above, SELECT COUNT (*)... returns a NUMBER. I know it's an aggregation function, but it returns a single value.
    Why can't return a value in a column of a row in a NUMBER?
    How can I change the SQL code so that I can do this?
    >
    The exception is in line 2: your cursor statement. And the answer is in the text that you access
    >
    The return value of a strongly typed REF CURSOR must be a folder that can be defined using % TYPE % ROWTYPE attributes or record structure.
    >
    You said the CURSOR to return a NUMBER. And as the text says, he must be a 'record '.
    >
    Furthermore, I wonder about the use of FETCH with a count (*)... FETCH is supposed to fetch the next row... How it works when you select an aggregate as County?
    >
    As you said already FETCH retrieves the next line, if any. A query is a request is a request. It returns a result set. A query that uses aggregates returns a result set. A query that does not aggregate returns a result set.

    Your simple COUNT (*) SELECT query returns a result set that consists of a LINE and a line a ONE COLUMN of type NUMBER. Although there is only one column in the result set, what is returned is a RECORD or a LINE. That's why you have to report your data cursor return type a document using the % ROWTYPE or % TYPE attributes or a record structure.

  • Record and Types of Table definition

    Is there a good tutorial out there somewhere that provides good examples on how to define and work with recording and Types of Table? How to define and work with a complete file or table rather than just a variable?

    For instance - I would like to create a cursor of records in a table, to loop through each record to examine the values of variables and in some cases, insert these entire records in another table.

    Thanks in advance for your suggestions.

    Oracle documentation is excellent (lots of living examples can you cutNpaste) starting point.

    http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96624/05_colls.htm

    Is there something specific you are looking for?
    VR,
    Sudhakar B.

  • Need the difference between strong Ref Cursor and weak Ref Cursor examples

    Oracle 9.2

    It would be great if someone can help understand the differences between
    1 Strong Ref Cursors(return type)
    and
    2. weak Ref Cursor (no return type)

    What I read is weak ref Cursor as sys_refcursor is better to use the ref Cursor, because in the case of slider strong Ref object type that will be returned must be declared in advance. It dosent make sense to me?

    I start with the examples would be appreciate for advice

    Strong Ref Cursor

    create the package str_pack
    is
    type sref_type is ref cursor return emp % rowtype;
    SVAR sref_type;
    end str_pack;

    Create procedure st_proc (eid in number, c1 on str_pack.sref_type)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    declare
    str_pack.sref_type C1;
    type rec is RECORD (eid, ename varchar2 number (20), number of sal);
    SheikYerbouti rec;
    Start
    st_proc(10,C1);
    loop
    When exit c1% notfound;
    Fetch c1 into SheikYerbouti.
    end loop;
    Close c1;
    end;


    There could be errors in the above example but its basically to get a better understanding.

    For weak Ref Cursor

    procedure of the child

    Create procedure child_proc (in number, c1 on sys_refcursor eid)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    parent process

    Create procedure parent_proc (recnum varchar2)
    is
    p_retcur sys_refcursor;
    emp_row emp % rowtype;
    Start
    child_proc (eid, p_retcur);
    loop
    extract the p_retcur in emp_row;
    dbms_output.put_line(emp_row.empno ||) e '|| emp_row. Ename | "wins". emp_row. SAL);
    end loop;
    end parent_proc;

    Concerning
    @

    Hello

    the fundamental difference is to do with the compiling and linking of runtime type that occurs.

    The he should explain a lot more detail than I could ever!
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1640161160708

    P;

  • black screen and nice white cursor and Ctrl alt del will not work, I can not update shell

    black screen and nice white cursor and Ctrl alt del will not work, I can change the shell to the Explorer, but I can't unload or load the hive, what should I do?

    Hello

    Your question I know that some of these methods is not available now, however, all
    Convenience store is included just in case where win you some access as you try to solve the problem.

    You can access Mode safe? Repeatedly press F8 as you start? If yes you can try Control Panel - device
    Manager - graphics card - Double click on - driver tab - click on UPDATE driver - then right click
    on devices and UNINSTALL - REBOOT.

    Another method to try to get to the desktop (try in normal Windows Mode without failure)
    CTRL + ALT + DELETE and on the tab process EXPLORER.exe and COMPLETE the PROCESS on this subject - then
    on the Applications tab - lower right - new task - type in EXPLORER.exe. Safe mode is reached
    by tapping F8 as you start several times.

    First check this thread in case it is simple and if not to come back to this thread.

    http://social.answers.Microsoft.com/forums/en-us/vistaprograms/thread/50247d5e-0ae0-446c-A1bd-11287fd1478a

    Black screen problems are extremely difficult to repair and all patch is usually on a base hit or miss.
    That there is no information on a black screen as it is on a blue screen just adds to the
    Difficulty. Often using a restore point or Startup Repair will have no effect. You can try a
    Google to see the proposed repairs, whom some have worked however these cover a wide
    field efforts.

    Here's a video of one of them.

    http://www.Google.com/search?hl=en&q=black+screen+of+death+Vista&btnG=search&AQ=f&OQ=&AQI=G1

    Here's another fix
    http://blogs.PCMag.com/SecurityWatch/2008/12/the_mysterious_black_screen_of.php

    You have a Vista disk? You can try restoring the system to it. If you don't have the disks your
    system manufacturer will sell them at low prices. Or try in safe mode if you can get there.

    How to make a Vista system restore
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html

    You can create a recovery disc or use someone even version (making the system restore it)
    must be bootable).

    How to create a Vista recovery disk
    http://www.Vistax64.com/tutorials/141820-create-recovery-disc.html

    ------------------------------------------------

    These require the correct Vista discs since you can not start safe mode.

    Try the Startup Repair tool-

    This tells you how to access the System Recovery Options and/or with a Vista disk
    http://windowshelp.Microsoft.com/Windows/en-us/help/326b756b-1601-435e-99D0-1585439470351033.mspx

    Try recovery options Startup Repair

    How to do a startup repair
    http://www.Vistax64.com/tutorials/91467-startup-repair.html

    -----------------------------------------------

    Here are a few Google searches where many have found different solutions:

    Vista black screen - check that a 1st
    http://www.Google.com/search?hl=en&source=HP&q=Vista+black+screen&AQ=f&OQ=&AQI=G10

    Vista black screen Solution
    http://www.Google.com/search?hl=en&q=Vista+black+screen+solution&AQ=f&OQ=&AQI

    Vista black screen Fix
    http://www.Google.com/search?hl=en&q=Vista+black+screen+fix&AQ=f&OQ=&AQI

    -----------------------------------------------

    If necessary and you can access all ordinary Windows.

    You can try an In-Place Upgrade (hopefully save programs and data) or a repair installation
    (if all goes well, the data records and need to reinstall programs). Be sure to do a good backup or three.

    You can use another DVD that aren't copy protected but you you need to own
    Product key.

    On-site upgrade
    http://vistasupport.MVPs.org/repair_a_vista_installation_using_the_upgrade_option_of_the_vista_dvd.htm

    If nothing works, you can make a repair facility that must save the data but you will need to
    Reinstall the programs. This also requires correct Vista disks especially for OEM versions. You will be
    need to know your product Code.

    This tells you how to access the System Recovery Options and/or a Vista DVD
    http://Windows.Microsoft.com/en-us/Windows-Vista/what-happened-to-the-recovery-console

    How to perform a repair for Vista Installation
    http://www.Vistax64.com/tutorials/88236-repair-install-Vista.html

    ---------------------------------------------------------------------------

    Another method that works sometimes: at the command prompt, type of Vista startup disk:
    (a line type or copy and paste one line at a time and hit enter - enter a bracket)
    or "BOLD")

    c:

    cd\

    CD c:\Windows\System32\winevt (there is a space between cd and C :)

    Ren LogsOLD Logs (there are spaces between ren and newspapers and Logsold)

    RESTART Windows

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Windows 7 screen freezes, freezes mouse cursor and keyboard freezes.

    Hi all

    About a month ago my internet kept cutting at about 02:00 in the afternoon - even if my BThub said it was a signal - and my internet access would not return until 05:00 sharp later that day here. This went on for about two weeks, it doesn't happen too much now, however, recently, something happens...

    I have a desktop HP Pavilion s5000 and all day - every day - not only freezes my screen, if I'm online or simply type in a Word doc, but my mouse cursor and keyboard freeze too, all at once. It's as if all of the computer crashes, and the only way I can "unfreeze" it is cutting off the entire batch to the switch. In this case nothing three times a day to ten times a day. Can someone tell me what could be the problem and how I can try to solve it? I did a system restore, to restore the PC to a date earlier, I did this about five times now, but the problem persists.

    Many thanks in advance,

    Danni.

    Hello Danni,

    Thank you for reaching out to us to the Microsoft Community Forum.

    When your computer hangs or freezes, it is disruptive and can slow you down. There are a few reasons your computer might hang, freeze, or crash. Try the following common methods provided for in article below as a first step to solve the problem.

    8.1 Windows, Windows 8 or Windows 7 hangs or freezes

    Note:

    The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Also as you use HP computer, you can try the troubleshooting provided in the link below steps and check if that helps resolve the issue.

    Computer hangs or freezes (Windows 7)

    Note:

    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

    Important:

    In case you follow ' step 7 "in the above link from HP that speaks to recover the computer to factory settings then you will need to contact HP support and we also recommend that you back up all important data to an external drive before recovery of the computer to the factory settings.

    Hope that the information provided will help you. Do we know the State of the question, so that we can help you further.

  • OracleDataAdapter error: unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' type 'System.IConvertible '.

    Uses: Oracle9i Standard Edition, ODAC 11.2.0.4, Oracle Instant Client 11.2.0.4

    I am to convert the Microsoft Oracle for Oracle ODP.NET provider of my projects

    * Error *.

    Cannot be cast to type 'Oracle.DataAccess.Types.OracleDecimal' object type 'System.IConvertible '. Could not store < 145982 > in the RECEIPTID column. Type is Int64.

    This error is poped up when my stored Proc has a return parameter. The return is a numeric data type in Oracle. I had no problem when using Oracle Provider from Microsoft.

    Initially, I had my command setting insert the value

    System.Data.OracleClient.OracleType.Number

    for the column RECEIPTID; After ODP.NET, I converted to

    Oracle.DataAccess.Client.OraclDbType.Double

    Then the error throwed upward. Implement

    Oracle.DataAccess.Client.OracleDbType.Int64

    as suggested by the error, but nothing seems to prevent the error a way.

    I am running using the OracleDataAdapter.

    The OracleCommand object initialization *.

    public class ReceiptAccountBusinessTable : EquityBroker32.APP_DATA.config.GenericBusinessTable
            {
                OracleCommand[] nCommandCollection;
    
                public ReceiptAccountBusinessTable()
                {
                    this.Tablename = "JKSBSCHEMA.RECEIPTACCOUNT";
                    this.KeyDBField = "RECEIPTID";
                    this.DefaultSql = string.Format("SELECT * FROM {0} WHERE {1}= (SELECT MAX({1}) FROM {0} )", this.Tablename, this.KeyDBField);
    
                    //select command
                    this.nCommandCollection = new Oracle.DataAccess.Client.OracleCommand[4];
    
                    this.nCommandCollection[0] = new OracleCommand();
                    this.nCommandCollection[0].Connection = this.DataConnection;
                    this.nCommandCollection[0].CommandText = this.DefaultSql;
                    this.nCommandCollection[0].CommandType = System.Data.CommandType.Text;
    
                    //update command
                    this.nCommandCollection[1] = new OracleCommand();
                    this.nCommandCollection[1].Connection = this.DataConnection;
                    this.nCommandCollection[1].CommandText = "JKSBSCHEMA.RECEIPTACCOUNT_ADDCHG_PROC";
                    this.nCommandCollection[1].BindByName = true;
                    this.nCommandCollection[1].CommandType = System.Data.CommandType.StoredProcedure;
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PRECEIPTID", Oracle.DataAccess.Client.OracleDbType.Int64, 10, System.Data.ParameterDirection.InputOutput, false, 10, 0, "RECEIPTID", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PACCOUNTID_NEW", Oracle.DataAccess.Client.OracleDbType.Char, 13, System.Data.ParameterDirection.Input, false, 0, 0, "CLIENTACCOUNTID", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PACCOUNTID_OLD", Oracle.DataAccess.Client.OracleDbType.Char, 13, System.Data.ParameterDirection.Input, false, 0, 0, "CLIENTACCOUNTID", System.Data.DataRowVersion.Original, null));
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PXSACTVALUE", Oracle.DataAccess.Client.OracleDbType.Double, 22, System.Data.ParameterDirection.Input, false, 0, 0, "XSACTVALUE", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PXSACTDESC", Oracle.DataAccess.Client.OracleDbType.Varchar2, 255, System.Data.ParameterDirection.Input, false, 0, 0, "XSACTDESC", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PPAGEBREAK", Oracle.DataAccess.Client.OracleDbType.Int32, 22, System.Data.ParameterDirection.Input, false, 0, 0, "PAGEBREAK", System.Data.DataRowVersion.Current, null));
    
                    //insert command
                    this.nCommandCollection[2] = new OracleCommand();
                    this.nCommandCollection[2].Connection = this.DataConnection;
                    this.nCommandCollection[2].CommandText = "JKSBSCHEMA.RECEIPTACCOUNT_ADDCHG_PROC";
                    this.nCommandCollection[2].CommandType = System.Data.CommandType.StoredProcedure;
                    this.nCommandCollection[2].BindByName = true;
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PRECEIPTID", Oracle.DataAccess.Client.OracleDbType.Int64, 10, System.Data.ParameterDirection.InputOutput, false, 10, 0, "RECEIPTID", System.Data.DataRowVersion.Proposed, null));
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PACCOUNTID_NEW", Oracle.DataAccess.Client.OracleDbType.Char, 13, System.Data.ParameterDirection.Input, false, 0, 0, "CLIENTACCOUNTID", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PACCOUNTID_OLD", Oracle.DataAccess.Client.OracleDbType.Char, 13, System.Data.ParameterDirection.Input, false, 0, 0, "CLIENTACCOUNTID", System.Data.DataRowVersion.Original, null));
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PXSACTVALUE", Oracle.DataAccess.Client.OracleDbType.Double, 22, System.Data.ParameterDirection.Input, false, 0, 0, "XSACTVALUE", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PXSACTDESC", Oracle.DataAccess.Client.OracleDbType.Varchar2, 255, System.Data.ParameterDirection.Input, false, 0, 0, "XSACTDESC", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[2].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PPAGEBREAK", Oracle.DataAccess.Client.OracleDbType.Int32, 22, System.Data.ParameterDirection.Input, false, 0, 0, "PAGEBREAK", System.Data.DataRowVersion.Current, null));
    
                    //delete command
                    this.nCommandCollection[3] = new OracleCommand();
                    this.nCommandCollection[3].Connection = this.DataConnection;
                    this.nCommandCollection[3].CommandText = "DELETE FROM " + this.Tablename + " WHERE RECEIPTID=:p1 AND ACCOUNTID=RPAD(:p2,15)";
                    this.nCommandCollection[3].CommandType = System.Data.CommandType.Text;
                    this.nCommandCollection[3].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("p1", Oracle.DataAccess.Client.OracleDbType.Int64, 22, System.Data.ParameterDirection.Input, false, 0, 0, "RECEIPTID", System.Data.DataRowVersion.Current, null));
                    this.nCommandCollection[3].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("p2", Oracle.DataAccess.Client.OracleDbType.Char, 15, System.Data.ParameterDirection.Input, false, 0, 0, "ACCOUNTID", System.Data.DataRowVersion.Current, null));
    
                    this.CommandCollection = this.nCommandCollection;
                }
            }
    

    * The glance of the stored Proc *.

    PROCEDURE RECEIPT_ADDCHG_PROC
        (
        preceiptid IN OUT NUMBER,
        preceiptmode IN CHAR,
        pxsactdate IN DATE,
        pxsactvalue IN NUMBER,
        pbankaccountid IN VARCHAR2,
        pchequeno IN VARCHAR2,
        pclientbankid IN VARCHAR2,
        pdescription IN VARCHAR2,
        pstatementno in varchar2 default null,
        pcustodypayment IN NUMBER)
        is
        nrow number;
        begin
    
        --check if posted
        SELECT COUNT(*) INTO nrow from accountledger
        WHERE receiptid = preceiptid;
    
        IF nrow > 0 THEN
          RAISE_APPLICATION_ERROR(-20001, 'Record Already Posted');
        END IF;
    
        UPDATE Receipt
          Set pmodeid = preceiptmode,
          xsactdate = pxsactdate,
          xsactvalue = pxsactvalue,
          bankaccountid = pbankaccountid,
          chequeno = pchequeno,
          clientbankid = pclientbankid,
          description = pdescription,
          statementno = pstatementno,
          custodypayment = pcustodypayment
        WHERE receiptid = preceiptid;
    
        IF (SQL%NOTFOUND) THEN
          INSERT INTO RECEIPT(receiptid,
                              pmodeid,
                              xsactdate,
                              xsactvalue,
                              bankaccountid,
                              chequeno,
                              clientbankid,
                              description,
                              statementno,
                              custodypayment
                              )
          VALUES(preceiptid,
                  preceiptmode,
                  pxsactdate,
                  pxsactvalue,
                  pbankaccountid,
                  pchequeno,
                  pclientbankid,
                  pdescription,
                  pstatementno,
                  pcustodypayment
                  ) RETURNING receiptid into (preceiptid);
        END IF;
    
        end;
    

    * It's how I update the Table *.

    public void UpdateData(DataTable tbl, Oracle.DataAccess.Client.OracleTransaction oTran)
                {
                    try
                    {
                        SetTransaction(oTran);
                        this._adapter.Update(tbl);
                        //this was added on 03-Aug-2011
                        tbl.AcceptChanges();
                    }
                    //handling concurrency problem
                    catch (DBConcurrencyException dbcx)
                    {
                        MessageBox.Show(CreateMessage(dbcx.Row), "Concurrency Exception", MessageBoxButtons.YesNo);
                    }
                    catch (OracleException ex)
                    {
                        throw ex;
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
    
                }
    

    * The said Stack Trace *.

    at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors (Int32 commandCount RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo [batchCommands])
    at System.Data.Common.DbDataAdapter.UpdatedRowStatus (Int32 commandCount RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo [batchCommands])
    to System.Data.Common.DbDataAdapter.Update (DataRow [] dataRows, DataTableMapping tableMapping)
    to Oracle.DataAccess.Client.OracleDataAdapter.Update (DataRow [] dataRows, DataTableMapping tableMapping)
    at System.Data.Common.DbDataAdapter.UpdateFromDataTable (DataTable dataTable, DataTableMapping tableMapping)
    at System.Data.Common.DbDataAdapter.Update (DataTable dataTable)
    at EquityBroker32.APP_DATA.config.GenericBusinessTable.UpdateData (DataTable tbl, OracleTransaction oTran) in d:\REVERSION\Latest\APP_DATA\config\GenericBusinessTable.cs:line 293

    This is found!

    I add the following code to my existing and it worked!

    this.nCommandCollection[1].Parameters.Add(new Oracle.DataAccess.Client.OracleParameter("PRECEIPTID", Oracle.DataAccess.Client.OracleDbType.Double, 10, System.Data.ParameterDirection.InputOutput, false, 10, 0, "RECEIPTID", System.Data.DataRowVersion.Current, null));
    this.nCommandCollection[1].Parameters["PRECEIPTID"].DbType = DbType.Decimal;
    

    Thanks to this site and the person who answered: .Net technology: find a sequence of a S-P with typed DataSet problem - dotnet - tech.todaysummary.com

  • problem with the CURSOR and WITH clause

    Hi guys,.

    I have never created a package before. I try to run it, but I get:
    ORA-06550: line 8, column 16:
    PLS-00382: expression is of the wrong type
    ORA-06550: line 8, column 3:
    PL/SQL: Statement ignored

    I know that my problem is in the next section

    OPEN FOR V_io_cursor

    with GOT_R_NUM like)


    Is the above correct?

    When I copy paste the "heart" of the query, it works very well. I really have a problem with the CURSOR and the declaration.

    Here's the code in its entirety. I know that the code is much more then he returned, but ignore this overload that was to do some tests to make sure that I can achieve any query request.

    CREATE OR REPLACE
    PKG_SPF_NATIONALREPORTS PACKAGE BODY IS

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS (P_SelectFields IN varchar2, P_SUMFields IN varchar2, io_cursor IN OUT C_RESULTS)
    IS
    v_io_cursor C_RESULTS;

    BEGIN

    OPEN FOR V_io_cursor

    with GOT_R_NUM like)
    SELECT
    -START P_SelectFields
    r.cli_served,
    r.EIER,
    -END P_SelectFields
    r.RC,
    r.Year_ID,
    r.period_id,
    r.agreement_type_ind,
    CONTRACT_NUMBER. CONTRACT_NUMBER_TEXT,
    YEARS.year_desc,
    RC_CODE.rc_code_id,
    RC_CODE.rc_code,
    AHRDA HOLDERS. AHRDA_ID,
    AHRDA HOLDERS. REGION_ID,
    AHRDA HOLDERS. PROVINCE_ID,
    AGREEMENT_TYPE. AGREEMENT_TYPE_ID,
    AGREEMENT_TYPE. AGREEMENT_TYPE_DESC_EN,
    ROW_NUMBER() over (partition R.YEAR_ID, R.CONTRACT_Number_Text
    order by
    P.PERIOD_desc
    (/ / DESC NULLS LAST) AS r_num
    RESULT r
    JOIN period p ON r.period_id = p.period_id
    JOIN CONTRACT_NUMBER ON r.contract_number_text = CONTRACT_NUMBER. CONTRACT_NUMBER_TEXT
    JOIN RC_CODE ON contract_number.rc_code_id = rc_code.rc_code_id
    JOIN AHRDA holders ON ahrda.ahrda_id = rc_code.ahrda_id
    JOIN AGREEMENT_TYPE WE AHRDAS. AGREEMENT_TYPE_ID = AGREEMENT_TYPE. AGREEMENT_TYPE_id
    JOIN the YEARS WE r.year_id = YEARS.year_id
    )
    SELECT year_desc
    -START P_SUMFields
    SUM (cli_served) AS sum_cli_served
    The SUM (eier) AS sum_eier
    -END P_SUMFields
    OF got_r_num
    GROUP BY year_desc
    ORDER BY year_desc
    ;

    io_cursor: = v_io_cursor;

    END GET_NATIONAL_TOTAL_RESULTS;

    Agree - all this talk of loops FOR is completely irrelvant.
    A refcursor is usually the exact mechanism to return a result set.

    What is C_RESULTS?

    Just use SYS_REFCURSOR.

    No need for local variable.

    OUT why? Not just walk OUT?

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS
    (P_SelectFields IN varchar2, P_SUMFields IN varchar2, io_cursor OUT SYS_REFCURSOR)
    IS
    BEGIN
     OPEN io_cursor FOR ...
    END;
    
  • Links to learn and use Oracle audit

    Hi all
    I want links to learn and use Oracle DB audit featured
    I heard recently that the audit has two types: manual right and by Oracle? I want this one by Oracle
    This is the right forum for this thread?
    Thank you

    Note: I use DB Oracle 10g R2

    Dev. Men wrote:
    Hi all
    I want links to learn and use Oracle DB audit featured
    I heard recently that the audit has two types: manual right and by Oracle? I want this one by Oracle
    This is the right forum for this thread?
    Thank you

    Note: I use DB Oracle 10g R2

    Find this link to use Oracle audit:
    http://download.Oracle.com/docs/CD/B19306_01/network.102/b14266/cfgaudit.htm

  • Options to see file size and type?

    Where can I turn on options on an image and get the file size and type?

    Thank you.

    Stan,

    You can see the file type by placing the cursor on the file in the library view, and it will display the name of the file with the extension jpg, nef as tiff.

    If not in library mode, go to grid view it's size in pixels of the files as well as the name of the file to the format.

    If you are not able to see it go to view > display Option.

    Check the option display the label header

    Hope thatt helps.

    Florian

  • "" Type = "java.math.BigDecimal type =" Oracle.jbo.domain.Number "VS".

    Hi all! I need some explanation about types: Type = "oracle.jbo.domain.Number"VS Type = "java.math.BigDecimal"

    I have variable enableEditing:
     this.enableEditing = this.getSelectedTaks().getAttribute("TaksacijasPk").equals(taksId); 
    If attribute EO TaksacijasPk is with the type "oracle.jbo.domain.Number" then all work with above the line, but if this attribute is of type "Java.Math.BigDecimal" then code above line do not work. To fix it, I need to add toString() operation in the line of code:
     this.enableEditing = this.getSelectedTaks().getAttribute("TaksacijasPk").toString().equals(taksId); 
    Maybe the question is, why in one case, I have to add toString() operation and in others not?

    Best regards, Debuger!

    Javadoc for the BigDecimal said

    Unlike compareTo, this method takes two objects BigDecimal equal only if they are equal in value and scale (so 2.0 is not equal to 2.00 compared to this method).

    You try to compare a BigDecimal/number for a taskId (which we don't have no idea what class it is).

    Suppose that taskId is a string.

    . Equals() on a number will simply convert the string to a number and check if the values are equal.

    . Equals() on a BigDecimal allows you to convert the string to a BigDecimal by applying the rules described in the BigDecimal (String) constructor, to-wit:

    The scale of the BigDecimal returned will be the number of digits in the fraction, or zero if the string contains no comma, subject to adjustment for any Exhibitor; If the string contains an exponent, the exponent is subtracted from the scale. The value of the scale that results must be between Integer.MIN_VALUE and Integer.MAX_VALUE, inclusively.

    My conjecture only (since you don't seem to be ready to use the debugger and check), is that you have a scale on your BigDecimal which does not match the scale on the BigDecimal which is built from the identifier.

    If I had to try to understand the difference between the two, I'd read the docs. Maybe even create a few test cases. Maybe to run my code in the debugger to see what that my BigDecimals and numbers looked like

Maybe you are looking for

  • Satellite L305-S5933 - need driver Webcam and microphone

    Hello guys. First of all, sorry my poor English. Recentlly I bought a toshiba L305-S5933 and by the problems of Vista I downgraded to Win XP. So I have so many problems with the drivers of the keys FN and Multi Media (multi media drivers = pause/play

  • Turn off the music player built into the Droid 3?

    Hello. If I have a podcast in my Droid 3, the player built-in music play the podcast automatically file whenever it receives a stereo Bluetooth to my audio system automatically. I don't like the music player because there is no function "Resume Play"

  • Swapping Rom for Ssd drive in a g50-45.

    Simple as in the title. Is it possible to Exchange my rom hunt for one ssd using a CD-ROM drive adapter? So I take the rom is also sata drive?

  • Latest drivers for card display Samsung RV510

    Hello good person want to sent me a fix, but don't know how. Bought a laptop Samsung RV510 Windows 7. Removed from Windows 7. Installed XP Pro on disk. I'm now using XP Pro, but the brightness is 'Extremely dull' 'on battery '. Use my laptop on the s

  • Can I access the videos of the HP Tablet?

    I have the HP Tablet I can my videos of this excess?