How to restrict only one row in Table ??.

Hi all,
i want to restrict no. of rows to one,
that is not more that one row should be there in the table.
Following trigger works well in all conditions
except:
insert into myTab select 'x' from emp;
inserts 14 rows.
Create or replace trigger one_row_myTab
before insert on myTab
for each row
declare
cnt number;
pragma AUTONOMOUS_TRANSACTION;
Begin
select count(*) into cnt from mydual;
if cnt=1 then
raise_application_error(-20001,'MyDual Can have only one Row');
end if;
end;
i think with trigger it w't be possible because,
same transaction triggers c't query the table (Mutating Table),
Autonomus trans ca't identify uncommited changes.
pls add your suggestions.
Thanks for Reading the Post.
Rajashekhar Ganga,
mail : [email protected]

nice try Mulder ! it doesn't work everywhere...
SQL> connect scott/tiger@lsc69
Connected to:
Oracle7 Server Release 7.3.4.5.0 - Production
With the distributed and parallel query options
PL/SQL Release 2.3.4.5.0 - Production
SQL>  create table d as select * from dual;
Table created.
SQL> create index i on d(1);         
create index i on d(1)
ERROR at line 1:
ORA-00904: invalid column name
SQL> connect scott/tiger@lsc65
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
JServer Release 8.1.7.4.0 - 64bit Production
SQL> create table d as select * from dual;
Table created.
SQL> create index i on d(1);         
Index created.
SQL> connect scott/tiger@lsc68
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
SQL> create table d as select * from dual
Table created.
SQL> CREATE UNIQUE INDEX i on d(1);                  
CREATE UNIQUE INDEX i on d(1)
ERROR at line 1:
ORA-03113: end-of-file on communication channel

