Problem in Master-Details  - Inserting Records to same Table

I have 3 column of one table in master as primary key and 3 column of same table in detail as primay key. These 6 column collection as the composite primary key. when i try to insert the records in detail table it showing me Too many objects match the primary key oracle.jbo.Key Error.
I have done the Following things:
In HR Schema, I have created one Transient View Object for Master and Employee View Object for Details.
I have taken EmployeeId, FirstName and LastName columns in the Master i.e., From Transient View Object and droped it as the Form.
And I have taken E-mail, JobId, ManagerId columns in Details i.e From and droped it as the Table.
When I entered values in master and click CreateInsert in the details record. It showing me Too many objects match the primary key errors.
Help me out!!! for this problem.

Hi Kumar,
I was not in office for couple of days. Thats you couldnt reply for your earlier post. You had mentioned how can we set the value of the import parameter.
What i wanted to tell you is not to set the value for that Binary_flag, but that flag influences the data download in ASCII FORMAT.
You just try this: Try attaching a file through CL_CRM_DOCUMENTS~CREATE_WITH_TABLE. Before read the contents of a file into SAP using GUI_DOWNLOAD and read it in ASCII mode. Now when you try to pass this to Ascii internal table of the method specifing the MIME type, it will attach the document to the opportunity, but the document content will be still in ASCII.
If you try to download this file using GET_WITH_TABLE, then you can see BINARY_FILE is not set to 'X' and the content gets downloaded to Ascii internal table.
This is my observation.
I think when attaching documents in Opportunities by default, it reads the file in Binary mode. Because when i tried to attach a file directly in Opportunity transaction, and tried the method GET_WITH_TABLE, the BINARY_FLAG was set.
Hope now you understood, why i was mentioning that BINARY_FLAG influences the download of content in binary and Ascii format.
Regards,
karthik.

