MAX(SummaryNum) +1 bad idea, but how to use sequence part composite column

Hi,
My relational mode is as follows
Policy (policynum PK) has 1:M with Summary (policynum FK, SummaryNum part of PK, other columns part of PK)
Basically for each policy users can enter notes with SummaryNum 1, 2, 3, 4.... These numbers are shown to the user for tracking purpose. I need to make sure summary notes for EACH policy start with 1 (cannot really use sequence in the table in the strictest sense) and are incremented by 1. The current Oracle form basically creates the next highest possible value of SummaryNum by adding one to the currently available highest value. In brief, it is like a sequence number for summaries of a particular policy in the summary table.
PRE-INSERT
SELECT MAX(SummaryNum ) + 1
FROM Summary
I am trying to replicate this in ADF BC (using 11g) and know that not using sequencing and adding one to get the next number is a very bad idea due to concurrency challenges (transactional ACID properties). The reasons are as follows.
•     Using MAX(policy_memo_seq_num) + 1 is not scalable,
•     It will lead to duplicates in a multi-user environment, whether ADF BC, Oracle Forms, or any other technology
I also know how to use create a sequence in db, a related trigger, and then set the attribute in EO properties as DBSequence. My challenge is that since SummaryNum is not a primary key, and instead is part of a composite key in my case, how do I make sure that summary notes for EACH policy start with 1 in the Summary Table.
I appears that i cannot really use sequence in the table in the strictest sense as this will mean that for policies the summaryNum will start from the next available sequence number, but what i really want is to have it start by one for all policies.*
I would appreciate any help.
Thanks,

Not sure if there is a better way, but here is one way. Let's say your table was like this:
    SQL> desc versioned_item
     Name         Null?    Type
     ID           NOT NULL NUMBER
     VERSION      NOT NULL NUMBER
     DESCRIPTION           VARCHAR2(20)and lets say your data looked like this:
    SQL> select * from versioned_item order by id, version
            ID    VERSION DESCRIPTION
          1001          1 Item 1001
          1001          2 Item 1001
          1001          3 Item 1001
          1002          1 Item 1002
          1002          2 Item 1002
          1003          1 Item 1003To select only the rows for the max-version-id, you could do this:
    select id, version,description
    from versioned_item
    where (id,version) in (select id,max(version) from versioned_item group by id)
    order by id
            ID    VERSION DESCRIPTION
          1001          3 Item 1001
          1002          2 Item 1002
          1003          1 Item 1003To capture this as a view object, you'd only just need to paste in the WHERE clause above into the Where clause box of the view object. No need to use expert-mode since you're not changing the select list or from clause.