Similar Messages

  • How to select only one row

    hello,
    i've got a select query which returns a couple of rows.
    now i would like for the query to return only one row (the first match it can find).
    how do i do that?
    thank you!
    my sample of my data as below , the first and seconde record is equal and i want to display all the colomn for the first row and ignore the second row .
    84A8E46E8C97     9410     20110812
    84A8E46E8C97     9420     20110813
    84A8E46E8C6E     9410     20110816
    84A8E46E8AFA     9400     20110819

    876602 wrote:
    my sample of my data as below , the first and seconde record is equal and i want to display all the colomn for the first row and ignore the second rowThere is no row order in relational database tables. Same query canreturn rows in different order next time you run it unless you specify ORDER BY. Only ORDER BY guarantees order, so when you say first row/second row you must provide ordering criteria.
    SY.

  • How to restrict no of rows in table

    Hi,
    I want to restrict no of rows displayed in adf-read-only table to 10.I set rangeSize to 10 in jsp but it is not working.How can I restrict no of rows.
    Regards,
    Ramesh

    Hi,
    this sets the range size. Because ADF Faces Rich Client support scrolling the data will be fetched in ranges of 10. I suggest to filter the records within the query and always return 10 rows only. Its a strange usecase you are after.
    Frank

  • How to remove only one row from the database using labview6.1

    using labview 6.1 I create a table with various rows and columns and store bulk of data's in them.,, what procedure should I follow to remove only one paticular row from the database? Help me out with an example please,,
    Thanking you in advance!

    Hi,
    If you have the database toolkit you can delete a row using just a SQL Query to "DB Tools Execute Query.VI"
    Example:
    DELETE FROM Table name Where SerialNum='Value' And Date='Value' And Time='Value'
    See also attached VI
    Best Regards
    Johan
    Attachments:
    Delete_a_row_in_a_database_table.vi ‏48 KB

  • How to display only one row in report when...

    Hi,
      I've a report display in which i've 3 fields EBELN, LIFNR , MENGE. EBELN, LIFNR are from EKKO table and MENGE id from EKPO table .
             On clicking the EBELN there will be getting another report in which we get EBELN,EBELP and MATNR and MENGE from EKPO table .
           The problem is while displaying 1st report if the purchase order has two items in EKPO table then its displaying two times. How can i get only one time and the MENGE should be sum of those two item prices.

    hi use the statement not to get the  multiple items..
    sort itab by ebeln.
    delete adjacent duplicates from itab comparing vbeln.
    i will give u an example to get the total and subtotal ....
    *& Report  ZR_A1
    REPORT  ZR_A1
            NO STANDARD PAGE HEADING.
    Tables declarations
    TABLES: VBAK, VBAP.
    Variable declarations
    DATA: C1 TYPE C.
    Internal Table declarations*
    DATA: BEGIN OF IT_VBAK OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          VKORG LIKE VBAK-VKORG,
          VTWEG LIKE VBAK-VTWEG,
          SPART LIKE VBAK-SPART,
          END OF IT_VBAK.
    DATA: BEGIN OF IT_VBAP OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          MATNR LIKE VBAP-MATNR,
          NETWR LIKE VBAP-NETWR,
          BRGEW LIKE VBAP-BRGEW,
          NTGEW LIKE VBAP-NTGEW,
          END OF IT_VBAP.
    DATA: BEGIN OF IT_FINAL OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          VKORG LIKE VBAK-VKORG,
          VTWEG LIKE VBAK-VTWEG,
          SPART LIKE VBAK-SPART,
          POSNR LIKE VBAP-POSNR,
          MATNR LIKE VBAP-MATNR,
          NETWR LIKE VBAP-NETWR,
          BRGEW LIKE VBAP-BRGEW,
          NTGEW LIKE VBAP-NTGEW,
    END OF IT_FINAL.
    Selection-screen design
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-R01.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN: END OF BLOCK B1.
    TOP-OF-PAGE.
    FORMAT INTENSIFIED ON COLOR 5.
    WRITE:/7 'LIST TO DISPLAY SALES ITEM INFO'.
    START-OF-SELECTION.
    Populating it_vbak table
    SELECT VBELN
           VKORG
           VTWEG
           SPART
           FROM VBAK
           INTO TABLE IT_VBAK
           WHERE VBELN IN S_VBELN.
    populating it_vbap table
    IF NOT IT_VBAK[] IS INITIAL.
    SELECT  VBELN
            POSNR
            MATNR
            NETWR
            BRGEW
            NTGEW
            FROM VBAP
            INTO TABLE IT_VBAP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    populating the final list
    LOOP AT IT_VBAP.
    READ TABLE IT_VBAK WITH KEY VBELN = IT_VBAP-VBELN.
    IF SY-SUBRC = 0.
    MOVE:  IT_VBAK-VBELN TO IT_FINAL-VBELN,
           IT_VBAK-VKORG TO IT_FINAL-VKORG,
           IT_VBAK-VTWEG TO IT_FINAL-VTWEG,
           IT_VBAK-SPART TO IT_FINAL-SPART,
           IT_VBAP-POSNR TO IT_FINAL-POSNR,
           IT_VBAP-MATNR TO IT_FINAL-MATNR,
           IT_VBAP-NETWR TO IT_FINAL-NETWR,
           IT_VBAP-BRGEW TO IT_FINAL-BRGEW,
           IT_VBAP-NTGEW TO IT_FINAL-NTGEW.
    APPEND IT_FINAL.
    ENDIF.
    ENDLOOP.
    SORT IT_FINAL BY VBELN.
    LOOP AT IT_FINAL.
    AT FIRST.
    FORMAT INTENSIFIED ON COLOR 1.
    WRITE:/35 'SALES DOCUMENT ITEM LIST'.
    ULINE AT (100).
    *endat.
    FORMAT INTENSIFIED ON COLOR 5.
    WRITE:/ SY-VLINE,
          2  'SALES.DOCU.NO',
          13 'ITEM',
          21 'MATERIAL',
          50 'NET-VAL',
          65 'GROSS-WT',
          82 'NET-WT',
          100 SY-VLINE.
    ENDAT.
    FORMAT INTENSIFIED ON COLOR 2.
    WRITE:/ SY-VLINE,
           2   C1 AS CHECKBOX,
           5 IT_FINAL-VBELN,
          13  IT_FINAL-POSNR,
          21  IT_FINAL-MATNR,
          41  IT_FINAL-NETWR,
          56  IT_FINAL-BRGEW,
          71  IT_FINAL-NTGEW,
          100 SY-VLINE.
    AT END OF VBELN.
    SUM.
    FORMAT INTENSIFIED ON COLOR 3.
    WRITE:/    SY-VLINE,
             30   'SUB-TOTAL:',
             41   IT_FINAL-NETWR,
             56   IT_FINAL-BRGEW,
             71   IT_FINAL-NTGEW.
       WRITE:/100 SY-VLINE.
    ENDAT.
    AT LAST.
    SUM.
    FORMAT INTENSIFIED ON COLOR 6.
    WRITE:/ SY-VLINE,
              30  'GRAND-TOTAL:',
              41  IT_FINAL-NETWR,
              56  IT_FINAL-BRGEW,
              71  IT_FINAL-NTGEW.
      WRITE:/100  SY-VLINE.
      ENDAT.
      ENDLOOP.
    regards,
    venkat .

  • How to get only one line between tables in database diagram?

    Hi!
    I'm using jdev 10.1.3. I've got a database schema with a lot of tables. I would like to have them in one database diagram in compact view with only ONE line between two tables even if there are more foreign key columns between the two tables. In the shema there are a lot of foreign keys with multiple columns and the diagram is hard to read.
    How to archieve this?
    Thanks,
    Carsten.

    hi,
    u should use the same variable across all your queries.In the WAD there is a propoerty "display same variable once". Check that.
    hope it helps,
    regards,
    Parth

  • How to make only one row detail disclosed in uix:TableDetail

    I display row details to user with <uix:TableDetail>. I'd like to have only one detail displayed in the same time. When the page first loads, all details should be hidden, but whe user shows one another detail and one is already disclosed, only the new one should be displayed.
    I use <bc4juix:Table> and JDev 9.0.3.2
    Thanks in advance

    Viliam,
    The <table> element has the detailDisclosure complex attribute that you should use to control whether the details for table rows are disclosed. You should databind the detailDisclosure attribute to some DataObjectList that has the "disclosed" key set for each DataObject in the list. Then, when you disclose a new row, you should modify the DataObject for the corresponding row in the DataObjectLlist, and ensure that all other DataObjects set the "disclosed" key to false.
    Hope this helps,
    Ryan

  • How I can insert one row on table,  with columns settings: readonly = true

    I have a problem. (jdeveloper 11.1.1.2.0)
    How I can insert row on table (EditingMode= clickToEdit), with columns settings: ReadOnly = true.
    When I make click on button create insert, ADF create one row on the table with output text invisible ( ReadOnly = true.)
    I make double click, then output text is visible (ReadOnly = false)
    I dont want make double click. I want output text is visible (ReadOnly = false), when I make click on button create insert
    Thanks

    Hi,
    try changing the edit mode of the table when pressing the button and refresh the button. This of course turns the whole table into editable mode, but this is how it needs to work. Alternatively, you create an input form for the user to edit the new record and show the form in a popup or beneath the table. Then when the user submits the created row data, you refresh the table to shwo the new row
    Frank

  • How to restrict only one instance of web service running at a time

    Hi All,
    Have a requirement to ensure that only one instance of java web service is active at any point of time.
    Using Application Server 10.1.3.4. Not the soa suite.
    Thanks
    Saikrishna

    Thanks for the reply..
    I have a java web service that pulls up some files produced periodically from remote machine and uploads them to some doc mgmt system and then update the database that what files are uplaoded successfully so that during next run it will ignore those files.
    so, if my web service executes second time before completion of first run. It would pick files that were already processed by first run since the first run might have not updated the databse yet.
    Thanks
    Saikrishna

  • How to set only one row selection  in ALV GRID DISPLAY

    How to set single row selection in grid display
    not multiselection.

    Hi,
    In the USER COMMAND, build the code to check the REFRESHED Data & then check the number of records with SEL  = 'X'.
    If more than single entry found, then raise an error message.
    Best regards,
    Prashant

  • Select event not triggered in table with only one row

    Hi all,
    I am building a BI VC application where query data is displayed in a table. When the user clicks on a table row another query is then triggered and output in a second table. The output from table 1 is linked to the input of query2/table2 with a select event.
    The problem that I am facing is that if there is only one row in table 1, the select event is never triggered. If, however there are two or more rows in the table the select event is triggered and query 2 is executed. I have searched the forums but all I could find on select event problems was how to avoid the initial select event.
    Has anyone else experienced this issue and what is the workaround or is this a bug in Visual Composer? We are on VC 7.0 SP19.
    Cheers,
    Astein Meland

    Thanks Chittya,
    Yes we have considered this option as well. But as we have more than one table linked together we would like to avoid having to manually click several buttons.
    In the end I found Note 1364334 describing bugfixes released in VC 7.0 SP20:
    "Normally, when a Visual Composer table is populated from a data service, the first row is selected by default. However, we have found that if only one data row is returned from the data service, this row is not selected by default and cannot be manually selected by clicking on it either."
    So I think we will just have to upgrade our Portal to the latest support packs to solve this problem.
    Thanks,
    Astein

  • Grant to update only one row

    Hi all,
    I'm working with an 10.2.0.3 Oracle Enterprise version.
    I need to create a new user on my database with permission to update only one row on table.
    Have you notice if this is possible? In case, how is the grant to do this?
    Regards,
    dbajug

    Try this:
    SQL> create user usr1 identified by usr1;
    User created.
    SQL> create user usr2 identified by usr2;
    User created.
    SQL> grant connect, resource to usr1,usr2;
    Grant succeeded.
    SQL> conn usr1/usr1
    Connected.
    SQL> create table t (id number);
    Table created.
    SQL> insert into t values(1);
    1 row created.
    SQL> insert into t values(2);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> grant update on t to usr2;
    Grant succeeded.
    SQL> create or replace trigger trg_t
      2  before update on t
      3  for each row
      4  begin
      5  if :old.id>1 then
      6  raise_application_error(-22299,'You cant change the specific value ');
      7  end if;
      8  end;
      9  /
    Trigger created.
    SQL> update usr1.t set id=2 where id=1;
    1 row updated.
    SQL> update usr1.t set id=2 where id=2;
    update usr1.t set id=2 where id=2
    ERROR at line 1:
    ORA-21000: error number argument to raise_application_error of -22299 is out of
    range
    ORA-06512: at "USR1.TRG_T", line 3
    ORA-04088: error during execution of trigger 'USR1.TRG_T'
    SQL>

  • SQL Server 2012 Undetected Deadlock in a table with only one row

      We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
      This is our main database, so most of the applications access it.
      The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
      That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
      After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
    applications start a new transaction, get the current number, increment it by one and commit the transaction.
      The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
      No client application was changed in this migration and this process was working very well for the last 10 years.
      The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
      It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
      I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
      Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

    First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
    This is incorrect. 
    Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
    serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
    I converted the sample program to VB.NET:
    Public Class Form1
    Private mbCancel As Boolean = False
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim soConn As ADODB.Connection
    Dim soRst As ADODB.Recordset
    Dim sdData As Date
    Dim slValue As Long
    Dim slDelay As Long
    'create database vbtest
    'go
    ' CREATE TABLE [dbo].[ControlNumTest](
    ' [UltData] [datetime] NOT NULL,
    ' [UltNum] [int] NOT NULL,
    ' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    ' [UltData] Asc
    ' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
    ' ) ON [PRIMARY]
    mbCancel = False
    Do
    ' Configure the Connection object
    soConn = New ADODB.Connection
    With soConn
    .ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
    .IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
    .Mode = ADODB.ConnectModeEnum.adModeReadWrite
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .Open()
    End With
    ' Start a new transaction
    Call soConn.BeginTrans()
    ' Configure the RecordSet object
    soRst = New ADODB.Recordset
    With soRst
    .ActiveConnection = soConn
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
    .LockType = ADODB.LockTypeEnum.adLockPessimistic
    .Open("SELECT * FROM dbo.ControlNumTest")
    End With
    With soRst
    sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
    slValue = .Fields!UltNum.Value ' Read the last Number
    If sdData <> Date.Now.Date Then ' Date has changed?
    sdData = Date.Now.Date
    slValue = 1 ' Restart number
    End If
    .Fields!UltData.Value = sdData ' Update data
    .Fields!UltNum.Value = slValue + 1 ' Next number
    End With
    Call soRst.Update()
    Call soRst.Close()
    ' Ends the transaction
    Call soConn.CommitTrans()
    Call soConn.Close()
    soRst = Nothing
    soConn = Nothing
    txtUltNum.Text = slValue + 1 ' Display the last number
    Application.DoEvents()
    slDelay = Int(((Rnd * 250) + 100) / 100) * 100
    System.Threading.Thread.Sleep(slDelay)
    Loop While mbCancel = False
    If mbCancel = True Then
    Call MsgBox("The test was canceled")
    End If
    Exit Sub
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    mbCancel = True
    End Sub
    End Class
    And created the table
    CREATE TABLE [dbo].[ControlNumTest](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go insert into ControlNumTest values (cast(getdate()as date),1)
    Then ran 3 copies of the program and generated the deadlock:
    <deadlock>
    <victim-list>
    <victimProcess id="processf27b1498" />
    </victim-list>
    <process-list>
    <process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
    UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    (@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
    </process>
    <process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
    FETCH API_CURSOR0000000000000001 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    FETCH API_CURSOR0000000000000001 </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf6ac9498" mode="S" />
    <owner id="processf6ac9498" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="processf27b1498" mode="X" requestType="convert" />
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="X" requestType="convert" />
    </owner-list>
    <waiter-list>
    <waiter id="processf6ac9498" mode="U" requestType="wait" />
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
    X.  Deadlock. 
    I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
    The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
    .Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
    So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
    I tried several things that didn't require a code, which did not resolve the deadlock;
    1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
    2) SERIALIZABLE isolation level
    3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
    Then I replaced the table with a view containing a lock hint:
    CREATE TABLE [dbo].[ControlNumTest_t](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go
    create view ControlNumTest as
    select * from ControlNumTest_t with (tablockx)
    Which, at least in my limited testing, resovlved the deadlock without any client code change.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Issue with Selection Listener when the table has only one row

    Hi All ,
    I have developed a table in which I am using Selection Listener to perform some task when any row is selected.
    It is working fine when I have more than 1 row in the table, but when I have only one row in the table , the selection listener do not call the corresponding method in bean.
    I understand that selection event will be raised only when the row is changed, but in the use case when only one row is there, what should be done to make the selection listener work ?
    In the selection listener I have written code to make the selected row as current row , and perform the required task.
    Please suggest a way out for this situation.
    Thanks in advance.

    Hi,
    try removing this attr from table
    selectedRowKeys="#{bindings.xxx_VO1.collectionModel.selectedRow}"

  • Only one row show in table with tablepopin

    Hi,
    I've a table with a tablecolum with a tablepopintogglecell, and a tablepopin.
    I want that only one row show (when i press the togglelink if there is other row open, automatically close that row)

    Hi,
    you should implement the on toggle event,
    you will have the importing context_element, so you know which one is triggered,
    form your node, get_elements().
    loop over the table where ne to context_element, clear the popin attribute,
    grtz,
    Koen

Maybe you are looking for

  • "Update Delayed" while saving an Asset Master

    Hi, When I am changing an Asset master(AS02) it doesn't change and I get a message on status bar "Update Delayed". I debugged the standard program and everything goes fine but when it encounters "Commit work" statement it gets hanged and gives messag

  • Problem creating datasources and connectionpools in EM of oc4j

    Can SQLServer2000's connection pool be created through ENTERPRISE MANAGER of OC4J shipped with jdeveloper10.1.3.2. If yes, please let me know how? What is the Connection Factory Class to be specified? Please provide useful links

  • MS Dynamics CRM

    Hi Guys, I'm pretty new to BC and I'm looking at going for a project but would like to know it there is a way of integrating MS Dynamics CRM in to a BC built website and also Realex payment processing. These are key points for this project and would

  • Jar creation failed

    hi all, when i export java project as jar file i got a message[i] jar creation failed it's because of duplicate entry: .classpath how can i avoid this problem Thanks alot

  • Tftp on Labview 2010 and windows 7

    I am having difficulty running tftp on my Labview 2010 on windows 7 using the system exec vi. I already enabled tftp client on windows 7. What is interesting is that tftp runs when I execute it directly from the command prompt but gives an error when