Event_log - Duplicate insert aborted

I am analyzing the webcache event_log(verbose=YES) and find a
lot of messages referring to cached URLs saying "Duplicate
insert aborted." (se below)
log msg:
-- Insertion not done for ..myURL. Reason: Duplicate insert
aborted.
Does anyone have an explanation for this message ?
-Per Anders Jorgensen.

It means that there was a race condition between 2 or more
requests trying to insert the same document. Basically the
first one already inserted, and the msg is generated by the
subsequent insert attempts which are aborted. This is just
informational and does not mean that Web Cache is running
into errors.

Similar Messages

  • Prevent Duplicate Insertion of Record

    I am trying to acheive some thing like this but i beleive
    Insert Statement is not allowed in Case or Select is expecting some
    thing in return that is why it keeps on giving me Missing
    Expression . Is there any other way to prevent duplicate insertion
    . i know we can do it by running another Query and then based on
    recoundcount or count of that seperate query inserting records but
    that i dont want to do .
    SELECT CASE
    WHEN ( SELECT COUNT(*) FROM THACARA WHERE ORG_CNY_CD = 'US'
    AND ORG_REG_NR = '02' AND ORG_DIS_NR = '51') > 0
    THEN (' DUPLICATE EXSIST')
    ELSE (INSERT INTO THACARA ( USR_NR, ORG_FAC_LOC_NR, )
    values ( 'Yousaf', 'FLIMI'))
    END AS TEST FROM DUAL;
    any ideas ??

    It would be a lot better for everyone if you actually put a
    unique constraint on your table rather than all this programming
    (remember Oracle can have constraints). and preferably handle it in
    a proper procedure and not injection - note that the "Answer" in
    this thread does not actually return any information about whether
    the record was inserted or not, just the actual record (nor does it
    update the non-duplicate columns).
    BEGIN
    insert stuff
    return 'inserted'
    when DUP_VAL_ON_INDEX
    update other stuff not making up the unique columns
    return 'duplicate'
    END

  • Help needed to take care of Duplicate Inserts

    Hello,
    I have one insert operation that takes place making use of the following structure,
    INSERT INTO SOMETABLE (B, C, D)
    SELECT A.ID, A.NAME, A.SOMEOTHERID
    FROM TABLE1 A,
    TABLE2 B,
    TABLE3 C,
    CONTAINSTABLE(TABLE2, COLUMN1, @SEARCHTERM) KEY_TBL,
    WHERE A.MART_STATUS = 'SINGLE' AND
    A.SEX = 'MALE' AND
    C.ETHNICITY = 'SOMETHING' AND
    C.ETHNICITYID = A.PATIENT_ETHNICITYID AND
    A.ID= B.ID AND
    B.SOMEID= KEY_TBL.[KEY]
    Now as you can see, in the above query multiple records will be inserted into table SOMETABLE. Now I am facing the following problem, the above query is generated dynamically and is executed as EXEC @STATEMENT
    The table SOMETABLE has composite key (i.e Columns B, C and D are primary keys together). Now if I do a multiple records insert in the SOMETABLE, and if records already exists, then it throws an error and aborts. I want the remaining inserts to carry on either by filtering the duplicate records or doing something else.
    Can somebody please help me out with this. I facing an urgent issue which needs to taken care asap. Any help would be greatly appreciated. Thanks in advance!
    Edited by: user8633848 on Oct 10, 2009 9:32 PM

    user8633848 wrote:
    But I dont think I was rude in any of my sentences. I think it would be good on your part to server others by helping rather than just replying with your sentences. While you may have had no intention of being rude, I was merely stating that calling an issue "urgent" in a forum of volunteers is considered bad etiquette.
    And regarding the urgent issue, it is high priority one and that is the reason I am asking for help.If the issue is truly urgent and it needs to be solved now, you should investigate a paid support/consulting option. We, as a community of volunteers are in no way obligated to provide immediate support. However, we often try our best to help when we can.
    So first please correct your understanding of English and then reply!I believe I have a satisfactory understanding of the English language, especially since it is my first and only language.
    I would recommend that you read my original response again. It looks like the SQL you posted was something out of Microsoft SQL Server. I do not recognize any of the syntax as "Oracle SQL" syntax. Therefore my recommendation is to consult a Microsoft SQL Server forum.
    Thanks and have a wonderful night!

  • 'Best practice' for avoiding duplicate inserts?

    Just wondering if there's a 'best practice' approach for
    handling potential duplicate database inserts in CF. At the moment,
    I query the db first to work out if what I'm about to insert
    already exists. I figure I could also just send the SQL and catch
    the error, which would then tell me the data's already in there,
    but that seemed a bit dodgy to me. Which is the 'proper' way to
    handle this kind of thing?

    MrBonk wrote:
    > Just wondering if there's a 'best practice' approach for
    handling potential
    > duplicate database inserts in CF. At the moment, I query
    the db first to work
    > out if what I'm about to insert already exists. I figure
    I could also just
    > send the SQL and catch the error, which would then tell
    me the data's already
    > in there, but that seemed a bit dodgy to me. Which is
    the 'proper' way to
    > handle this kind of thing?
    i wouldn't consider letting the db handle this as "dodgy". if
    you're seeing the
    majority of inserts as "ok" then you're saving at least 1 db
    interaction per
    insert which can add up in high transaction environments.

  • Query help to eliminate duplicate inserts

    Hi
    I am inserting records using Insert and select statements. I am having composite primary key on client_id,begin_Dt,end_Dt and service_cd_desc on my target table.
    In order to eliminate duplicate composite key being inserted into the target table I am using NOT IN clause but some how I am error as
    ORA-00001: unique constraint violated (<schema>.<constraint>)
    query is as below:
    insert into stage_2_authorized_service
    (CLIENT_ID
    ,BEGIN_DT
    ,END_DT
    ,DHS_SERVICE_CD
    ,SERVICE_CD_DESC
    ,DHS_SERVICE_GROUP_CD
    ,SERVICE_GROUP_DESC
    ,AUTHORIZED_DOLLARS
    ,AUTHORIZED_UNITS
    ,DHS_AUTHORIZED_UNITS_TYPE_CD
    ,AUTHORIZED_UNITS_TYPE_DESC
    ,CONTRACT_NUMBER
    ,SERVICE_CD
    ,SERVICE_GROUP_CD
    SELECT DISTINCT
    stage_1.CLIENT_ID,
    stage_1.BEGIN_DT,
    stage_1.END_DT,
    stage_1.service_cd as dhs_service_cd,
    dim.service_cd_desc as service_cd_desc,
    stage_1.SERVICE_GROUP_CD as dhs_service_group_cd,
    decode(stage_1.SERVICE_GROUP_cd, '1','NURSING FACILITY','2', 'CLASS','3','CBA','4','STATE OPERATED ICF/MR CAMPUS','5','STATE OPERATED ICF/MR COMMUNITY','6','NON-STATE-OPERATED ICF/MR','7','Community Care','8','Hospice','9','LTC SUPPORT SERVICES (PROVIDER ENROLLMENT)','10','SWING BEDS (WAS PART OF NURSING FACILITY)','11','PACE','12','HCS','13','HCS-O','14','MRLA (MHMR NEW WAIVER)','15','TEXAS HOME LIVING (TxHmL)','16','Deaf Blind Waiver','17','Consolidated Waiver','18','Medically Dependent Children Program (MDCP)','19','STAR+PLUS') as service_group_desc,
    stage_1.AUTHORIZED_DOLLARS,
    stage_1.AUTHORIZED_UNITS,
    stage_1.UNIT_TYPE as DHS_AUTHORIZED_UNITS_TYPE_CD,
    decode(stage_1.UNIT_TYPE,'1','WEEK','2','MONTH','4','PER AUTHORIZATION','5','DAILY') as AUTHORIZED_UNITS_TYPE_DESC ,
    CONTRACT_NUMBER,
    stage_1.service_cd,
    stage_1.service_group_cd
    FROM
    STAGE_1_MG_SERVICE_REQUEST stage_1, stage_3_servcd_servgrp_dim dim
    where
    (stage_1.client_id,stage_1.begin_dt,stage_1.end_dt,dim.service_cd_desc) not in (select distinct stage_1.client_id,stage_1.begin_dt,stage_1.end_dt,dim.service_cd_desc
    from stage_1_mg_service_request stage_1, stage_3_servcd_servgrp_dim dim
    where stage_1.service_cd = dim.service_cd and
    stage_1.service_group_cd = dim.service_group_cd and
    stage_1.service_group_cd in ('2','3','16','17','18')
    Can some one tell me whats wrong with above query
    Any help is appreciated...!
    Thanks
    J

    Yes my target table doesn't have data init at all.Well that is not how you use not in to avoid unique constraint violations
    You need to select only the values that will not violate the constraint something like this untested example.
    select
        client_id,
        begin_dt,
        end_dt,
        service_cd_desc,
        dhs_service_cd,
        dhs_service_group_cd,
        service_group_desc,
        authorized_dollars,
        authorized_units,
        dhs_authorized_units_type_cd,
        authorized_units_type_desc,
        contract_number,
        service_cd,
        service_group_cd
    from
        SELECT    
        count(*) over (partition by
    stage_1.CLIENT_ID,
    stage_1.BEGIN_DT,
    stage_1.END_DT,
    dim.service_cd_desc) the_count,     
        stage_1.CLIENT_ID,
        stage_1.BEGIN_DT,
        stage_1.END_DT,
        stage_1.service_cd as dhs_service_cd,
        dim.service_cd_desc as service_cd_desc,
        stage_1.SERVICE_GROUP_CD as dhs_service_group_cd,
        decode(stage_1.SERVICE_GROUP_cd, '1','NURSING FACILITY','2', 'CLASS','3','CBA',
            '4','STATE OPERATED ICF/MR CAMPUS','5','STATE OPERATED ICF/MR COMMUNITY',
            '6','NON-STATE-OPERATED ICF/MR','7','Community Care','8','Hospice',
            '9','LTC SUPPORT SERVICES (PROVIDER ENROLLMENT)',
            '10','SWING BEDS (WAS PART OF NURSING FACILITY)','11','PACE','12','HCS',
            '13','HCS-O','14','MRLA (MHMR NEW WAIVER)','15','TEXAS HOME LIVING (TxHmL)',
            '16','Deaf Blind Waiver','17','Consolidated Waiver',
            '18','Medically Dependent Children Program (MDCP)','19','STAR+PLUS') as service_group_desc,
        stage_1.AUTHORIZED_DOLLARS,
        stage_1.AUTHORIZED_UNITS,
        stage_1.UNIT_TYPE as DHS_AUTHORIZED_UNITS_TYPE_CD,
        decode(stage_1.UNIT_TYPE,'1','WEEK','2','MONTH',
            '4','PER AUTHORIZATION','5','DAILY') as AUTHORIZED_UNITS_TYPE_DESC ,
        CONTRACT_NUMBER,
        stage_1.service_cd,
        stage_1.service_group_cd
        FROM
        STAGE_1_MG_SERVICE_REQUEST stage_1, stage_3_servcd_servgrp_dim dim
        where
        (stage_1.client_id,stage_1.begin_dt,stage_1.end_dt,dim.service_cd_desc) not in
        (select distinct stage_1.client_id,stage_1.begin_dt,stage_1.end_dt,dim.service_cd_desc
        from stage_1_mg_service_request stage_1, stage_3_servcd_servgrp_dim dim
        where stage_1.service_cd = dim.service_cd and
        stage_1.service_group_cd = dim.service_group_cd and
        stage_1.service_group_cd in ('2','3','16','17','18'))
    where the_count = 1;Link to a working example here
    Re: insert via insert into ....(select * from)....validtion of duplicate re

  • Duplicate insert into table

    hello all,
    i am having problem when insert data into table. my first value will insert into table once again and again when i refresh page or logged in as another person.
    is it because i am using JavaScript onChange on my page? here is my script..
    <html>
    <head>
    <title>Post New Offer</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" src="ts_picker.js"></script>
    </head>
    <body>
    <%@ page import ="java.sql.*" %>
    <%@ page import ="java.lang.*" %>
    <%@ page import ="java.util.*" %>
    <%@ page import ="java.io.*" %>
    <%@ page import ="java.text.SimpleDateFormat"%>
    <script language="JavaScript">
    function select_offer() {
    document.formoffer.submit();
    </script>
    <%!
    String username;
    String otype="";
    String submitform;
    String submitsave="";
    String bizid="";
    String contperson="";
    String ocategory="";
    String otitle="";
    String odesc="";
    String oposted="";
    String oexpiry="";
    String oprice;
    String ocheck="";
    String oqty;
    String ounit="";
    String oneeded="";
    String odelivery="";
    String opackaging="";
    String ostatus="";
    float price;
    int qty;
    int columns =0;
    int col =0;
    int vd =0;
    int columncate =0;
    int colcate =0;
    int rowcate =0;
    int vdcate=0;
    %>
    <jsp:useBean id="insertinto" class="ita.InsertNewOffer" scope="request" />
    <jsp:setProperty name="insertinto" property="*" />
    <% insertinto.connect();
    insertinto.setQueryInfo(username);
    col = insertinto.getColumn();
    Vector recordVector = insertinto.getVectorRow();
    insertinto.setQuery();
    colcate = insertinto.getColumn();
    rowcate = insertinto.getRow();
    Vector outVector = insertinto.getVectorRow();
    %>
    <!-- Header Menu -->
    <%@ include file="headermenu.jsp"%>
    <hr size="1">
    <br>
    <table width="100%" border="0">
    <tr>
    <td width="23%"><div align="right"><font size="2" face="Arial, Helvetica,
    sans-serif">Post by <b><% out.println(username); %></b></font></div>
    </td>
    </tr>
    </table>
    <!-- Left Menu -->
    <%@ include file="leftmenu.jsp"%>
    <%
    submitform = request.getParameter("submitform");
    if((submitform != null) && (submitform.equals("Post Offer")) && (!(otype.equals("none"))) && (!(bizid.equals(""))))
    ostatus = "posted";
    if((submitform != null) && (submitform.equals("Save Offer")) && (!(otype.equals("none"))) && (!(bizid.equals(""))))
    ostatus = "saved";
    bizid = request.getParameter("bizid"); if (bizid == null) { bizid = ""; }
    bizid = bizid.trim();
    otype = request.getParameter("otype"); if (otype == null) { otype = "none"; }
    ocategory = request.getParameter("ocategory"); if (ocategory == null) { ocategory = ""; }
    String cat="";
    String[] cat2 = request.getParameterValues("ocategory");
    if (cat2 != null)
    for(int i=0;i<cat2.length;i++) {
    cat += cat2[i] +";";
    //out.println("choose1 : "+cat2+"<br>");
    //out.println("choose2 : "+cat2[i]+"<br>");
    //out.println("choose3 : "+cat+"<br>");
    otitle = request.getParameter("otitle"); if (otitle == null) { otitle = ""; }
    odesc = request.getParameter("odesc"); if (odesc == null) { odesc = ""; }
    oposted = request.getParameter("oposted");
    oexpiry = request.getParameter("oexpiry");
    oexpiry = oexpiry.trim();
    oprice = request.getParameter("oprice");
    float price = 0;
    if (oprice != null) {
    try {
    price = Float.parseFloat(oprice);
    catch(NumberFormatException e) {}
    oqty = request.getParameter("oqty");
    int qty = 0;
    if (oqty != null) {
    try {
    qty = Integer.parseInt(oqty);
    catch(NumberFormatException e) {}
    ocheck = request.getParameter("ocheck"); if (ocheck == null) { ocheck = "no"; }
    ounit = request.getParameter("ounit"); if (ounit == null) { ounit = "none"; }
    oneeded = request.getParameter("oneeded"); if (oneeded == null) { oneeded = ""; }
    odelivery = request.getParameter("odelivery"); if (odelivery == null) { odelivery = ""; }
    opackaging = request.getParameter("opackaging"); if (opackaging == null) { opackaging = ""; }
    contperson = request.getParameter("contperson"); if (contperson == null) { contperson = ""; }
    contperson = contperson.trim();
    insertinto.InsertNew(bizid,otype,cat,otitle,odesc,oposted,oexpiry,price,ocheck,qty,ounit,oneeded,odelivery,opackaging,ostatus,contperson);
    insertinto.disconnect();
    %>
    <td width="77%">
    <form name="formoffer" method="post" action="NewOffer.jsp?username=<% out.println(username);%> ">
    <table width="100%" border="0" cellpadding="2">
    <tr>
    <td width="77%">
    <table width="100%" border="0">
    <tr>
    <td><font size="5" face="Arial, Helvetica, sans-serif">My Offer</font></td>
    </tr>
    <tr bgcolor="#FFCC00">
    <td colspan="3"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <b>1) Offer Detail</b></font> </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Offer
    date :</font></td>
    <td width="61%" colspan="2"><font color="#336600" size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <%= new java.util.Date() %></font>
    <input type="hidden" name="oposted" value="<%= dateString %>"> </td>
    </tr>
    <tr>
    <td width="39%" valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Offer
    type :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="otype" onChange="select_offer()">
         <%
         if (otype.equals("")||otype.equals("none")) { %>
    <option selected value="none">Select one</option>
    <option value="Buy">Buy</option>
         <option value="Sell">Sell</option>
         <option value="Biz Opportunity">Biz Op</option>
    <option value="Excess Stock">Excess Stock</option>
         <% }
    else if (otype.equals("Buy")) { %>
    <option value="none">Select one</option>
    <option selected value="Buy">Buy</option>
         <option value="Sell">Sell</option>
         <option value="Biz Opportunity">Biz Op</option>
    <option value="Excess Stock">Excess Stock</option>
         <% }
    else if (otype.equals("Sell")) { %>
    <option value="none">Select one</option>
    <option value="Buy">Buy</option>
         <option selected value="Sell">Sell</option>
         <option value="Biz Opportunity">Biz Op</option>
    <option value="Excess Stock">Excess Stock</option>
         <% }
    else if (otype.equals("Biz Opportunity")) { %>
    <option value="none">Select one</option>
    <option value="Buy">Buy</option>
         <option value="Sell">Sell</option>
         <option selected value="Biz Opportunity">Biz Op</option>
    <option value="Excess Stock">Excess Stock</option>
         <% }
    else if (otype.equals("Excess Stock")) { %>
    <option value="none">Select one</option>
    <option value="Buy">Buy</option>
         <option value="Sell">Sell</option>
         <option value="Biz Opportunity">Biz Op</option>
    <option selected value="Excess Stock">Excess Stock</option>
         <% } %>
    </select>
    </font> </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Category
    : </font></td>
    <td colspan="2">
    <% vdcate=0; %>
    <select name="ocategory" size="4" multiple>
    <% while (vdcate<outVector.size()) {
    for (int j=0; j<colcate; j++) {
    if (j==0) {
    String catid = (String)outVector.elementAt(vdcate) ;
    String mainlevel = (String)outVector.elementAt(vdcate+1) ;
    String level1 = (String)outVector.elementAt(vdcate+2) ;
    String level2 = (String)outVector.elementAt(vdcate+3) ;%>
    <option value=<% out.println(catid); %> >
    <% out.println(mainlevel); %>  - 
              <% out.println(level1); %>  - 
              <% out.println(level2); %>
    <% }
    if (j > 0) {}
    vdcate++;
    } %>
    </option>
    </select>
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Title
    :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="otitle" type="text" size="35">
    </font> </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Offer
    description :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <textarea name="odesc" cols="30"></textarea>
    </font> </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Expiry date :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input type="Text" name="oexpiry" readOnly style="BACKGROUND-COLOR: #eeeeee">
    <img src="img/cal.gif" width="16" height="16" border="0" alt="Click to select date">
    </font>
    </td>
    </tr>
    <%
    System.out.println("display form" +otype);
    if (otype.equals("Buy")) { %>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    Target price : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">RM
    <input name="oprice" type="text" size="7">
    <input type="checkbox" name="ocheck" value="yes">
    <font color="#FF0000">*<font color="#000000" size="1">Negotiable</font></font></font>
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Minimum
    quantity :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="oqty" type="text" size="10">
    <select name="ounit" size="1">
    <option selected value="none">Choose one</option>
    <option>Kg</option>
    <option>Pack</option>
    <option>Ton</option>
    <option>Boxes</option>
    <option>Carton</option>
    </select>
    </font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">When
    needed / Supply period :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="oneeded">
    <option selected value="none">Select one</option>
    <option>Daily</option>
    <option>1 week</option>
    <option>2 weeks</option>
    <option>1 month</option>
    <option>2 months</option>
    <option>3 months</option>
    <option>6 months</option>
    </select>
    </font></td>
    </tr>
    <% } %>
    <%
    if (otype.equals("Sell")) { %>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Delivery
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="odelivery" size="1">
    <option selected value="none">Choose one</option>
    <option>Own transport</option>
         </select>
    </font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Packaging
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="opackaging" size="1">
    <option selected value="none">Choose one</option>
    <option>Included</option>
    <option>Not included</option>
         </select>
    </font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    Selling price : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">RM
    <input name="oprice" type="text" size="7">
    <input type="checkbox" name="ocheck" value="yes">
    <font color="#FF0000">*<font color="#000000" size="1">Negotiable</font></font></font>
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Available
    quantity :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="oqty" type="text" size="10">
    <select name="ounit" size="1">
    <option selected value="none">Choose one</option>
    <option>Kg</option>
    <option>Pack</option>
    <option>Ton</option>
    <option>Boxes</option>
    <option>Carton</option>
    </select>
    </font></td>
    </tr>
    <% } %>
    <%
    if (otype.equals("Excess Stock")) { %>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Delivery
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="odelivery" size="1">
    <option selected value="none">Choose one</option>
    <option>Own transport</option>
         </select>
    </font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Packaging
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="opackaging" size="1">
    <option selected value="none">Choose one</option>
    <option>Included</option>
    <option>Not included</option>
         </select>
    </font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    Offer price : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">RM
    <input name="oprice" type="text" size="7">
    <input type="checkbox" name="ocheck" value="yes">
    <font color="#FF0000">*<font color="#000000" size="1">Negotiable</font></font></font>
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Available
    quantity :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="oqty" type="text" size="10">
    <select name="ounit" size="1">
    <option selected value="none">Choose one</option>
    <option>Kg</option>
    <option>Pack</option>
    <option>Ton</option>
    <option>Boxes</option>
    <option>Carton</option>
    </select>
    </font></td>
    </tr>
    <% } %>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
    </tr>
    <% vd=0; %>
    <% for (int vd=0; vd<col; vd++) {  %>
    <tr bgcolor="#FFCC00">
    <td colspan="3" valign="top"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>2)
    Contact Information</b></font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Business
    ID : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <% String bizid = (String)recordVector.elementAt(vd); vd++; %>
    <% out.println(bizid); %></font>
    <input type="hidden" name="bizid" value="<% out.println(bizid); %>">
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Contact person : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <% String conttitle = (String)recordVector.elementAt(vd); vd++; %>
    <% String contperson = (String)recordVector.elementAt(vd); vd++; %>
    <% out.println(conttitle);
    out.println( contperson);%>
    <input type="hidden" name="contperson" value="<% out.println(contperson); %>"></font></td></tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Company name :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <% out.println(recordVector.elementAt(vd));vd++; %></font>
    </td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Address
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
         <% out.println(recordVector.elementAt(vd));vd++; %>,
    <% out.println(recordVector.elementAt(vd));vd++; %>, 
    <% out.println(recordVector.elementAt(vd));vd++; %>
    <% out.println(recordVector.elementAt(vd));vd++; %></font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Telephone
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
         <% out.println(recordVector.elementAt(vd));vd++; %></font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Mobile phone
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
         <% out.println(recordVector.elementAt(vd));vd++; %></font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Fax
    :</font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <% out.println(recordVector.elementAt(vd));vd++; %></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <a href ="mailto:<% out.println(username);%>@b2bxchange.com.my">
    <% out.println(username);%>@b2bxchange.com.my</a></font></td>
    </tr>
    <tr>
    <td valign="top"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Website
    : </font></td>
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <% String website = (String)recordVector.elementAt(vd); vd++; %>
    <a href="<% out.println(website); %>"><% out.println(website); %></a></font></td>
    </tr>
    <tr>
    <td colspan="3"><font face="Arial, Helvetica, sans-serif"> </font></td>
    </tr>
    <tr>
    <td colspan="3"><div align="center"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input type="submit" name="submitform" value="Post Offer"> 
    <input type="submit" name="submitform" value="Save Offer"> 
    <input type="reset" name="resetform" value="Reset">
    </font></div></td>
    </tr>
    </table>
    </form>
    </td></tr>
    <% } %>
    <% vd=0; %>
    </table>
    </body>
    </html>

    I'm not going to try to read all your code, but I will take your hint about the "onChange".
    What I would suggest is that you set a boolean variable, such as "changed", set to false at the beginning (perhaps in the "onLoad" event). Your "onChange" event can simply change the "changed" variable to true. Then, when the user leaves the page, or clicks Submit or whatever, test that variable to see if any changes were made, then take the appropriate action.

  • Avoid duplicate inserts using SQL statement?

    I have primary key on three columns and I want to write a sql statement to insert a row only if the matching three columns doesn't exist in the database.
    This is the condition I wrote but doesn't work. Could someone suggest me a query which meets this criteria.
    INSERT INTO JAVA_SERVICES (SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME,
      ROOT_PATH)
      VALUES ('AAAA', 'BBBB', 'CCCC', 'njdex') WHERE SERVICE_PAGE != 'AAAA' AND SERVICE_TYPE != 'BBBB' AND SERVICE_NAME != 'CCCC'Edited by: user626618 on Jun 12, 2009 2:39 PM

    you need to provide us more details such as what table name and column names are you using. using an insert into statement an example would be like:
    insert into java_services
    (service_page, service_type, service_name, root_path)
    select [column name], [column name], [column name]
      from [table name]
    where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                   from JAVA_SERVICES);
    begin
      for i in (select [column name] col1, [column name] col2, [column name] col3
                  from [table name]
                 where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                    from JAVA_SERVICES)) loop
        insert into java_services
          (service_page, service_type, service_name, root_path)
        values
          (i.col1, i.col2, i.col3);
      end loop;
    end;
    /

  • Preventing Duplicate inserts

    In my trivial example below I have a Nationality entity. The entity just has the code and Name attributes, with the code being an automatically generated Integer.
    Im inserting one record and then trying to prevent the same record being inserted, by setting the ImportType to 1:
    truncate table [stg].[Nationality_1_Leaf]
    insert into [stg].[Nationality_1_Leaf](importType, ImportStatus_id, BatchTag, Name)
    values(1, 0, 'some batch' , 'American' )
    select * From [stg].[Nationality_1_Leaf]
    exec stg.udp_Nationality_1_Leaf 'VERSION_1', 1, 'some batch'
    After this I truncate the staging table and repeat the process. Unfortunately a new record is entered into the Entity even though the name is identical to a record that already exists.
    Can anyone explain what im doing wrong here?

    In MDS only the Code attribute has to be unique.  You can create a business rule to enforce uniqueness of other attributes, but business rules will not prevent data loading. 
    If you use the Name for Code, then this will just work.
    Alternatively you can look at the subscription view for your target entity to for any entities that match by name, and either not load that row, or get the Code value so you can perform an update.
    David
    David http://blogs.msdn.com/b/dbrowne/
    when you say "you can look at the subscription view for your target entity to for any entities that match by name, and either not load that row", does this mean that in SSIS I would  do a lookup against the subscription view and act accordingly
    if the row already exists?

  • Checking for duplicate primary keys on row inserts

    Checking for duplicate primary keys on row inserts
    I have a situation where I will be making bulk table inserts knowing that the primary key value will in some cases already exist. In this is the case I simply want to ignore the duplicate inserts.
    Should I be performing a sub-query on the table and using a statement like:
    where not exist in
    Or is there a cleaner way of discarding or checking for duplicates on insert.
    My concerns were mainly one of performance, as my routine will be inserting a few thousand rows in its operation.

    The MERGE commnad is a good option when a large percentage of the data will exist in the target because it is much more efficient to attempt to update then insert when the update affects zero rows than capture an error and convert it to an update.
    However, since in this case it would appear that only a few rows will alreadys exist and we want to ignore the duplicates when they exist then
    begin
    insert
    exception
    when dup_value_in_index then null;
    end
    would be the way to code this one. The bulk insert version has in 9.2 the ability to store the errors so that they can all be handled at once which means the rest of the array insert can work.
    HTH -- Mark D Powell --

  • How to insert multiple rows in a single insert statement in MaxDB?

    hi,
    I was looking at syntax but i could not get it right.. may be some could help me.
    // Insert single row works fine
    INSET INTO test_table(column_name) values (value1) IGNORE DUPLICATES
    // Insert multiple rows, doesn't
    INSET INTO test_table(column_name) values (value1), (value2), (value3) IGNORE DUPLICATES
    Can somebody help me with this.
    thanks,
    sudhir.

    Multiple inserts do only work with parametrized statements, usually used in interfaces like JDBC, ODBC etc.
    With static SQL statements it is not possible.
    Regards Thomas

  • Insert peoblem

    i created a 3 multi page form using sessions to pass form data from page to page, On the final page i used the inser record wizard to insert all data into the database. all other fied were inserted except the date column. when i change the the date coulum datatype to vacar, the date shows...but when i change it to date data type nothing displays except "00-00-0000". below is my code.pls note the date field as that is where my problem is. how should my form date field insert the date in the databse date column. pls  help thanks
    my code:
    PAGE 1
    <?php require_once('Connections/crusader.php'); ?>
    <?php
    //MX Widgets3 include
    require_once('includes/wdg/WDG.php');
    // Load the common classes
    require_once('includes/common/KT_common.php');
    // Load the tNG classes
    require_once('includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("");
    // Make unified connection variable
    $conn_crusader = new KT_connection($crusader, $database_crusader);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $formValidation->addField("cap_firstname", true, "text", "", "", "", "");
    $formValidation->addField("cap_lastname", true, "text", "", "", "", "");
    $formValidation->addField("cap_corrAdd", true, "text", "", "", "", "");
    $formValidation->addField("cap_email", true, "text", "email", "", "", "");
    $formValidation->addField("cap_mobilephone", true, "text", "phone", "", "", "");
    $formValidation->addField("cap_occupation", true, "text", "", "", "", "");
    $tNGs->prepareValidation($formValidation);
    // End trigger
    //start Trigger_Custom trigger
    function Trigger_Custom(&$tNG) {
    session_start();
    $_SESSION['form']['cap_title'] = $tNG->getColumnValue("cap_title");
    $_SESSION['form']['cap_firstname'] = $tNG->getColumnValue("cap_firstname");
    $_SESSION['form']['cap_lastname'] = $tNG->getColumnValue("cap_lastname");
    $_SESSION['form']['cap_dateofbirth'] = $tNG->getColumnValue("cap_dateofbirth");
    $_SESSION['form']['cap_sex'] = $tNG->getColumnValue("cap_sex");
    $_SESSION['form']['cap_marital'] = $tNG->getColumnValue("cap_marital");
    $_SESSION['form']['cap_corrAdd'] = $tNG->getColumnValue("cap_corrAdd");
    $_SESSION['form']['cap_email'] = $tNG->getColumnValue("cap_email");
    $_SESSION['form']['cap_mobilephone'] = $tNG->getColumnValue("cap_mobilephone");
    $_SESSION['form']['cap_occupation'] = $tNG->getColumnValue("cap_occupation");
    //end Trigger_Custom trigger
    // Make a custom transaction instance
    $customTransaction = new tNG_custom($conn_crusader);
    $tNGs->addTransaction($customTransaction);
    // Register triggers
    $customTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1");
    $customTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $customTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "cap2.php");
    $customTransaction->registerTrigger("AFTER", "Trigger_Custom", 50);
    // Add columns
    $customTransaction->addColumn("cap_title", "STRING_TYPE", "POST", "cap_title");
    $customTransaction->addColumn("cap_firstname", "STRING_TYPE", "POST", "cap_firstname");
    $customTransaction->addColumn("cap_lastname", "STRING_TYPE", "POST", "cap_lastname");
    $customTransaction->addColumn("cap_dateofbirth", "DATE_TYPE", "POST", "cap_dateofbirth", "{NOW}");
    $customTransaction->addColumn("cap_sex", "STRING_TYPE", "POST", "cap_sex");
    $customTransaction->addColumn("cap_marital", "STRING_TYPE", "POST", "cap_marital");
    $customTransaction->addColumn("cap_corrAdd", "STRING_TYPE", "POST", "cap_corrAdd");
    $customTransaction->addColumn("cap_email", "STRING_TYPE", "POST", "cap_email");
    $customTransaction->addColumn("cap_mobilephone", "STRING_TYPE", "POST", "cap_mobilephone");
    $customTransaction->addColumn("cap_occupation", "STRING_TYPE", "POST", "cap_occupation");
    // End of custom transaction instance
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rscustom = $tNGs->getRecordset("custom");
    $row_rscustom = mysql_fetch_assoc($rscustom);
    $totalRows_rscustom = mysql_num_rows($rscustom);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link rel="stylesheet" href="dhtmlwindow.css" type="text/css" />
    <script type="text/javascript" src="dhtmlwindow.js">
    </script>
    <link rel="stylesheet" href="modalfiles/modal.css" type="text/css" />
    <script type="text/javascript" src="modalfiles/modal.js"></script>
    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <?php echo $tNGs->displayValidationRules();?>
    <style type="text/css">
    <!--
    body,td,th {
        font-family: Verdana, Geneva, sans-serif;
        font-size: 11px;
        font-weight: bold;
    -->
    </style>
    <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
    <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
    <script src="includes/resources/calendar.js"></script>
    <script>
    var mysurvey=dhtmlmodal.open("surveybox", "iframe", "agreement.htm", "", "width=300px,height=250px,resize=1,scrolling=1,center=1", "recal")
    mysurvey.onclose=function(){
    var iframedoc=this.contentDoc
    alert(iframedoc.body.innerHTML) //alert entire body content of iframe
    alert(iframedoc.getElementById("myname").value) //alert value of form field with id="myname"
    </script>
    </head>
    <body topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
    <table width="327" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="325" valign="top"><form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
          <table align="center" cellpadding="2" cellspacing="0" class="KT_tngtable">
              <tr bgcolor="#990000">
                <td colspan="2" bgcolor="#990000"><span class="white">Step 1: Get Started </span></td>
              </tr>
              <tr>
                <td width="134" class="KT_th"><label for="cap_title">Title:</label></td>
                <td width="200"><select name="cap_title" id="cap_title">
                  <option value="Mr" <?php if (!(strcmp("Mr", KT_escapeAttribute($row_rscustom['cap_title'])))) {echo "SELECTED";} ?>>Mr</option>
                  <option value="Mrs" <?php if (!(strcmp("Mrs", KT_escapeAttribute($row_rscustom['cap_title'])))) {echo "SELECTED";} ?>>Mrs</option>
                  <option value="Chief" <?php if (!(strcmp("Chief", KT_escapeAttribute($row_rscustom['cap_title'])))) {echo "SELECTED";} ?>>Chief</option>
                  <option value="Alhaji" <?php if (!(strcmp("Alhaji", KT_escapeAttribute($row_rscustom['cap_title'])))) {echo "SELECTED";} ?>>Alhaji</option>
                </select>
                  <?php echo $tNGs->displayFieldError("custom", "cap_title"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_firstname">First Name:</label></td>
                <td><input type="text" name="cap_firstname" id="cap_firstname" value="<?php echo KT_escapeAttribute($row_rscustom['cap_firstname']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_firstname");?> <?php echo $tNGs->displayFieldError("custom", "cap_firstname"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_lastname">Last Name:</label></td>
                <td><input type="text" name="cap_lastname" id="cap_lastname" value="<?php echo KT_escapeAttribute($row_rscustom['cap_lastname']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_lastname");?> <?php echo $tNGs->displayFieldError("custom", "cap_lastname"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_dateofbirth">Date of Birth:</label></td>
                <td><input name="cap_dateofbirth" id="cap_dateofbirth" value="<?php echo KT_escapeAttribute($row_rscustom['cap_dateofbirth']); ?>" size="24" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="no" />
                <?php echo $tNGs->displayFieldHint("cap_dateofbirth");?> <?php echo $tNGs->displayFieldError("custom", "cap_dateofbirth"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_sex_1">Sex:</label></td>
                <td><div>
                  <input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['cap_sex']),"Male"))) {echo "@@checked@@";} ?> type="radio" name="cap_sex" id="cap_sex_1" value="Male" />
                  <label for="cap_sex_1">Male</label>
                    <input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['cap_sex']),"Female"))) {echo "@@checked@@";} ?> type="radio" name="cap_sex" id="cap_sex_2" value="Female" />
                    <label for="cap_sex_2">Female</label>
                    <?php echo $tNGs->displayFieldError("custom", "cap_sex"); ?></div>
                  <div></div></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_marital">Marital Status:</label></td>
                <td><select name="cap_marital" id="cap_marital">
                  <option value="Single" <?php if (!(strcmp("Single", KT_escapeAttribute($row_rscustom['cap_marital'])))) {echo "SELECTED";} ?>>Single</option>
                  <option value="Married" <?php if (!(strcmp("Married", KT_escapeAttribute($row_rscustom['cap_marital'])))) {echo "SELECTED";} ?>>Married</option>
                  <option value="Divorced" <?php if (!(strcmp("Divorced", KT_escapeAttribute($row_rscustom['cap_marital'])))) {echo "SELECTED";} ?>>Divorced</option>
                </select>
                  <?php echo $tNGs->displayFieldError("custom", "cap_marital"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_corrAdd">Correspondence Address:</label></td>
                <td><textarea name="cap_corrAdd" id="cap_corrAdd" cols="20" rows="3"><?php echo KT_escapeAttribute($row_rscustom['cap_corrAdd']); ?></textarea>
                  <?php echo $tNGs->displayFieldHint("cap_corrAdd");?> <?php echo $tNGs->displayFieldError("custom", "cap_corrAdd"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_email">Email Address:</label></td>
                <td><input type="text" name="cap_email" id="cap_email" value="<?php echo KT_escapeAttribute($row_rscustom['cap_email']); ?>" size="32" />              <?php echo $tNGs->displayFieldError("custom", "cap_email"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_mobilephone">Mobile Phone:</label></td>
                <td><input type="text" name="cap_mobilephone" id="cap_mobilephone" value="<?php echo KT_escapeAttribute($row_rscustom['cap_mobilephone']); ?>" size="32" />              <?php echo $tNGs->displayFieldError("custom", "cap_mobilephone"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_occupation">Occupation:</label></td>
                <td><input type="text" name="cap_occupation" id="cap_occupation" value="<?php echo KT_escapeAttribute($row_rscustom['cap_occupation']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_occupation");?> <?php echo $tNGs->displayFieldError("custom", "cap_occupation"); ?></td>
              </tr>
              <tr class="KT_buttons">
                <td colspan="2"><input type="submit" name="KT_Custom1" id="KT_Custom1" value="Continue&gt;&gt;" /></td>
              </tr>
            </table>
          </form></td>
      </tr>
    </table>
    <?php
        echo $tNGs->getErrorMsg();
    ?>
    </body>
    </html>
    PAGE 2
    <?php require_once('Connections/crusader.php'); ?>
    <?php
    //MX Widgets3 include
    require_once('includes/wdg/WDG.php');
    // Load the common classes
    require_once('includes/common/KT_common.php');
    // Load the tNG classes
    require_once('includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("");
    // Make unified connection variable
    $conn_crusader = new KT_connection($crusader, $database_crusader);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $tNGs->prepareValidation($formValidation);
    // End trigger
    //start Trigger_Custom trigger
    function Trigger_Custom(&$tNG) {
    session_start();
    $_SESSION['form']['cap_sumassured'] = $tNG->getColumnValue("cap_sumassured");
    $_SESSION['form']['cap_policyterm'] = $tNG->getColumnValue("cap_policyterm");
    $_SESSION['form']['cap_commdate'] = $tNG->getColumnValue("cap_commdate");
    $_SESSION['form']['cap_premium'] = $tNG->getColumnValue("cap_premium");
    $_SESSION['form']['cap_frequencyp'] = $tNG->getColumnValue("cap_frequencyp");
    $_SESSION['form']['cap_modep'] = $tNG->getColumnValue("cap_modep");
    $_SESSION['form']['cap_targetamount'] = $tNG->getColumnValue("cap_targetamount");
    $_SESSION['form']['cap_livecover'] = $tNG->getColumnValue("cap_livecover");
    $_SESSION['form']['cap_regularsavings'] = $tNG->getColumnValue("cap_regularsavings");
    $_SESSION['form']['cap_benefit'] = $tNG->getColumnValue("cap_benefit");
    $_SESSION['form']['cap_lifepolicy'] = $tNG->getColumnValue("cap_lifepolicy");
    $_SESSION['form']['cap_nameinsurer'] = $tNG->getColumnValue("cap_nameinsurer");
    $_SESSION['form']['cap_totalsumassured'] = $tNG->getColumnValue("cap_totalsumassured");
    $_SESSION['form']['cap_specialpolicy'] = $tNG->getColumnValue("cap_specialpolicy");
    //end Trigger_Custom trigger
    // Make a custom transaction instance
    $customTransaction = new tNG_custom($conn_crusader);
    $tNGs->addTransaction($customTransaction);
    // Register triggers
    $customTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Custom1");
    $customTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $customTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "cap3.php");
    $customTransaction->registerTrigger("AFTER", "Trigger_Custom", 50);
    // Add columns
    $customTransaction->addColumn("cap_sumassured", "STRING_TYPE", "POST", "cap_sumassured");
    $customTransaction->addColumn("cap_policyterm", "STRING_TYPE", "POST", "cap_policyterm");
    $customTransaction->addColumn("cap_commdate", "DATE_TYPE", "POST", "cap_commdate");
    $customTransaction->addColumn("cap_premium", "STRING_TYPE", "POST", "cap_premium");
    $customTransaction->addColumn("cap_frequencyp", "STRING_TYPE", "POST", "cap_frequencyp");
    $customTransaction->addColumn("cap_modep", "STRING_TYPE", "POST", "cap_modep");
    $customTransaction->addColumn("cap_targetamount", "STRING_TYPE", "POST", "cap_targetamount");
    $customTransaction->addColumn("cap_livecover", "STRING_TYPE", "POST", "cap_livecover");
    $customTransaction->addColumn("cap_regularsavings", "STRING_TYPE", "POST", "cap_regularsavings");
    $customTransaction->addColumn("cap_benefit", "STRING_TYPE", "POST", "cap_benefit");
    $customTransaction->addColumn("cap_lifepolicy", "STRING_TYPE", "POST", "cap_lifepolicy");
    $customTransaction->addColumn("cap_nameinsurer", "STRING_TYPE", "POST", "cap_nameinsurer");
    $customTransaction->addColumn("cap_totalsumassured", "STRING_TYPE", "POST", "cap_totalsumassured");
    $customTransaction->addColumn("cap_specialpolicy", "STRING_TYPE", "POST", "cap_specialpolicy");
    // End of custom transaction instance
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rscustom = $tNGs->getRecordset("custom");
    $row_rscustom = mysql_fetch_assoc($rscustom);
    $totalRows_rscustom = mysql_num_rows($rscustom);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <?php echo $tNGs->displayValidationRules();?>
    <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
    <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
    <script src="includes/resources/calendar.js"></script>
    </head>
    <body topmargin="0" leftmargin="0" bottommargin="0">
    <table width="348" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="346" height="406" valign="top"><form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
            <table align="center" cellpadding="2" cellspacing="0" class="KT_tngtable">
              <tr>
                <td colspan="2" bgcolor="#990000"><span class="white">Step 2: </span></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_sumassured">Sum Assured:</label></td>
                <td><input type="text" name="cap_sumassured" id="cap_sumassured" value="<?php echo KT_escapeAttribute($row_rscustom['cap_sumassured']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_sumassured");?> <?php echo $tNGs->displayFieldError("custom", "cap_sumassured"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_policyterm">Policy Term:</label></td>
                <td><input type="text" name="cap_policyterm" id="cap_policyterm" value="<?php echo KT_escapeAttribute($row_rscustom['cap_policyterm']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_policyterm");?> <?php echo $tNGs->displayFieldError("custom", "cap_policyterm"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_commdate">Commencement Date:</label></td>
                <td><input name="cap_commdate" id="cap_commdate" value="<?php echo KT_escapeAttribute($row_rscustom['cap_commdate']); ?>" size="24" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="no" />
                  <?php echo $tNGs->displayFieldHint("cap_commdate");?> <?php echo $tNGs->displayFieldError("custom", "cap_commdate"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_premium">Premium:</label></td>
                <td><input type="text" name="cap_premium" id="cap_premium" value="<?php echo KT_escapeAttribute($row_rscustom['cap_premium']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_premium");?> <?php echo $tNGs->displayFieldError("custom", "cap_premium"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_frequencyp">Frequency of premium payment:</label></td>
                <td><select name="cap_frequencyp" id="cap_frequencyp">
                  <option value="Annual" <?php if (!(strcmp("Annual", KT_escapeAttribute($row_rscustom['cap_frequencyp'])))) {echo "SELECTED";} ?>>Annual</option>
                  <option value="Bi-Annual" <?php if (!(strcmp("Bi-Annual", KT_escapeAttribute($row_rscustom['cap_frequencyp'])))) {echo "SELECTED";} ?>>Bi-Annual</option>
                  <option value="Quaterly" <?php if (!(strcmp("Quaterly", KT_escapeAttribute($row_rscustom['cap_frequencyp'])))) {echo "SELECTED";} ?>>Quaterly</option>
                  <option value="Monthly" <?php if (!(strcmp("Monthly", KT_escapeAttribute($row_rscustom['cap_frequencyp'])))) {echo "SELECTED";} ?>>Monthly</option>
                  <option value="Single" <?php if (!(strcmp("Single", KT_escapeAttribute($row_rscustom['cap_frequencyp'])))) {echo "SELECTED";} ?>>Single</option>
                </select>
                  <?php echo $tNGs->displayFieldError("custom", "cap_frequencyp"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_modep">Mode of payment:</label></td>
                <td><select name="cap_modep" id="cap_modep">
                  <option value="Direct Debit" <?php if (!(strcmp("Direct Debit", KT_escapeAttribute($row_rscustom['cap_modep'])))) {echo "SELECTED";} ?>>Direct Debit</option>
                  <option value="Cash" <?php if (!(strcmp("Cash", KT_escapeAttribute($row_rscustom['cap_modep'])))) {echo "SELECTED";} ?>>Cash</option>
                  <option value="Cheque" <?php if (!(strcmp("Cheque", KT_escapeAttribute($row_rscustom['cap_modep'])))) {echo "SELECTED";} ?>>Cheque</option>
                </select>
                  <?php echo $tNGs->displayFieldError("custom", "cap_modep"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_targetamount">Target Amount:</label></td>
                <td><input type="text" name="cap_targetamount" id="cap_targetamount" value="<?php echo KT_escapeAttribute($row_rscustom['cap_targetamount']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_targetamount");?> <?php echo $tNGs->displayFieldError("custom", "cap_targetamount"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_livecover">Live cover Amount:</label></td>
                <td><input type="text" name="cap_livecover" id="cap_livecover" value="<?php echo KT_escapeAttribute($row_rscustom['cap_livecover']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_livecover");?> <?php echo $tNGs->displayFieldError("custom", "cap_livecover"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_regularsavings">Amount of regular savings proposed:</label></td>
                <td><input type="text" name="cap_regularsavings" id="cap_regularsavings" value="<?php echo KT_escapeAttribute($row_rscustom['cap_regularsavings']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_regularsavings");?> <?php echo $tNGs->displayFieldError("custom", "cap_regularsavings"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_benefit">Nominated Bnefitiaries:</label></td>
                <td><textarea name="cap_benefit" id="cap_benefit" cols="20" rows="3"><?php echo KT_escapeAttribute($row_rscustom['cap_benefit']); ?></textarea>
                  <?php echo $tNGs->displayFieldHint("cap_benefit");?> <?php echo $tNGs->displayFieldError("custom", "cap_benefit"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_livepolicy">Do you have life assurance policy/ policies:</label></td>
                <td><input type="text" name="cap_livepolicy" id="cap_livepolicy" value="<?php echo KT_escapeAttribute($row_rscustom['cap_livepolicy']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_livepolicy");?> <?php echo $tNGs->displayFieldError("custom", "cap_livepolicy"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_nameinsurer">If yes , name of insurer:</label></td>
                <td><input type="text" name="cap_nameinsurer" id="cap_nameinsurer" value="<?php echo KT_escapeAttribute($row_rscustom['cap_nameinsurer']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_nameinsurer");?> <?php echo $tNGs->displayFieldError("custom", "cap_nameinsurer"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_totalsumassured">Total sum assured:</label></td>
                <td><input type="text" name="cap_totalsumassured" id="cap_totalsumassured" value="<?php echo KT_escapeAttribute($row_rscustom['cap_totalsumassured']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_totalsumassured");?> <?php echo $tNGs->displayFieldError("custom", "cap_totalsumassured"); ?></td>
              </tr>
              <tr>
                <td colspan="2" class="KT_th">Has any proposal on your life ever been declined, postponed, defered,<br />
    withdrawn or accepted on special term? Please give details below:</td>
              </tr>
              <tr>
                <td colspan="2"><textarea name="cap_specialpolicy" id="cap_specialpolicy" cols="23" rows="3"><?php echo KT_escapeAttribute($row_rscustom['cap_specialpolicy']); ?></textarea>
                <?php echo $tNGs->displayFieldHint("cap_specialpolicy");?> <?php echo $tNGs->displayFieldError("custom", "cap_specialpolicy"); ?></td>
              </tr>
              <tr class="KT_buttons">
                <td colspan="2"><input type="submit" name="KT_Custom1" id="KT_Custom1" value="Continue&gt;&gt;" /></td>
              </tr>
            </table>
        </form></td>
      </tr>
    </table>
    <?php
        echo $tNGs->getErrorMsg();
    ?>
    </body>
    </html>
    PAGE 3
    <?php require_once('Connections/crusader.php'); ?>
    <?php
    //MX Widgets3 include
    require_once('includes/wdg/WDG.php');
    // Load the common classes
    require_once('includes/common/KT_common.php');
    // Load the tNG classes
    require_once('includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("");
    // Make unified connection variable
    $conn_crusader = new KT_connection($crusader, $database_crusader);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $formValidation->addField("cap_terms", true, "", "", "", "", "");
    $tNGs->prepareValidation($formValidation);
    // End trigger
    //start Trigger_Custom trigger
    function Trigger_Custom(&$tNG) {
    session_start();
    $cap_title= $_SESSION['form']['cap_title'];
    $tNG->addColumn("cap_title","STRING_TYPE","VALUE",$cap_title);
    $cap_firstname = $_SESSION['form']['cap_firstname'];
    $tNG->addColumn("cap_firstname","STRING_TYPE","VALUE",$cap_firstname);
    $cap_lastname = $_SESSION['form']['cap_lastname'];
    $tNG->addColumn("cap_lastname","STRING_TYPE","VALUE",$cap_lastname);
    $cap_dateofbirth = $_SESSION['form']['cap_dateofbirth'];
    $tNG->addColumn("cap_dateofbirth","DATE_TYPE","VALUE",$cap_dateofbirth);
    $cap_sex = $_SESSION['form']['cap_sex'];
    $tNG->addColumn("cap_sex","STRING_TYPE","VALUE",$cap_sex);
    $cap_marital = $_SESSION['form']['cap_marital'];
    $tNG->addColumn("cap_marital","STRING_TYPE","VALUE",$cap_marital);
    $cap_corrAdd = $_SESSION['form']['cap_corrAdd'];
    $tNG->addColumn("cap_corrAdd","STRING_TYPE","VALUE",$cap_corrAdd);
    $cap_email = $_SESSION['form']['cap_email'];
    $tNG->addColumn("cap_email","STRING_TYPE","VALUE",$cap_email);
    $cap_mobilephone = $_SESSION['form']['cap_mobilephone'];
    $tNG->addColumn("cap_mobilephone","STRING_TYPE","VALUE",$cap_mobilephone);
    $cap_occupation = $_SESSION['form']['cap_occupation'];
    $tNG->addColumn("cap_occupation","STRING_TYPE","VALUE",$cap_occupation);
    $cap_sumassured = $_SESSION['form']['cap_sumassured'];
    $tNG->addColumn("cap_sumassured","STRING_TYPE","VALUE",$cap_sumassured);
    $cap_policyterm = $_SESSION['form']['cap_policyterm'];
    $tNG->addColumn("cap_policyterm","STRING_TYPE","VALUE",$cap_policyterm);
    $cap_commdate = $_SESSION['form']['cap_commdate'];
    $tNG->addColumn("cap_commdate","DATE_TYPE","VALUE",$cap_commdate);
    $cap_premium = $_SESSION['form']['cap_premium'];
    $tNG->addColumn("cap_premium","STRING_TYPE","VALUE",$cap_premium);
    $cap_frequencyp = $_SESSION['form']['cap_frequencyp'];
    $tNG->addColumn("cap_frequencyp","STRING_TYPE","VALUE",$cap_frequencyp);
    $cap_modep = $_SESSION['form']['cap_modep'];
    $tNG->addColumn("cap_modep","STRING_TYPE","VALUE",$cap_modep);
    $cap_targetamount = $_SESSION['form']['cap_targetamount'];
    $tNG->addColumn("cap_targetamount","STRING_TYPE","VALUE",$cap_targetamount);
    $cap_livecover = $_SESSION['form']['cap_livecover'];
    $tNG->addColumn("cap_livecover","STRING_TYPE","VALUE",$cap_livecover);
    $cap_regularsavings = $_SESSION['form']['cap_regularsavings'];
    $tNG->addColumn("cap_regularsavings","STRING_TYPE","VALUE",$cap_regularsavings);
    $cap_benefit = $_SESSION['form']['cap_benefit'];
    $tNG->addColumn("cap_benefit","STRING_TYPE","VALUE",$cap_benefit);
    $cap_lifepolicy = $_SESSION['form']['cap_lifepolicy'];
    $tNG->addColumn("cap_lifepolicy","STRING_TYPE","VALUE",$cap_lifepolicy);
    $cap_nameinsurer = $_SESSION['form']['cap_nameinsurer'];
    $tNG->addColumn("cap_nameinsurer","STRING_TYPE","VALUE",$cap_nameinsurer);
    $cap_totalsumassured = $_SESSION['form']['cap_totalsumassured'];
    $tNG->addColumn("cap_totalsumassured","STRING_TYPE","VALUE",$cap_totalsumassured);
    $cap_specialpolicy = $_SESSION['form']['cap_specialpolicy'];
    $tNG->addColumn("cap_specialpolicy","STRING_TYPE","VALUE",$cap_specialpolicy);
    $cap_username = $_SESSION['form']['cap_username'];
    $tNG->addColumn("cap_username","STRING_TYPE","VALUE",$cap_username);
    //end Trigger_Custom trigger
    // Make an insert transaction instance
    $ins_capital = new tNG_insert($conn_crusader);
    $tNGs->addTransaction($ins_capital);
    // Register triggers
    $ins_capital->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    $ins_capital->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $ins_capital->registerTrigger("END", "Trigger_Default_Redirect", 99, "capdone.php");
    $ins_capital->registerTrigger("BEFORE", "Trigger_Custom", 50);
    // Add columns
    $ins_capital->setTable("capital");
    $ins_capital->addColumn("cap_hospital", "STRING_TYPE", "POST", "cap_hospital");
    $ins_capital->addColumn("cap_height", "STRING_TYPE", "POST", "cap_height");
    $ins_capital->addColumn("cap_weight", "STRING_TYPE", "POST", "cap_weight");
    $ins_capital->addColumn("cap_pregnant", "STRING_TYPE", "POST", "cap_pregnant");
    $ins_capital->addColumn("cap_expectedD", "STRING_TYPE", "POST", "cap_expectedD");
    $ins_capital->addColumn("cap_smoke", "STRING_TYPE", "POST", "cap_smoke");
    $ins_capital->addColumn("cap_tuberculosis", "CHECKBOX_YN_TYPE", "POST", "cap_tuberculosis", "N");
    $ins_capital->addColumn("cap_epilepsy", "CHECKBOX_YN_TYPE", "POST", "cap_epilepsy", "N");
    $ins_capital->addColumn("cap_heartd", "CHECKBOX_YN_TYPE", "POST", "cap_heartd", "N");
    $ins_capital->addColumn("cap_insanity", "CHECKBOX_YN_TYPE", "POST", "cap_insanity", "N");
    $ins_capital->addColumn("cap_diabetes", "CHECKBOX_YN_TYPE", "POST", "cap_diabetes", "N");
    $ins_capital->addColumn("cap_other", "STRING_TYPE", "POST", "cap_other");
    $ins_capital->addColumn("cap_skin", "CHECKBOX_YN_TYPE", "POST", "cap_skin", "N");
    $ins_capital->addColumn("cap_highsweat", "CHECKBOX_YN_TYPE", "POST", "cap_highsweat", "N");
    $ins_capital->addColumn("cap_weightloss", "CHECKBOX_YN_TYPE", "POST", "cap_weightloss", "N");
    $ins_capital->addColumn("cap_glands", "CHECKBOX_YN_TYPE", "POST", "cap_glands", "N");
    $ins_capital->addColumn("cap_diarrhea", "CHECKBOX_YN_TYPE", "POST", "cap_diarrhea", "N");
    $ins_capital->addColumn("cap_stds", "CHECKBOX_YN_TYPE", "POST", "cap_stds", "N");
    $ins_capital->addColumn("cap_leisure", "STRING_TYPE", "POST", "cap_leisure");
    $ins_capital->addColumn("cap_outnigeria", "STRING_TYPE", "POST", "cap_outnigeria");
    $ins_capital->addColumn("cap_terms", "CHECKBOX_YN_TYPE", "POST", "cap_terms", "N");
    $ins_capital->setPrimaryKey("cap_id", "NUMERIC_TYPE");
    // Make an insert transaction instance
    $ins_capital = new tNG_insert($conn_crusader);
    $tNGs->addTransaction($ins_capital);
    // Register triggers
    $ins_capital->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    $ins_capital->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
    $ins_capital->registerTrigger("END", "Trigger_Default_Redirect", 99, "capdone.php");
    $ins_capital->registerTrigger("BEFORE", "Trigger_Custom", 50);
    // Add columns
    $ins_capital->setTable("capital");
    $ins_capital->addColumn("cap_hospital", "STRING_TYPE", "POST", "cap_hospital");
    $ins_capital->addColumn("cap_height", "STRING_TYPE", "POST", "cap_height");
    $ins_capital->addColumn("cap_dateofbirth", "DATE_TYPE", "POST", "cap_dateofbirth");
    $ins_capital->addColumn("cap_weight", "STRING_TYPE", "POST", "cap_weight");
    $ins_capital->addColumn("cap_pregnant", "STRING_TYPE", "POST", "cap_pregnant");
    $ins_capital->addColumn("cap_expectedD", "STRING_TYPE", "POST", "cap_expectedD");
    $ins_capital->addColumn("cap_smoke", "STRING_TYPE", "POST", "cap_smoke");
    $ins_capital->addColumn("cap_tuberculosis", "CHECKBOX_YN_TYPE", "POST", "cap_tuberculosis", "N");
    $ins_capital->addColumn("cap_epilepsy", "CHECKBOX_YN_TYPE", "POST", "cap_epilepsy", "N");
    $ins_capital->addColumn("cap_heartd", "CHECKBOX_YN_TYPE", "POST", "cap_heartd", "N");
    $ins_capital->addColumn("cap_insanity", "CHECKBOX_YN_TYPE", "POST", "cap_insanity", "N");
    $ins_capital->addColumn("cap_diabetes", "CHECKBOX_YN_TYPE", "POST", "cap_diabetes", "N");
    $ins_capital->addColumn("cap_other", "STRING_TYPE", "POST", "cap_other");
    $ins_capital->addColumn("cap_skin", "CHECKBOX_YN_TYPE", "POST", "cap_skin", "N");
    $ins_capital->addColumn("cap_highsweat", "CHECKBOX_YN_TYPE", "POST", "cap_highsweat", "N");
    $ins_capital->addColumn("cap_weightloss", "CHECKBOX_YN_TYPE", "POST", "cap_weightloss", "N");
    $ins_capital->addColumn("cap_glands", "CHECKBOX_YN_TYPE", "POST", "cap_glands", "N");
    $ins_capital->addColumn("cap_diarrhea", "CHECKBOX_YN_TYPE", "POST", "cap_diarrhea", "N");
    $ins_capital->addColumn("cap_stds", "CHECKBOX_YN_TYPE", "POST", "cap_stds", "N");
    $ins_capital->addColumn("cap_leisure", "STRING_TYPE", "POST", "cap_leisure");
    $ins_capital->addColumn("cap_outnigeria", "STRING_TYPE", "POST", "cap_outnigeria");
    $ins_capital->addColumn("cap_terms", "CHECKBOX_YN_TYPE", "POST", "cap_terms", "N");
    $ins_capital->setPrimaryKey("cap_id", "NUMERIC_TYPE");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rscapital = $tNGs->getRecordset("capital");
    $row_rscapital = mysql_fetch_assoc($rscapital);
    $totalRows_rscapital = mysql_num_rows($rscapital);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <?php echo $tNGs->displayValidationRules();?>
    <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
    <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
    <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
    <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
    <script src="includes/resources/calendar.js"></script>
    <style type="text/css">
    <!--
    @import url("layout.css");
    -->
    </style>
    <script type="text/javascript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    //-->
    </script>
    </head>
    <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
    <table width="449" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="447" valign="top"><form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
          <table align="center" cellpadding="2" cellspacing="0" class="KT_tngtable">
              <tr>
                <td colspan="2" bgcolor="#990000"><span class="white">Final Step: </span></td>
              </tr>
              <tr>
                <td width="244" class="KT_th"><label for="cap_hospital">Hospital Details:</label></td>
                <td width="193"><textarea name="cap_hospital" id="cap_hospital" cols="22" rows="3"><?php echo KT_escapeAttribute($row_rscapital['cap_hospital']); ?></textarea>
                  <?php echo $tNGs->displayFieldHint("cap_hospital");?> <?php echo $tNGs->displayFieldError("capital", "cap_hospital"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_height">What is your height:</label></td>
                <td><input type="text" name="cap_height" id="cap_height" value="<?php echo KT_escapeAttribute($row_rscapital['cap_height']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_height");?> <?php echo $tNGs->displayFieldError("capital", "cap_height"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_weight">What is your weight:</label></td>
                <td><input type="text" name="cap_weight" id="cap_weight" value="<?php echo KT_escapeAttribute($row_rscapital['cap_weight']); ?>" size="32" />
                  <?php echo $tNGs->displayFieldHint("cap_weight");?> <?php echo $tNGs->displayFieldError("capital", "cap_weight"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_pregnant_1">Are you pregnant(Female)?:</label></td>
                <td><div>
                  <input <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_pregnant']),"Yes"))) {echo "@@checked@@";} ?> type="radio" name="cap_pregnant" id="cap_pregnant_1" value="Yes" />
                  <label for="cap_pregnant_1">Yes</label>
                    <input <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_pregnant']),"No"))) {echo "@@checked@@";} ?> type="radio" name="cap_pregnant" id="cap_pregnant_2" value="No" />
                    <label for="cap_pregnant_2">No</label>
                    <?php echo $tNGs->displayFieldError("capital", "cap_pregnant"); ?></div>
                  <div></div></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_expectedD">If yes what is expected month of delivery:</label></td>
                <td><input name="cap_expectedD" id="cap_expectedD" value="<?php echo KT_escapeAttribute($row_rscapital['cap_expectedD']); ?>" size="22" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="no" />
                  <?php echo $tNGs->displayFieldHint("cap_expectedD");?> <?php echo $tNGs->displayFieldError("capital", "cap_expectedD"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_smoke_1">Have you smoke cigarette in the past 12 months:</label></td>
                <td><div>
                  <input <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_smoke']),"Yes"))) {echo "@@checked@@";} ?> type="radio" name="cap_smoke" id="cap_smoke_1" value="Yes" />
                  <label for="cap_smoke_1">Yes</label>
                    <input <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_smoke']),"No"))) {echo "@@checked@@";} ?> type="radio" name="cap_smoke" id="cap_smoke_2" value="No" />
                    <label for="cap_smoke_2">No</label>
                    <?php echo $tNGs->displayFieldError("capital", "cap_smoke"); ?></div>
                  <div></div></td>
              </tr>
              <tr>
                <td colspan="2">Have you suffered or are suffering from any of the following:</td>
              </tr>
              <tr>
                <td colspan="2"><table width="421" cellspacing="0" cellpadding="0">
                  <tr class="KT_tngtable">
                    <td width="81" class="KT_th"><label for="cap_tuberculosis">Tuberculosis:</label></td>
                    <td width="63"><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_tuberculosis']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_tuberculosis" id="cap_tuberculosis" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_tuberculosis"); ?></td>
                    <td width="10"> </td>
                    <td width="68" class="KT_th"><span class="KT_th">Insanity:</span></td>
                    <td width="197"><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_insanity']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_insanity" id="cap_insanity" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_insanity"); ?></td>
                  </tr>
                  <tr class="KT_tngtable">
                    <td class="KT_th"><label for="cap_epilepsy">Epilepsy:</label></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_epilepsy']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_epilepsy" id="cap_epilepsy" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_epilepsy"); ?></td>
                    <td> </td>
                    <td class="KT_th"><span class="KT_th">Diabetes:</span></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_diabetes']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_diabetes" id="cap_diabetes" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_diabetes"); ?></td>
                  </tr>
                  <tr class="KT_tngtable">
                    <td class="KT_th"><label for="cap_heartd">Heart Disease:</label></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_heartd']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_heartd" id="cap_heartd" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_heartd"); ?></td>
                    <td> </td>
                    <td class="KT_th"><span class="KT_th">Others:</span></td>
                    <td><input type="text" name="cap_other" id="cap_other" value="<?php echo KT_escapeAttribute($row_rscapital['cap_other']); ?>" size="32" />
                      <?php echo $tNGs->displayFieldHint("cap_other");?> <?php echo $tNGs->displayFieldError("capital", "cap_other"); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td colspan="2">Have you ever had?</td>
              </tr>
              <tr>
                <td colspan="2"><table width="400" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="114" class="KT_th"><span class="KT_th">Skin Disoder:</span></td>
                    <td width="85"><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_skin']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_skin" id="cap_skin" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_skin"); ?></td>
                    <td width="11"> </td>
                    <td width="127" class="KT_th"><span class="KT_th">Swollen Glands:</span></td>
                    <td width="61"><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_glands']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_glands" id="cap_glands" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_glands"); ?></td>
                  </tr>
                  <tr>
                    <td class="KT_th"><span class="KT_th">High Sweat:</span></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_highsweat']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_highsweat" id="cap_highsweat" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_highsweat"); ?></td>
                    <td> </td>
                    <td class="KT_th"><span class="KT_th">Diarrhea:</span></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_diarrhea']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_diarrhea" id="cap_diarrhea" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_diarrhea"); ?></td>
                  </tr>
                  <tr>
                    <td class="KT_th"><span class="KT_th">Weight Loss:</span></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_weightloss']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_weightloss" id="cap_weightloss" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_weightloss"); ?></td>
                    <td> </td>
                    <td class="KT_th"><span class="KT_th">Sexually transmitted disease:</span></td>
                    <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_stds']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_stds" id="cap_stds" value="Y" />
                      <?php echo $tNGs->displayFieldError("capital", "cap_stds"); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_leisure">What games, sports or past times do<br />
    you engage in?:</label></td>
                <td><textarea name="cap_leisure" id="cap_leisure" cols="22" rows="3"><?php echo KT_escapeAttribute($row_rscapital['cap_leisure']); ?></textarea>
                  <?php echo $tNGs->displayFieldHint("cap_leisure");?> <?php echo $tNGs->displayFieldError("capital", "cap_leisure"); ?></td>
              </tr>
              <tr>
                <td class="KT_th"><label for="cap_outnigeria">Do you intend to reside outside Nigeria?:</label></td>
                <td><select name="cap_outnigeria" id="cap_outnigeria">
                  <option value="Yes" <?php if (!(strcmp("Yes", KT_escapeAttribute($row_rscapital['cap_outnigeria'])))) {echo "SELECTED";} ?>>Yes</option>
                  <option value="No" <?php if (!(strcmp("No", KT_escapeAttribute($row_rscapital['cap_outnigeria'])))) {echo "SELECTED";} ?>>No</option>
                </select>
                  <?php echo $tNGs->displayFieldError("capital", "cap_outnigeria"); ?></td>
              </tr>
              <tr>
                <td colspan="2" valign="top" onclick="MM_openBrWindow('privacy.html','Privacy','')">Please read and agree to our <a href="#">Terms of Service</a> and <a href="#">Privacy Policy,</a><br />
                and to receive important communications from us electronically.</td>
              </tr>
              <tr>
                <td colspan="2" class="KT_th"><span class="KT_th"> I Agree</span>
                  <input  <?php if (!(strcmp(KT_escapeAttribute($row_rscapital['cap_terms']),"Y"))) {echo "checked";} ?> type="checkbox" name="cap_terms" id="cap_terms" value="Y" />
                <?php echo $tNGs->displayFieldError("capital", "cap_terms"); ?></td>
              </tr>
              <tr class="KT_buttons">
                <td colspan="2"><input name="KT_Insert1" type="submit" class="forms" id="KT_Insert1" value="Get Quote Now !" /></td>
              </tr>
            </table>
        </form></td>
      </tr>
    </table>
    <?php
        echo $tNGs->getErrorMsg();
    ?>
    </body>
    </html>

    all I can see is that page 3 has a duplicate Insert Transaction that´s referencing the same fields as the first one, except "cap_dateofbirth" which is only declared in one of them:
    // Make an insert transaction instance
    $ins_capital = new tNG_insert($conn_crusader);
    $tNGs->addTransaction($ins_capital);
    Don´t know if this is the cause for your issue, but it certainly can´t hurt doing away with one of the Insert Transactions.
    BTW, in some of your pages I stumble across the following:
    echo "@@checked@@";
    the @´s definitely shouldn´t be in there, and as far as I can recall this might point to a broken ADDT installation, as this is stuff which resides in ADDT´s internal .edml files (defines the code that Dreamweaver inserts into the document to represent the data source value) and are not meant to find their way into PHP documents created by DW.
    Cheers,
    Günter

  • Raise Exception for Insert Statement

    Hello All,
    Hope everyone know that when we try to do an Insert on a table in two different session with the same unique key then in the second session the application will hang.
    Instead of hanging or waiting in another session, do we have any option to raise an Exception saying "Parallel Duplicate insertion is active." or to do Insert with NOWAIT so that it throws an Error.
    Thanks in advance.
    Regards,
    Yathish

    As far as I know, you cannot do this for inserts. It makes sense when you think about it a bit. User 1 inserts a row into the table but does not commit. That row only potentially exists in the database. User 2 comes along and tries to insert the same row. Oracle sees that this row potentially exists, so makes user 2 wait to see what user 1 does. If user 1 commits, user 2 will get a constraint violation, if user 1 does a rollback, then user 2 gets to insert their version of the row.
    The only thing you can do is to catche the exception and then do whatever makes sense form a business perspective.
    I have several cases where I use this kind of logic. I get messages coming in from several differrnt source systems. I potentially need to create records in a number of different tables. In some cases, while one session is processing a message, another session will process a different message that creates one of the objects that session 1 thinks it will need to. When session 1 gets the constraint violoation it either retrieves the newly created surrogate key for further use (i.e. in other child tables), or updates the newly created record with the data it hase, depending on the business rules in force.
    John

  • Pages panel: Option-drag to duplicate broken in CS6

    For some reason, the ability to quickly duplicate a page or spread in the Page panel via an Option-drag doesn't work in CS6. If I try to, say, Option-drag page 3 to insert a duplicate of it between pages 8 and 9, all it does is move page 3 there. To get the desired result, I have to first duplicate the page (which inserts it at the end of my document), then drag it to the proper place.  
    Option-drag to duplicate/insert worked fine in previous versions, and it's expected behavior on the Mac. Am I missing something here?

    Thanks, Bob!
    I've also noticed that sometimes Option-drag does nothing at all. I get a spinning beachball for a second, then... nothing.
    I'm hesitant to believe that trashing my preferences will fix this, as I've seen this happen on two separate Macs.

  • Deadlock when inserting lob

    I am getting several deadlocks.
    I have three client machines connecting via JDBC to our Oracle 10g server. Each of these clients insert about 10,000 rows a minute into a specific table. This table is defined as follows:
    create table contextdata (
    accdate timestamp(0) not null,
    hash varchar2(32) not null,
    content blob,
    primary key (hash)
    The data is inserted into the table as follows:
    1.insert into contextdata (accdate, hash, content) values (:1, :2, empty_blob());
    2.select content from contextdata where hash = :1 for update;
    3.Move data into the lob.
    4.Commit;
    We get three or four deadlocks a minute. A portion of a trace file follows:
    /opt/oracle/product/10.1.0/db_1/admin/dev/udump/dev_ora_966.trc
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ORACLE_HOME = /opt/oracle/product/10.1.0/db_1
    System name:     Linux
    Node name:     oracle10lt
    Release:     2.6.11.10-grsec
    Version:     #2 SMP Thu Jun 2 16:42:30 MDT 2005
    Machine:     i686
    Instance name: dev
    Redo thread mounted by this instance: 1
    Oracle process number: 23
    Unix process pid: 966, image: oracledev@oracle10lt
    *** 2005-06-20 05:33:49.318
    *** SERVICE NAME:(SYS$USERS) 2005-06-20 05:33:49.318
    *** SESSION ID:(182.52820) 2005-06-20 05:33:49.318
    DEADLOCK DETECTED
    Current SQL statement for this session:
    SELECT CONTENT FROM CONTEXTDATA WHERE HASH=:1 FOR UPDATE
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TX-0003002a-00013139 23 182 X 30 229 X
    TX-00080005-00000913 30 229 X 23 182 X
    session 182: DID 0001-0017-0000219B     session 229: DID 0001-001E-00001D08
    session 229: DID 0001-001E-00001D08     session 182: DID 0001-0017-0000219B
    Rows waited on:
    Session 229: obj - rowid = 0001FACD - AAAfrNAAEAAD6oHAAQ
    (dictionary objn - 129741, file - 4, block - 1026567, slot - 16)
    Session 182: obj - rowid = 0001FACD - AAAfrNAAEAAD5jYAAX
    (dictionary objn - 129741, file - 4, block - 1022168, slot - 23)
    Information on the OTHER waiting sessions:
    Session 229:
    pid=30 serial=25679 audsid=83986 user: 111/LTCLUSTER1
    O/S info: user: , term: , ospid: 1234, machine: qacluster3.oakleynetworks.com
    program:
    Current SQL Statement:
    SELECT CONTENT FROM CONTEXTDATA WHERE HASH=:1 FOR UPDATE
    End of information on OTHER waiting sessions.
    ===================================================
    The conflict seems to be between competing sessions; one session is doing an insert while another session is doing the select for update. They cannot be going after the same row because the value for the hash column is the primary key and the select for update is done immediately after the insert and within a transaction. If they were using the same value for hash, the insert would fail with a duplicate value or the duplicate insert would not return until the first session did a commit, at which time I would expect to get a duplicate key failure.
    There is no other activity against the database.
    Any help in resolving this deadlock would be greatly appreciated.
    Thanks
    Brent

    To be honest, I don't think the transaction is necessary, but the developers put it there anyway. The select statement will put the result cam_status
    into a variable, and then depends on its value, it will decide whether to execute the second update statement or not. I still can't upload the screen-shot, because it says it needs to verify my account at first. No clue at all. But it is very simple, just
    like:
    Clustered Index Update
    [analyst_monitor].[IX_Clust_scam_an_name_window]
    cost: 100%
    By the way, for some reason, I can't find the object based on the associatedObjectId listed in the XML
    <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor"
    indexname="IX_Clust_scam_an_name_window" id="lock4befe1100" mode="X" associatedObjectId="72057654588604416">
    For example: 
    SELECT * FROM sys.partition WHERE hobt_id = 72057654588604416
    This return nothing. Not sure why.

  • Duplicate record in Condition record table

    Dear Experts,
    when we create a record in the same access and in same validity period with same processing status. System give a popup of overlapping the dates and short close the existing record.
    But we are facing issue if existing record status is released and when we create record with the same validity period  with block status, system not splitting the condtion and save with the same validity period and after that system give a error massage in VK12 for duplicate insertion.
    I want that system will split the condition record even if existing condition record with different release status.
    Please help.
    Regards,
    Lucky verma

    Dear Lucky,
    I understand your scenario, when you create Condition Record at the first time in Vk11 by block status "A" lets say 01.01.2014 till 31.01.2014. Afterward you change the processing status as "C" release. at the middle of the month you come up with new price so you maintain with processing status "A" from 15.01.2014 till 31.01.2014, system will not stop you at that time because processing status is with blocked. when you release this status into "C" . system will not allow you to do so why because this is standard behavior that when you have an existing record with same Access Sequence, Condition, processing status and Validity. system will not overwrite it until or unless you change the from date as same as you have already maintain.
    If you want to propose your date while creating condition record, you have to change your settings in V/06 Valid From and Valid to as "No proposal" so that you can maintain your own validates but when ever you have to create new condition record at the same time (in middle of the month) you have to manually change the first one as 14.01.2014. this is because as i have mentioned system cannot allow two condition record as the same time with your same characteristics. Furthermore you can ask freely if you have any query.
    Please go through this information too. hope this will clear your understanding.
    Validity Periods - Pricing and Conditions (SD-BF-PR) - SAP Library  Thanks
    Regards,
    Suhaib Bin Aziz

Maybe you are looking for