Similar Messages

  • How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your repl

    How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your reply. Thanks!

    It's good to read Antoniad's post.  It reassures me that I can use my new iPad as an international communication device which is the reason I purchased the thing.  However, I called Verizon today (my provider of cellular data) who told me that I can't just pop in a SIM card as you suggested.  He also said that he was from the "Pre-Pay" division of Verizon and he was certain that I couldn't do what I planned to do.  I was extremely disappointed as I had called Apple prior to buying the iPad and I read the algorhythm on the website for choosing an iPad before purchasing.  Those sources were quite specific and the information seemed clear.  I would be able to use my iPad to communicate through cellular connections while traveling on the road, literally, abroad.  I was told that I could pop in a data card wherever I was, just as you indicated in your message above, and voila I was good to go.  The Verizon rep definitively rained on that parade, but said that I might be able to do this if I have a "Post-Pay" account, a different area of Verizon.  I haven't had the chance to talk to this division yet, so I looked to Apple's Support for answers.  Maybe I will find out that I can use my iPad as an international communication device while traveling on the road afterall, however, it appears I may need a different type of account (Post-Pay), something I was never warned about. Can I switch to this kind of account?  I don't know.  I have to find out.  If you have any information about this issue, it would be good to share since I strongly suspect there are others who bought the iPad for the same purpose that I have.

  • I have an idea , but how to convert it to a program then how to send it to apple for approval

    i have an idea , but how to convert it to a program then how to send it to apple for approval

    An App?
    See the developer department.
    Developer.Apple.com

  • But how to use submit??

    but how to use submit?? i mean how to generate an event thru submit and how to receive these values in the next page

    but how to use submit??You can do it by using Simple HTML Code
    <INPUT TYPE="SUMBIT" VALUE="SUBMIT">
    i mean how to generate an event thru submit and how to receive these values in the next pageTo generate an event through Submit! You need to do this using java script.
    I think you are talking about assingning some values on the click of submit and collecting those values in the next page!
    To do that
    keep some input fields in page1. Then try to assign the values to those input fileds using javascript through onclick event.
    <INPUT TYPE="SUMBIT" VALUE="SUBMIT" onclick="javascript:callSomeFunc()">
    In
    callSomeFunc() {
    //Assign values to the hidden fields
    In next page say page2 collect those values using request.getAttribute(" InputHiddenFieldsName);
    That's it.

  • I have problem  in signing in I don't like read and accept terms I cannot access this I don't know about this read and accept terms this is poor, I just like android's simple option and simple singing in, but how to use apple I'd?

    I have problem  in signing in I don't like read and accept terms I cannot access this I don't know about this read and accept terms this is poor, I just like android's simple option and simple singing in, but how to use apple I'd?

    Your computer is called an iMac.
    Did you turn proxies on?  If so, you should turn them off.

  • I have deploy an EJB in weblogic 6.1,but how to use jsp to invoke the EJB's method?

    i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke the EJB's method?
    thanks!

    You'd do something like:
    <%
    //vvv this part can potentially be done in initialization
    Context ctx = getInitialContext();
    BeanHome home =
    (BeanHome)PortableRemoteObject.narrow(ctx.lookup("the.jndi.name"),
    BeanHome.class);
    Bean b = home.create();
    //^^^
    Result r = b.invokeMethod();
    %>
    "toxin" <[email protected]> wrote in message
    news:3d2e95e5$[email protected]..
    >
    i have deploy an EJB in weblogic 6.1,but how to use jsp to invoke theEJB's method?
    thanks!

  • SRM 7.0 BADI Define Agents-- How to use type /sapsrm/t_wf_area_entity

    Hi Experts,
    I'm using SRM 7.0. When implementing BADI /SAPSRM/BADI_DET_AG (Define the agents of  procsess controlled workflow), I created the sub-class of interface /SAPSRM/IF_WF_AREA to develop my won logic in method GET_RESPONSIBLE_APPROVERS.
    I want use the data in workflow container, seems the method GET_AREA_ENTITY_IDS of /SAPSRM/IF_WF_AREA  can provide a pointer which type is /sapsrm/t_wf_area_entity and point workflow area.
    My question is how to use this pointer (or how to use the type /sapsrm/t_wf_area_entity )? Many thanks.
    PS. I found some example code delivered by sap, but i want know the full structure which /sapsrm/t_wf_area_entity point. Below code for your reference:
    METHOD /sapsrm/if_wf_area~get_responsible_approvers.
      DATA lt_area_entity_id TYPE /sapsrm/t_wf_area_entity_id.
      DATA lr_area_entity_id TYPE REF TO /sapsrm/wf_area_entity_id.
      DATA ls_actor_id       TYPE swhactor.
      DATA lt_approver       TYPE /sapsrm/t_wf_approver.
      FIELD-SYMBOLS: <ls_agent_id> TYPE /sapsrm/s_wf_approver.
      lt_area_entity_id = me->/sapsrm/if_wf_area~get_area_entity_ids( ).
      LOOP AT lt_area_entity_id REFERENCE INTO lr_area_entity_id.
        ASSIGN lr_area_entity_id->* TO <ls_agent_id> CASTING.
        TRY.
            ls_actor_id-otype = <ls_agent_id>-approver_ot.
            ls_actor_id-objid = <ls_agent_id>-approver_id.
            lt_approver = /sapsrm/cl_wf_config_user=>get_manager_list( ls_actor_id ).
            APPEND LINES OF lt_approver TO rt_approver.
          CATCH /sapsrm/cx_wf_error /sapsrm/cx_wf_abort.
            CONTINUE.
        ENDTRY.
      ENDLOOP.
    ENDMETHOD.

    Hi Darcy,
    You can also use FM SAP_WAPI_READ_CONTAINER to read workflow container values.
    Please state if you have some other specific requierment.
    Regards,
    Saumya

  • Any idea about how to use EclipceMe

    Im a new in J2Me environments and I'm using EclipceME as an IDE for it
    im able to debug n run the programme in the mobile emulator but the problems is if there is an error it is just tell u that there i an error but does not tell where is the error or in which line
    if somone tell me how to use the eclipseME to develop a mobile program or if there is any other IDE which has better feature

    Hi,
    Follow the following links to find what u need (Eclipse IDE):
    - [http://bin.adawy.googlepages.com/DevelopingJ2MEapplicationswithEclips.pdf]
    - [http://eclipseme.org/docs/|http://eclipseme.org/docs/]
    Better and powerfull IDE : Netbeans
    - [http://www.netbeans.org/kb/trails/mobility.html|http://www.netbeans.org/kb/trails/mobility.html]

  • Ideas on how to use p:first-letter

    Hi,
    Any ideas on how to get the first letter in a paragraph
    floating in the
    text, to the left, so that the top of the letter lines up
    with the top
    of the first line, and the bottom of the letter lines up with
    the bottom
    of the third line?
    For some reason I am not able to set the line-height of the
    first-letter, so it starts in the wrong place.
    Thanks!
    Misha

    Hmm does not look right on my firefox (mac 1.5). The drop cap
    starts too
    low (I think it is keeping the line-height or margin of the
    paragraph). Looks worse in safari.
    Odd that this is such a problem for good browsers. I think IE
    gets it right.
    Gary White wrote:
    > On Fri, 06 Apr 2007 16:16:01 -0400, Misha Cohen
    <[email protected]>
    > wrote:
    >
    >
    >>Still looking for a fix for this (or a reason why it
    isn't working).
    >
    >
    > I don't know why yours isn't working. I was playing with
    this a while
    > back:
    http://testing.apptools.com/experiments/drop-cap/
    >
    > It works well in both IE6/7 and Firefox, but gets pretty
    ugly in Opera.
    > Because of that, I left the example on my site using
    spans:
    >
    http://apptools.com/examples/dropcap.php
    >
    > Gary

  • Idea about how-to using 'Agilent Wireless Test Manager' interfaces in Labview ?

    Hello everyone,
    I am not sure whether it is appropriate to post this here.  
    Currently I got a Wireless Test Manager CD(Agilent E6560A) and is trying to convert some functionalities inside class 'cdmaTXMeasTests' into labview.
    I am doing the 'code domain power testing' module with labview, which is well done in that 'cdmaTXMeasTests'.
    I am wondering if any one could provide me some idea how to use that 'cdmaTXMeasTests' in my labview without rebuild the wheel.
    ( I am not sure whether that would work,  Are the libaries used by wireless test manager a  ActiveXDLL that could be used by labview ? Or there is some other way to do it or not?)
    Any idea is well appreciated,
    +Kunsheng Chen

    Good Afternoon Kunsheng Chen,
    It seems like you are trying to port your DLL.  Rather, I would suggest using a Call Library Function Node (right-click the Block Diagram, Functions>>Connectivity>>Libraries & Executables>>Call Library Function Node).
    From the Agilent website, this is a C dll so you will be able to access it using this VI in LabVIEW with no problems.  You might want to contact Agilent to see if this DLL has ActiveX components.  Alternatively, you can simply browse the list of ActiveX components on your computer.
    The following links may provide some useful information for using a DLL in LabVIEW.
    An Overview of Accessing DLLs or Shared Libraries from LabVIEW
         http://zone.ni.com/devzone/cda/tut/p/id/3009
    Call Library Function Node
         http://zone.ni.com/reference/en-XX/help/371361E-01​/glang/call_library_function/
    Using Existing C Code or a DLL in LabVIEW
         http://decibel.ni.com/content/docs/DOC-1690
    Regards,
    Charlie Piazza
    Staff Product Support Engineer, RF
    National Instruments

  • I had downloaded ringtone 60000   and also created ringtone on that but how to use that ringtone

    please let me know how to use the ringtone created using this app

    I couldn't find the app you refer to in the App Store US however the ringtone makers I have used in the past send the tone to your email and when you click the link provided in the email, using your computer, it sends the tone to iTunes on your computer to sync with the iPhone. Try that and see if that works.
    Perhaps you could post a link to the app and if possible I can check into it.

  • How to use Version and Comments column in Finder

    Hi,
    in Finder you can choose to show the Version column and also the Comments column.
    Can someone please explain how to use these features?
    I hope there are some type of configuration managment feature hidden behind this column but I haven't found any info on this when seraching the web. To begin with I'd like to be able to add info to these fields.
    Have a nice day!
    /Erik

    Applications can have version numbers, like Safari 5.1.10 or 7, or Image Capture, as above.
    Files that the user can write to, may have 'spotlight comments' added via the Finder - Get Info window. Those can be displayed in a Finder listing, as you've noted, and entries  will be indexed by spotlight so that they show up in a search of file contents.

  • How to use Sequence in Forms

    Hi,
    I have an Empno Column, At the time of Opening a Form The Empno Will be displayed by using Sequence.
    If the User doesn't save the Form Then the Empno Generated number will be changed.
    How to write the code to get sequence numbers at Empno columns by using Sequence?
    Thanks & Regards,
    Hari Babu

    Ok, I understand now your question. Since the oracle sequence is commited in a separate transaction, it is not possible to get the no-gap sequence, considering your example. In the other hand, if you don't commit immediately, than two concurrently opened forms could use the same sequence number, so you'll get the duplicate key!
    If you're sure that this couldn't happen, you can manage your own sequencing, storing them in another table. Let's say you reached seq 999: entering the form, you'll read from your sequence table 1000, increment to 1001, and assign it to empno, but without commiting. Next time, you'll get the same number, until you commit form, and at the same time, change in seq table. So another will get 1001.
    Downside of this approach are, as mentioned before, concurrent sessions, which will get the same sequence.

  • How to use string as a column name

    Hello,
    I have a fn getField() that returns a column delimited string - amt1,amt2 . I want to use this string as the column name in a second query on table MASTER_AMT and get the values for amt1 and amt2...so when i try....
    select getField( 'NPC_NOYTG' ) FROM MASTER_AMT
    WHERE ACTI_CODE = 'NPOR';
    the o/p i get is...
    GETFIELD('NPC_NOYTG')
    AMT1,AMT2,AMT3
    instead of...
    AMT1 AMT2
    500 0
    that i require.
    Any ideas on how to convert the string returned to a column name?
    Thanks very much
    rgds

    Try this ....
    In SQL*PLUS
    SQL> var ref_c refcursor
    --- Then type the follwing at SQL prompt
    declare
    cursor cur is
    select column_name
    from user_tab_columns a,
         (select upper(getField( 'NPC_NOYTG')) fld FROM MASTER_AMT
         WHERE ACTI_CODE = 'NPOR') col_lst
    WHERE
    instr(chr(44) || col_lst.fld || chr(44),chr(44) || a.COLUMN_NAME || chr(44) ) > 0
    AND table_name = 'MASTER_AMT';
    v_str varchar2(1000):= ' ';
    begin
    for c in cur loop
    v_str := v_str || c.column_name || ',' ;
    end loop;
    v_str := substr(v_str,1,len(v_str)-1);
    open :ref_c for
    'select ' || v_str || ' from master_amt';
    end;      
    --- after executing the above block, type the following at SQL prompt
    SQL > print ref_c
    Please let me know if this works for you. This should for any number of columns returned by the function.
    Shakti
    (http://www.impact-sol.com)
    (Developers of Guggi Oracle)

  • How to use sequence in MS sql server?

    In Oracle DB we use sequence like that:
    SequenceImpl s = new SequenceImpl("customer_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue()));
    But there is no sequence in sql server ,how can I do?
    Thank you~~

    MS SQLServer have a IDENTITY column property and UNIQUEIDENTIFIER data type that is somewhat similar to Oracle's sequence. I don't know whether your table contain either of these, or you just want to set sequential number to a column.
    Below is some info about IDENTITY and UNIQUEIDENTIFIER you may already know since they are in SQLServer Book.
    IDENTITY property: You can define IDENTITY property on a numeric column. You can set the seed and increment on this column property very much like Oracle's sequence. The only thing I think it does not have is the "nextval". You can use IDENT_CURRENT function or @@IDENTITY after an INSERT or SELECT INTO to get the last value generated. Of course you can use this value and add the increment to get the next
    value but it not the same as seqname.nextval which keep incrementing each time you call it. Getting the current identity value and adding the increment your self will not work for multiple sessions with pending
    insert. Another thing about column with IDENTITY property is that you cannot insert value into this column (i.e, omit it in your insert statement values) unless IDENTITY_INSERT is on, but only one table in a
    session can have IDENTITY_INSERT to be turned on.
    If you don't need to know the next seq value, then IDENTITY work similar to Oracle sequence. Execute select after postchanges or commit will have system generated values. If you need to get next value before insert, Sung suggest using SEQ_TABLE and managing the next value (write a database function to mimic Oracle'
    s nextval).
    UNIQUEIDENTIFIER datatype: UNIQUEIDENTIFIER is a 16-byte hexadecimal number indicating a globally unique identifier (GUID). The GUID is useful when a row must be unique among many other rows. You could use NEWID() to create a value of type uniqueidentifier or calling some API function that returns a GUID. The advantage of using uniqueidentifier is that the values generated by NEWID function or application GUID are guaranteed to be unique throughout the world. The disadvantage of using uniqueidetifier is that it is long and obscure, random, difficult for user to remember or type correctly. It is 16 byte, which is large compare to other datatype such as 4-byte integer.
    Thanks,
    Yvonne

Maybe you are looking for

  • Delphi 3 or Delphi XE gives Invalid class string error

    I have Delphi 3 and a runtime error occurs when I RUN this project. No build errors... The form appears correctly and I put the path to the GroupWise domain directory : F:\opt\novell\groupwise\mail\dom1 I click on the CONNECT button and the error is

  • Soap messages

    Hello all, my code is: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE xml (View Source for full doctype...)> <xml rde-rd:content="spreadshirt2.xml" rde-rd:datalanguage="de" rde-rd:leasingtime="0" rde-rd:locale="de" rde-rd:project="testwebservicego

  • Verizon DSL/Router

    Hi! I'd really appreciate it very much if anyone out there could help me with the procedure/mechanics on setting up or creating a password to my Verizon dsl/router so that my neighbors would not be able to access the net using my dsl connection. I've

  • TIFF 6.0 baseline error

    Hi Pals,        I have an issue in uploading a TIFF image, its showing an error: No Baseline TIFF 6.0 when i tried to uplaod the image using SE78 Transaction text mode. Suggest me what can be done to fix this problem out. welcome for points. Thanks &

  • Unable to add music videos file to itune for my iphone

    Hi... I am unable to add music videos file to my iphone through itunes as i have added a file to library from the files menu of the itune 10 but still i am unable to have the music videos please help. Mp3 file are working very well but unable to add