Similar Messages

  • Master-detail insert records form?

    Hi,
    I want to be able to build a master-detail insert form based on a BC4J, any ideas on the easiest way of doing this?
    I tried using the Data Web Beans from the JSP Element wizards, and found it possible to build a master-detail form for viewing data based on a BC4J application, but not inserting.
    I know it is probably possible to do this by coding your own Data Web Beans but is
    there any way of doing it with the Web Beans available?
    Thanks in advance.

    If you have a ViewLink in your AppModule for the master/detail tables, then the JSP application wizard automatically creates a master/detail page for this view link. You may want to use the generated page and modify it.

  • Problem in Master Detail form when using ADF table for Detail

    hi,
    jdev version-11.1.2.1.0
    i have create Master detail form using datacontrol drag as ADF Master Form Detail Table.
    Now when i create a new row in Detail table using CreateInsert button a blank new row created on the top of detail table.
    and other row show that data of previous record based on master.
    problem is that i want when i click on createInsert button all row of detail table should be blank and when user fill two or three row then commit.
    Thanks in Advance

    Hi,
    if a detail table has data, then createInsert adds to these. If you want to hide existing rows, create a new View Object instance and set its "Retrieve from the Database" option to "No Rows". The use an af:switcher to change the table shown when the user clicks the createInsert button. There is a bit of coding required to have this use case in ADF, but its mostly declarative. Bottom line is that there is no automated option other than creating new rows in a separate page or dialog if you are bothered by existing rows
    Frank

  • Inserting Record In same table through triggers.

    Hi,
    I've a table cus_mst ( cus_div_cd vachar2(1), cus_cd varchar2(5), cus_nm varchar2(100) )
    Records are inserted in this table through forms ...
    We need to automatically insert a record with a diff div_cd for any record inserted in the table .
    If div_cd 'I' is entered automatically a record with div cd 'S' with other coulmns having same values should get inserted .
    In case div_cd is 'S' then record with div_cd 'I' should get created.
    Eg : If in insert ( 'S', 'A0001', 'ABC COmpany' ); another record with values ( 'I', 'A0001', 'ABC Comapny' ) gets created;
    One way to do is to insert records in a view ( on the table ) and use instead of trigger to insert the corresponding record. But that is not possible as development team has to change form and use view instead of table.
    Have tried doing it by populating a collection in-each-row trigger and then using statment level trigger to insert from the collection. But this leads to recursive error.
    Would be great to get more insights into this..
    thanks
    cheers
    Jaani

    Hi,
    Within the following script you need to make adjustments according to your needs about the columns you need to test. But this might help you.
    Sorry for the layout. But I was not able to adjust it in a short time.
    drop table ad_test
    create table ad_test ( col1 varchar2(1), col2 varchar2(5), col3 varchar2(100) )
    create or replace package ad_test_pkg is
    procedure initialize_postpone ;
    procedure postpone_record( r_atst in ad_test%rowtype ) ;
    procedure handle_postponed_records ;
    end ad_test_pkg ;
    create or replace package body ad_test_pkg is
    type type_atst is table of ad_test%rowtype index by binary_integer ;
    t_atst type_atst ;
    procedure initialize_postpone is
    begin
    t_atst.delete ;
    end initialize_postpone ;
    procedure postpone_record( r_atst in ad_test%rowtype ) is
    begin
    t_atst(t_atst.count) := r_atst ;
    end postpone_record ;
    procedure handle_postponed_records is
    cursor c_test( cpiv_col1 in ad_test.col1%type ) is
    select 'x'
    from ad_test
    where col1 = cpiv_col1
    r_test c_test%rowtype ;
    r_atst ad_test%rowtype ;
    begin
    for i in t_atst.first .. t_atst.last
    loop
    r_atst := t_atst(i) ;
    if r_atst.col1 = 'I'
    then
    r_atst.col1 := 'S' ;
    else
    r_atst.col1 := 'I' ;
    end if ;
    open c_test( cpiv_col1 => r_atst.col1 ) ;
    fetch c_test into r_test ;
    if c_test%found
    then
    close c_test ;
    else
    close c_test ;
    insert into ad_test
    ( col1
    , col2
    , col3
    ) values
    ( 'S'
    , r_atst.col2
    , r_atst.col3
    end if ;
    end loop ;
    end handle_postponed_records ;
    end ad_test_pkg ;
    create or replace trigger test_ad_bis
    before insert on ad_test
    begin
    ad_test_pkg.initialize_postpone ;
    end ;
    create or replace trigger test_ad_air
    after insert on ad_test for each row
    declare
    r_atst ad_test%rowtype ;
    begin
    r_atst.col1 := :new.col1 ;
    r_atst.col2 := :new.col2 ;
    r_atst.col3 := :new.col3 ;
    ad_test_pkg.postpone_record( r_atst => r_atst ) ;
    end ;
    create or replace trigger test_ad_ais
    after insert on ad_test
    begin
    ad_test_pkg.handle_postponed_records ;
    end ;
    insert into ad_test values ( 'I', 'A0001', 'ABC COmpany') ;
    select * from ad_test ;
    Greets,
    Ad
    Edited by: loaddev on 10-nov-2010 4:47

  • Problems in Master-Detail forms when the detail contains LOVs

    I am having problems with master detail forms when the detail contains and lov.
    In my detail form I have a messageLovInput field that returns 2 values (code and description). When the lov window returns both values the messageLovInput disappear from the form.
    This problem happens only when I iterate in the master view and I try to add a record in the detail form.
    If I add a new record without navigation for the master view there is no problem.

    Jode,
    which technology are you using, ADF JClient ? If yes, please provide a step by step description of how to setup a testcase to reproduce the problem.
    Frank

  • Problem with Master Detail between 3 tables or more

    Hi to the community, I have the following problem.
    I have 3 tables relationship : table Solicitud, ItemSolicitado,Cotizacion
    Solicitud - ItemSolicitado ( 1 to * relationship )
    ItemSolicitado - Cotizacion ( 1 to * relationship )
    Solicitud - Cotizacion ( 1 to * relationship )
    I have a Master Detail between Solicitud/ItemSolicitado , and it run correctly, I Insert,update,delete correctly ( with expression Groovy )
    I want make a master/detail between ( Solicitud/ItemSolicitado ) / Cotizacion , because I need insert some data in Cotizacion table with some data from Solicitud/ItemSolicitado.
    The user see the Master/Detail between the Solicitud/ItemSolicitado Tables, and when the user select a item from the detail ( ItemSolicitado ) I want insert data into Cotizacion Table with the Solicitud Primary key and ItemSolicitado primary key
    How I can make a Master Detail between 3 tables or more ?? or, How I can do what I want ? some idea ??
    Thanks.

    I resolved it !!, Only create a view link between the tables and I define in the Data Model Tab of my application module, as following, and it run !!
    +Solicitud              // parent
    +ItemSolicitado   // child 1
    +Cotizacion        // child2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with master/detail relationship

    Two tables :
    Master_table:
    Customer_no primary key
    Buyer_seller_type primary key
    Product_code primary key
    Detail_table
    Branch primary key
    Customer_no primary key
    I altered detail_table and added 2 more primary key fields:
    Buyer_seller_type primary key--
    Product_code primary key.
    Now I have to change the existing fmb according.
    I have maintained master/detail relationship for these 2 tables in the form.
    When I run this form and Try to save the date . I am getting error like
    Cannot insert null into buyer_seller_type field ie my new column.
    Insert into detail_table (branch,customer_type) values (:1,:2) ;
    I have maintained master/detail relationship. And what r the others properties I have to set to overcome this .
    my requirement is query should be like this:
    insert into detail_table (branch,customer_type,buyer_seller_type,product_code) values (:1,:2,:3,:4) ;
    how can i do this.
    I am using forms 6.
    plz its very urgent..plz help me.
    advance thanks

    Set following item property under Data node for both the new added column in detail table:
    Copy Value from Item:
    Enter <master_table_name.item_name>
    Regards,
    Hassan

  • Insert data in same table based on some condition

    Hi. I am new to this forum.
    I have to write a stored procedure to Insert Data into a table say MYTABLE ,having structure as:
    Col1 Col2 Col3 ................ TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data as it is in the same table(MYTABLE) except changing some fields on basis of some conditions:
    1. if PaidAmount>0 && CurrentInstallment<TotalInstallment then
    CurrentInstallment=CurrentInstallment+1
    2. In the MonthYear field I am having data in formate(month/year)ex. 01/2012, 11/2012 ....
    So I have to insert data by incrementing month and year. for example:
    if currentdata is 11/2012 then next data will be 12/2012
    But next will be 01/2013
    I have to select all the records which belongs to previous month(through MonthYear field ) and put checking & changes on each record of the selected data and then insert them into same table(MYTABLE).
    How to achive that?
    Thanks.

    978184 wrote:
    Every thing is working fine but some strange result as:
    when i run my Procedure TRANSFERDATATONEXTMONTH
    1. by Passing Value as : CUSTOMERID_var ='ABX101' and MONTHYEAR_var='12/2012' it insurts 5 rows
    which is correct , since I have 5 records where CUSTOMERID='ABX101' and MONTHYEAR='12/2012' and
    new 5 rows has CUSTOMERID='ABX101' and MONTHYEAR='01/2013' (all other values are as expected)
    2. now when i again run by passing values: CUSTOMERID='ABX101' and MONTHYEAR='01/2013' it inserts 10 records(just double )
    and new records has value CUSTOMERID='ABX101' and MONTHYEAR='02/2013' (while on the basis of condition CUSTOMERID='ABX101' and MONTHYEAR='01/2013' i have in my table only 5 records)
    and all records are duplicate. Some times it inserts three times , while on condition basis it should no. What is happening?Probably, meanwhile you were trying to Insert the First time and the second time, someone did run the procedure that Inserted 5 More records for 01/2013. And, hence your Second run inserted 10 records instead of 5.
    >
    Why it is inserting double of records while i have only 5 records on given condition? Am I missing some thing?Yes, you are. You are missing your Tables, Your Dummy/Sample Data, Working Procedure/Function that can be replicated.
    Without this, we cannot simply believe on assertions that Oracle is behaving incorrectly.
    In addition to this, the GetMonthYear function, should be scrapped. It is un-necessary, when the same logic can be achieved using Oracle ADD_MONTHS function (See my previous post). And you are storing the MonthYear in a Varchar field, which ideally should be a Date field. This eradicates the un-wanted need to cast from VARCHAR - DATE - VARCHAR.
    Please do make some time to read {message:id=9360002} and mentioned relevant details.
    And notice, the code difference in my previous post and in your code.
    Please use
    {noformat}
    (exactly as shown) above and below your code, that indents the code properly for better readability.
    {noformat}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Concurrency when inserting in the same table

    Hi,
    I have a report used by several users and in this record there is a sentence to insert in a z table. My question is, what happens whether two or more users are inserting records in that table at the same time?  There is a concurrency problem, isn't there?
    How does SAP manage this issue? or, what must I do in this case?
    Thanks in advance.
    Regards.

    Hi David,
    As SAP applications are accessed by many end users at same time, SAP has concept called LOCKING of particular tables involved in the transaction.
    You can achieve your requirement as below
    Go to t-code SE11, and create a lock object for your Ztable
    Now, system create 2 function modules - 1 for locking ENQUEUE_* & other for un-locking DEQUEUE_*  ( search for function module in SE37 )
    Before saving data to ZTABLE, call function module ENQUEUE_* to lock the table for writing data, if locking fails, means there is somebody already working on it, hence you can display error message
    After Save action, you can unlock the table by using FM ... DEQUEUE_*
    Note: you can lock and unlock event during DISPLAY/CHANGE mode if your requirement requires.
    Hope this helps you.
    Regards,
    Rama

  • Using Crystal 2008 to insert records into a table

    Hi,
    We have a unique need to use Crystal to insert records into a table. We have managed to test a report that can write into a temporary table.  This is done by using sql command object  and uses  the following code :
    INSERT INTO TEMP_TABLE  (ORDERID)
    VALUES ({?orderid})   (-- where orderid a parameter).
    This test report asks for an order id and then inserts the record perfectly fine.
    Now moving on to the real report - This report basically prints orders in batches and we want to insert order id into a temporary table to ensure we don't print orders that were already printed. To do this we created a sub report "insert orders" that has the above insert command. The main report passes the orderid to subreport and the idea is that the subreport would insert each time an order is passed. So if main report printed 50 orders ids, the then it would do 50 inserts individually into the temp table. 
    This however is NOT working. The report runs fine but there is no insert.  Our hunch is that  Crystal is not committing after every order id is passed from the main report.  Not sure if we can set the AUTO COMMIT ON  as a default somewhere?
    Wondering if any one has attempted this or has any insights?
    Regards,
    Mohit.
    Environment is - Crystal 2008 and Oracle 11GR2, we are using Oracle drivers (and not odbc)

    Hmmm... I don't use Oracle but the syntax looks good...
    You've already tested it and I assume that you are using the same driver in the production report as you used in the test, so that shouldn't be an issue...
    how are you pulling the data? Is the final SELECT statement that pulls the report data in the same command as the INSERT script, or is the INSERT script in it's own command?
    The reason I ask... If you are trying to pass a multi-valued parameter to a command, it won't work. If you have the insert command as it's own command while the data is being pulled with linked tables or a separate command, it is possible that the report itself will execute as expected w/o passing a value to the insert script.
    If it's all in 1 command (as it should be), a bad parameter would fail in the final SELECT causing an error.
    Also... are rows null or empty string values being added to table when the report executes? This would be an indication that the command is being executed but isn't getting the parameter value.
    Jason

  • DELETING child record of same table..  qry  required( complicated)

    hai
    how to delete the child record of same table...?
    Here is the example...
    CREATE TABLE TDA
    (     PKNODAVE VARCHAR2(7 BYTE) NOT NULL ENABLE,
         DTCREATION DATE,
         DAVETRANSFERT VARCHAR2(7 BYTE),
         PKPARC NUMBER(5,0)
    ALTER TABLE TDA ADD CONSTRAINT PK_TDAV8 PRIMARY KEY (PKNODAVE)
    ALTER TABLE TDA ADD CONSTRAINT FK_TDA1 FOREIGN KEY (DAVETRANSFERT)
         REFERENCES TDA (PKNODAVE) ENABLE
    REM INSERTING into TDA
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('1',to_date('05-JAN-10','DD-MON-RR'),'1',10);
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('2',to_date('05-JAN-10','DD-MON-RR'),'2',10);
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('3',to_date('05-JAN-10','DD-MON-RR'),'3',10);
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('4',to_date('05-JAN-10','DD-MON-RR'),null,10);
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('5',to_date('05-JAN-10','DD-MON-RR'),'4',14);
    Insert into TDA (PKNODAVE,DTCREATION,DAVETRANSFERT,PKPARC) values ('6',to_date('05-JAN-10','DD-MON-RR'),'5',15);
    DELETE FROM TDA WHERE davetransfert IN ( SELECT PKNODAVE FROM TDA WHERE PKPARC='10')
    ERROR: FK_TDA1 CHILD RECORD FOUND...
    Pls give me the suggestions to solve this
    S

    You could try with a recursive procedure like this
    Processing ...
    select *
    from TDA
    Query finished, retrieving results...
    PKNODAVE      DTCREATION    DAVETRANSFERT   PKPARC  
    1                   05/01/10 1                     10
    2                   05/01/10 2                     10
    3                   05/01/10 3                     10
    4                   05/01/10                       10
    5                   05/01/10 4                     14
    6                   05/01/10 5                     15
    6 row(s) retrieved
    Processing ...
    declare
         cursor c is
              SELECT PKNODAVE FROM TDA WHERE PKPARC='10';
         procedure tda_cascade_delete(
                   del_PKNODAVE in varchar2
         as
              cursor sons is
                   select PKNODAVE
                   from TDA
                   where DAVETRANSFERT = del_PKNODAVE
                        and PKNODAVE <> DAVETRANSFERT;
         begin
              for x in sons loop
                   tda_cascade_delete(x.PKNODAVE);
              end loop;
              delete TDA
              where PKNODAVE = del_PKNODAVE;
         end;
    begin
         for x in c loop
              tda_cascade_delete(x.PKNODAVE);
         end loop;
    end;
    Processing ...
    select *
    from TDA
    Query finished, retrieving results...
    PKNODAVE      DTCREATION    DAVETRANSFERT   PKPARC  
    0 row(s) retrievedPS. A connect by subquery of the type
    delete tab
    where pk in (
              select fk
              from tab
              start with <my condition>
                   connect by fk = prior pk
         ) or <my condition>l;wouldn't generally work because it could try to delete a record before its children.
    Bye Alessandro

  • Possible solution to avoid deadlock when two inserts happen on same table from two different machines.

    Possible solution to avoid deadlock when two inserts happen on same table from two different machines.
    Below are the details from deadlock trace.
    Deadlock encountered .... Printing deadlock information
    Wait-for graph
    NULL
    Node:1
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x00000013F494A980 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:376 ECID:0 XactLockInfo: 0x000000055014F400
    SPID: 376 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    NULL
    Node:2
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x0000000B3486A780 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:238 ECID:0 XactLockInfo: 0x0000002AA53383F0
    SPID: 238 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x000000055014F3C0 Mode: RangeI-N SPID:376 BatchID:0 ECID:0 TaskProxy:(0x000000080426E538) Value:0x30614e80 Cost:(0/41748)
    NULL
    Victim Resource Owner:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    deadlock-list
    deadlock victim=process5daddc8
    process-list
    process id=process5daddc8 taskpriority=0 logused=38828 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994026815 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.347 XDES=0x2aa53383b0 lockMode=RangeI-N schedulerid=43 kpid=14156 status=suspended spid=238 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.463 lastbatchcompleted=2014-07-25T12:46:57.463 clientapp=pa hostname=pa02 hostpid=1596 loginname=myuser isolationlevel=serializable (4) xactid=2994026815 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=mydb.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1] .....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    process id=process5d84988 taskpriority=0 logused=41748 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994024748 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.320 XDES=0x55014f3c0 lockMode=RangeI-N schedulerid=39 kpid=14292 status=suspended spid=376 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.440 lastbatchcompleted=2014-07-25T12:46:57.440 clientapp=pa hostname=pa01 hostpid=1548 loginname=myuser isolationlevel=serializable (4) xactid=2994024748 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=pa.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1]....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    resource-list
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5d84988 mode=RangeS-S
    waiter-list
    waiter id=process5daddc8 mode=RangeI-N requestType=convert
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5daddc8 mode=RangeS-S
    waiter-list
    waiter id=process5d84988 mode=RangeI-N requestType=convert

    Don't know. Perhaps these can help. I scanned the second link but didn't see much about Ending Deadlocks. I'd say the Fourth link probably has better information than the first three links. But maybe read them all just in case the Fourth is missing something
    one of the first three have.
    Deadlocking
    Detecting and Ending Deadlocks
    Minimizing Deadlocks
    Handling Deadlocks in SQL Server
    Google search for "SQL Deadlock"
    La vida loca

  • Reg : first inserted record in a table

    Hello all,
    Could any of you help me in writing a query to get the first
    inserted record into a table.
    Suppose I've the following table :
    my_table : structure
    Name Null? Type
    ID NOT NULL NUMBER
    Ive inserted value 20 into the table first, and then inserted
    value 10. I want to retrieve the first inserted record with
    value 20. How do I write the query for that ??????
    Awaiting for the reply,
    Thanks in Advance...
    Srini

    One small disagreement with Andrew's posting, but
    rownum is assigned to rows after they have been identified
    as part of the result set, but before the ORDER BY is
    applied. Hence the two queries ...
    select * from my_table
    where rownum = 1
    order by id ASC
    ... and ...
    select * from my_table
    where rownum = 1
    order by id DESC
    ... will probably return the same result.
    However in neither case is the result guaranteed to be the
    first inserted row.
    If you had created a table very recently, and it had only a
    single extent, you could get the first row of the first block of
    that extent with ...
    select * from my_table where rowid =
    (select min(rowid) from my_table)
    ... but as Andrew says, the only way to do the job properly is
    to timestamp the rows as they are inserted. Anything else
    would only be of theoretical interest.

  • Inserting records into a table with all caps

    Hello
    I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table?
    Thanks.

    You can use UPPER(..) function in your insert statement, so that values are converted to UPPER, before insert.
    If you want to check at table level, you can achieve that by writting a before insert trigger and in that trigger check
    IF UPPER(:new.<col>) != :new.<col> THEN
    RAISE_APPLICATION_ERROR(-20101,'Error: Not all values are in upper case')
    END IF;

  • Please Help me in inserting record in a table

    Hi,
    Kindly help me on how to insert records in a table that the values are from the another table.
    for example :
    i have table1, all of the records in column1 of table1 will be inserted to table2 column2 . .
    I already tested it to a visual foxpro programming language and it's ok, i used this command :
    *"INSERT INTO table1 (column1) SELECT column2 FROM table2"*
    but when I try it to a JAVA Program, there's an error.
    Please help me.. Thank You.

    Sir, this is what you mean?
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
    at remittance.utility.security.frmRole.addtoPermission(frmRole.java:197)
    at remittance.utility.security.frmRole.btnADDActionPerformed(frmRole.java:177)
    at remittance.utility.security.frmRole.access$200(frmRole.java:22)
    at remittance.utility.security.frmRole$3.actionPerformed(frmRole.java:92)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Maybe you are looking for

  • WiFi issues with Curve 8530

    Hi, I am having major WiFi issues with my Curve 8530. Everytime I connect to my wireless router, it takes a long time to connect to BIS, and then if I try to use basically any data at all, my router drops my Curve 8530. Sometimes it stays connected,

  • Euro character in HTML with non-euro supported language

    I have a customer in Belgium who wants a servlet-generated webpage that displays the text in english, but the decimal notation as belgium and the currency as EURO. The problem is that en_BE_EURO does not work because it doesn't exist according to: ht

  • Ipod Service Failed To Start!!!!!!! Grrr!

    Hi Everyone.. Well, I have been at trying to sort this out ALL day and I still haven't managed to figure it out or find a solution! I have tried every troubleshooting method I could find to get my ITunes to recognise my Ipod and I am now stuck on thi

  • Inter company Billing is taking a wrong value of the Bill

    Inter company Billing is taking a wrong value of the Bill

  • My iPhone 4 wont tether via WiFi or Bluetooth, after installing Lion

    I have not had any problems tethering until after the Lion upgrade. I have tried WiFi and Bluetooth and it looks like Lion is dropping the connection attempts from the phone. Bluetooth: I deleted the pairing on both iPhone and Macbook and redid the p