Query on eventFlow of bounded dataObject

Hi all,
I am studying the event flow for a bounded dataObject within a page and
got lost at one point. This is the flow I am working on.
Flow of the events,
1) Inside doStartTag() of 'UseTiledViewTag', beginDisplay() of
TiledViewBean is called
2) Inside beginDisplay() of TiledViewBean, executeAutoRetrievingmodels()
is called, which executes all the models that are binded to the page
3) Then, inside doStartTag() of 'UseTiledViewTag', nextTile() is called
on TiledViewBean, which points the pointer to the next tile.
However, I missed one important task.
- When the nextTile() is called everytime, the display-attributes of the
page should be refreshed with the latest tile? Where is this happening?
- I see a method "getChild(String, int)" inside TiledViewBase, which
claims to be doing this? But, how does the control come here from the
JSP page?
A bit lost here. Could someone help me out !!
thanks
Srikanth

I'm not sure what you mean by display attributes of the page. But if you mean
the values of the viewBean (or tiledViews) display fields, then you are not
missing anything. The fact is, the views' children don't hold any values at
all. All values for all display fields are stored in the model they are bound
to.
When get<ChildName>().getValue() is called, it is pulling the value from the
model.
When get<ChildName>().setValue(Object val) is called, the value is stored in
the model.
Remember, this model can be a SQL based model (or one of the other backend
based models), or it could be the DefaultModel.
No matter what, all display fields are bound to some model.
In ND, this was very different. DisplayFields had a value attribute, and so did
the DataFields of the Data Objects. This led to possible inconsistencies with
values being out of synce between the data fields and the display fields.
craig
----- Original Message -----
From: Srikanth Namburi
Sent: Monday, March 12, 2001 7:17 AM
Subject: [iPlanet-JATO] Query on eventFlow of bounded dataObject
Hi all,
I am studying the event flow for a bounded dataObject within a page and
got lost at one point. This is the flow I am working on.
Flow of the events,
1) Inside doStartTag() of 'UseTiledViewTag', beginDisplay() of
TiledViewBean is called
2) Inside beginDisplay() of TiledViewBean, executeAutoRetrievingmodels()
is called, which executes all the models that are binded to the page
3) Then, inside doStartTag() of 'UseTiledViewTag', nextTile() is called
on TiledViewBean, which points the pointer to the next tile.
However, I missed one important task.
- When the nextTile() is called everytime, the display-attributes of the
page should be refreshed with the latest tile? Where is this happening?
- I see a method "getChild(String, int)" inside TiledViewBase, which
claims to be doing this? But, how does the control come here from the
JSP page?
A bit lost here. Could someone help me out !!
thanks
Srikanth
Hello! your domain today!
[email protected]
[Non-text portions of this message have been removed]

Similar Messages

  • Forcing one particular query to be rewritten to custom SQL

    Hi everyone,
    MapBuilder produces Queries that look like this
    SELECT ROWID, GEOM, 'C.AT_1410_GW_ROAD', null, 'null', -1, 'rule#0'
    FROM MYTABLE
    WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 31468, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(:mvqboxxl, :mvqboxyl, :mvqboxxh, :mvqboxyh)), 'querytype=WINDOW') = 'TRUE' AND (areatype = 'ROAD') UNION ALL
    SELECT ROWID, GEOM, 'C.AT_1410_GW_RIVER', null, 'null', -1, 'rule#1'
    FROM MYTABLE
    WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 31468, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(:mvqboxxl, :mvqboxyl, :mvqboxxh, :mvqboxyh)), 'querytype=WINDOW') = 'TRUE' AND (areatype = 'RIVER') UNION ALL
    SELECT ROWID, GEOM, 'C.AT_1410_GW_FOREST', null, 'null', -1, 'rule#2'
    FROM MYTABLE
    WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 31468, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(:mvqboxxl, :mvqboxyl, :mvqboxxh, :mvqboxyh)), 'querytype=WINDOW') = 'TRUE' AND (areatype = 'FOREST') UNION ALL
    ...Where geom is the sdo_geometry to be drawn and areatype determines the type of which a polygon is (for example a river or forest). As you can see there multiple queries to the same table, union-all'd together. This is unnecessary. It causes a lot of expensive spatial queries when it really only serves to create the literal strings like 'C.AT_1410_GW_ROAD' that MapBuilder needs to distinguish for example forests and rivers.
    I was thinking of making a materialized view that contains the literals 'C.AT_1410_GW_ROAD' and so on which MapBuilder/Viewer needs, plus the geometries. That would allow to get the same result in just one simple
    SELECT rowid, geom, layertype, null, null, rule
    FROM mymatview
    WHERE MDSYS.SDO_ORDINATE_ARRAY(:mvqboxxl, :mvqboxyl, :mvqboxxh, :mvqboxyh)), 'querytype=WINDOW') = 'TRUE'Where layertype would contain the 'C.AT_1410_GW_ROAD' and rule the 'rule#0'. Basically the result of the huge union-all-query above, without the bounding box, in an MV. That part works, but now I need Oracle to actually use this MV instead of running the query that MapBuilder sends. How do I do this? I don't think Oracle can realize that the MV has a column containing the literals MapBuilder sends in its SELECT. Basically I need a "query search and replace" in Oracle 11g, or a "custom query rewrite" if that's what you want to call it.
    Kind of hard to explain, I hope it is understandable, any help would be very very much appreciated,
    Christian
    Edited by: Christian Menke on 02.09.2010 07:26
    Edited by: Christian Menke on 02.09.2010 07:27

    Use the case statement to determine two of the columns, which means you can remove the UNION ALL since there is no difference in the WHERE clause apart from the areatype;
    something like this:
    SELECT ROWID
          ,GEOM                 as Geom
          ,null                 as Null_value
          ,'null'               as Literal_Null_String
          ,case
              when area_type = 'ROAD' then
                'C.AT_1410_GW_ROAD'
              when area_type = 'RIVER' then
                'C.AT_1410_GW_RIVER'
              when area_type = 'FOREST' then
                'C.AT_1410_GW_FOREST'
           end as location_literal
          ,-1                   as Negative_One
          ,case
              when area_type = 'ROAD' then
                'rule#0'
              when area_type = 'RIVER' then
                'rule#1'
              when area_type = 'FOREST' then
                'rule#2'
           end as rule_string
    FROM  MYTABLE
    WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 31468, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(:mvqboxxl, :mvqboxyl, :mvqboxxh, :mvqboxyh)), 'querytype=WINDOW') = 'TRUE'

  • Select One Choice attribute' LoV based on two bind variables, best practice

    Hello there,
    I am in the process of learning the ADF 11g, I have following requirement,
    A page must contain a list of school names which is needed to be fetched based on two parameters, the parameters are student information been inserted in the previous page.
    I have defined a read only view "SchoolNamesViewRO", it's query depends on two bind variables :stdDegree and stdCateg.
    added that RO View as a view accessor to the entity to which the name attribute belongs, and then add LoV for the name attribute using the ReadOnly view,
    added the name attribute as Select One Choice to page2,
    and now I need to pass the values of the bind variables of the ReadOnly view,
    the information needed to be passed as the bind variables is inserted in the previous page, I could have the data as bindings attribute values in the page2 definition
    I have implemented the next two appraoches but both resulted in an empty list :
    * added ExecuteWithParams Action to the bindings of the page and then defined an Invoke Action (set refresh condition) in the executable s, set the default values of the parameters to be the attributes values' input value,
    in the trace I code see that the binding fetches correct values as supposed , but the select list appears empty, does the this execution for the query considered to be connected to the list ?
    * added a method to the ReadOnly view Imp java class to set the bind variables, then I define it as a MethodAction in the bindings , and then create an Invoke action for it , also the select is empty,
    if the query been executed with the passed variables, then why the list is empty? is it reading data from another place than the page!
    and what is the best practice to implement that requirement?
    would the solution be : by setting the default value of the bind variables to be some kind of Expression!
    please notice that query execution had the bound variables ( I see in the trace) are set to the correct values.
    would you give some hints or redirect me to a useful link,
    Thanks in advance
    Regards,

    please give me any example using backing bean .for example
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:selectOneChoice label="Label 1" id="soc1" binding="#{Af.l1}"
    autoSubmit="true">
    <af:selectItem label="A" value="1" id="si1"/>
    <af:selectItem label="B" value="2" id="si2"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="Label 2" id="soc2" disabled="#{Af.l1=='2'}"
    partialTriggers="soc1">
    <af:selectItem label="C" value="3" id="si3"/>
    <af:selectItem label="D" value="4" id="si4"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    package a;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class A {
    private RichSelectOneChoice l1;
    public A() {
    public void setL1(RichSelectOneChoice l1) {
    this.l1 = l1;
    public RichSelectOneChoice getL1() {
    return l1;
    is there any mistake

  • Enquiry - Task parameters for human tasks

    Hello,
    I am trying to create a simple process for an approval process. screenshot
    I am trying to create a User task (Approval), in which I plan to pass in a Task Parameter of type Integer named "ageIn". This parameter will be used to decide upon which path to take later via an Exclusive Gateway (Approved?).
    I have defined the task parameter as shown here.
    I then tried to update the task's payload via Java using JAX-WS as follows:
    Task task = null;
              try {
                   task = taskQueryService
                             .getTaskDetailsById(taskDetailsByIdRequestType);
              } catch (Exception e1) {
                   out.write("error!");
                   return;
         Document document = XmlUtils.createDocument();
              Element payloadElem = document.createElementNS(
                        "http://xmlns.oracle.com/bpel/workflow/task", "payload");
              Element ageElem = document.createElementNS(
                        "http://www.w3.org/2001/XMLSchema#integer", "ageIn");
              ageElem.appendChild(document.createTextNode("99"));
              payloadElem.appendChild(ageElem);
              document.appendChild(payloadElem);
              task.setPayload(payloadElem);
              TaskServiceContextTaskBaseType aaa = new TaskServiceContextTaskBaseType();
              aaa.setWorkflowContext(workflowContextType);
              aaa.setTask(task);
              Task task2 = null;
              try {
                   task2 = taskService.updateTask(aaa);
              } catch (StaleObjectFaultMessage e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              } catch (WorkflowErrorMessage e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    // update task outcome
              UpdateTaskOutcomeType updateTaskOutcomeType = new UpdateTaskOutcomeType();
              updateTaskOutcomeType.setOutcome("REJECT");
              updateTaskOutcomeType.setWorkflowContext(workflowContextType);
              updateTaskOutcomeType.setTask(task2);
              // updateTaskOutcomeType.setTaskId(taskId);
              try {
                   taskService.updateTaskOutcome(updateTaskOutcomeType);
                   out.write("Approved!");
              } catch (Exception e) {
                   String message = e.toString();
                   if (e instanceof com.oracle.xmlns.bpel.workflow.taskservice.WorkflowErrorMessage) {
                        com.oracle.xmlns.bpel.workflow.taskservice.WorkflowErrorMessage wem = (com.oracle.xmlns.bpel.workflow.taskservice.WorkflowErrorMessage) e;
                        message = wem.getFaultInfo().getFaultInfo();
                   out.write("Error - " + message);
    However, when I looked at the process instance via Enterprise Manager, I found that the process's status has been SUSPENDED. screenshot
    Here is the payload XML for the offending trace:
    <auditQueryPayload auditId="164000" ciKey="70019">
    <dataState>
    <dataObject name="age" isBusinessIndicator="false">
    <value> <age xmlns:def="http://www.w3.org/2001/XMLSchema" ns0:type="def:int" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance">0</age> </value>
    </dataObject>
    <dataObject name="verdict" isBusinessIndicator="false">
    <value> <verdict xmlns:def="http://www.w3.org/2001/XMLSchema" ns0:type="def:string" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"/> </value>
    </dataObject>
    <dataObject name="FaultMessage" isBusinessIndicator="false">
    <value> oracle.bpm.bpmn.engine.model.runtime.microinstructions.TrappableException: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}uninitializedVariable} messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} cause: {XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is bpmn:getDataOutput('ageIn'). The XPath expression failed to execute; the reason was: ORABPEL-77005 Uninitialized data element. DataOutput ageIn is not initialized in flow element Approval. Make sure to initialize DataOutput ageIn before using it in flow element Approval. Contact oracle support to resolve the issue. . Check the detailed root cause described in the exception message text and verify that the XPath query is correct. } </value>
    </dataObject>
    </dataState>
    </auditQueryPayload>
    Here are my data associations for the "Approval" task:
    [https://dl.dropbox.com/u/22482565/images/4.PNG]
    [https://dl.dropbox.com/u/22482565/images/5.PNG]
    I am using JDeveloper 11.1.1.6.0.
    Can anybody help me on this? Thanks!
    Edited by: user1657693 on 03-Jul-2012 20:24

    how to make the request? is using createProcessInstanceTask in IInstanceManagementService API or other way?
    cheers

  • Error: Unsupported Object java.util.Hashtable

    Hi,
    I am getting Uncategorized SQL exception for my code:
    The error is:
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select distinct table_desc from TABLE order by table_desc where   month = ?  and year = ? ]; SQL state [HY000]; error code [857]; [NCR][Teradata JDBC Driver]:PreparedStatement.setObject: Unsupported Object java.util.Hashtable ; nested exception is java.sql.SQLException: [NCR][Teradata JDBC Driver]:PreparedStatement.setObject: Unsupported Object java.util.Hashtable
    Here is the code
    public class ABC {  
    private static final String MYDATE = "  month = ?  and year = ? ";
    public List<String> getTables(Report report) {
              List<String> tables =  new ArrayList<String>();
              JdbcTemplate template = new JdbcTemplate( dataSource );          
              Object sqlParameters[] = null;
              sqlParameters = new Object[]{ getMonthAndYear( report ) };
              String sql = "select distinct table_description from TABLE " +
              " order by table_description where ";
              tables= template.queryForList(sql + MYDATE,sqlParameters);          //the error is throwing on this line     
              return( tables);
    private Map<Integer, Integer> getMonthAndYear( Report report ) {
          Calendar today = Calendar.getInstance();
          Map<Integer, Integer> monthYear = new Hashtable<Integer, Integer>();     
          monthYear.put( Calendar.MONTH, today.get( Calendar.MONTH ) );
          monthYear.put( Calendar.YEAR, today.get( Calendar.YEAR ) );        
            System.out.println("monthYear :"+monthYear);//this prints monthYear :{2=10, 1=2008}
            return( monthYear );
    }Can anybody help me solve it? It's something to do with the parameters I am getting back...
    I will appreciate your help,
    Thanks in advance...

    evnafets wrote:
    What do you expect it to do with your "parameters"?
    You are using a [Spring JdbcTemplate|http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/jdbc/core/JdbcTemplate.html#queryForList(java.lang.String,%20java.lang.Object[])]
    What should the where clause of your sql query be?
    Why do you think this would accept parameters in a Map<Integer, Integer> ?The parameters would restrict the result I will get with my query, i have to bound with month and year constraint as part of requirements.
    The Where clause would be : where month = ? and year = ? ( which could be month = 10 and year = 2008)
    I am using Map<Integer, Integer> because in database these month and year values are numeric...
    But I don't know what it doesn't like it?
    Any idea?
    Edited by: ASH_2007 on Nov 11, 2008 1:36 PM

  • Automating sql files via a command line prompt

    Hi All
    I've set up an SQL file that extracts information about students in csv format. This information is then imported into another piece of software that creates students e-mail accounts etc..
    The program prompts the user to specify from when they want the data from e.g. list of student details that enrolled after 01-SEP-2002.
    The Network Manager has now asked me if there is any way the extraction of the student data and import into the e-mail creation software can be automated. He suggested command line prompts as used in DOS e.g. dir/od *.sql > test where dir gives the directory the od orders the files by date.
    The Network Manager wanted the extraction and import procedure run on a regular basis by simply just typing a 'command line'. The extraction would take place on an hourly basis especially during the main enrolment periods
    Can anybody help me?
    Thanks
    Jen

    I work mainly with UNIX, so cannot give you the actual DOS commands, but I would structure the program as below. I assume that you have some way of identifying the last enrollment you extract.
    In psuedo code:
    Set up any environment variables required
    sqlplus -s user/password@enrollment_server @student_extract.sql
      -- student_extract.sql would spool to a fixed name file say enrollment.txt
      -- after extracting, it would update a single column, single row table with the
      -- the identifying field for the last enrollment extracted (this would also
      -- be used in the extract query as the lower bound)
    Reset any environment variables required to connect to the email server
    sqlplus -s user/password@email_server @load_email.sql
      -- load_email.sql would read enrollment.txt and do whatever is required
    rename enrollment.txt to enrollment.txt.current-date-timeThis could be run out of an automatic scheduler if you have one, or manually from the command line.
    HTH
    John

  • CS4 - Windows XP - Freezing Hand Tool

    It seems like all I am doing is posting questions on the forum but I really do try other things before posting...most times!
    I recently posted a query about Out Of Bounds creation. I found a tutorial I was doing it. At a certain point the Hand Tool, which I wasn't even using would come up and I couldn't change the tool to do some free transformation on an object created using the stroke feature.
    If I walk away from the job for a few minutes it seems to clear itself out and I can work again but only for a short time until it flushes again. I am using new equipment with CS4 in Windows XP. The computer performance shows 1-3% of CPU usage and I have 4 gig of RAM...not not much else is open either.
    I then shut down, re-opened PhotoShop, Opened a NEW 11 x8.5 300dpi for my background, PLACED my photo I would work with, created a new layer, moved it to the position I wanted, and BINGO - Frozen hand tool for about 10-15 minutes.
    Any thoughts on how I can avoid this or SOLUTION to not having it happen again. It's a bit hare to work this way.
    Thanks for any insight....I'm still transitioning from Corel but things like this don't help!

    Thanks again John. Part of the problem maybe the size of file I am working with as well so in reading other topics I have increased my RAM usage as well.
    If you know about masking can I remain on this thread as ask(?)...I have gone through the tortures of the damned (that's one of the best ways to learn) playing with the masking in PhotoShop, quite a bit different than Corel. I think I have it pretty well figured out except for one thing.
    If I create a mask and want to adjust pixel by pixel I go to the Quick Selection Tool knowing I can either add or subtract. I set my brush size to 1, Hardness to 100, Spacing to 1% hoping that when I click on the target pixel it will execute the + or -. Too many times I don't get just the target pixel, but an adjoining one as well....not good because the redundant vocabulary comes back!
    Any thoughts on how to get JUST the target pixel in with + or -?
    Thanks again.

  • How to use JComboBox as VB DataCombo?

    I wan't to know if it is possible to use a JComboBox as VB6 DataCombo.
    There are 3 main properties of the VB6 DataCombo component: BoundColumn, ListField and RowSource.
    For example I can set the rowsource of this component to be a recordset containing for the first field a country code and the second field the corresponding country name. Therefore the BoundColumn will be the country code and the list field the country name. This component will display the country name and I am able to retrieve the corresponding country name. Also when I set to country code to this component, the corresponding country name is displayed.
    Is it possible to have the same behaviour with a JComboBox or do I have to use another component?
    Thanks for your help.

    Hi, you are probably long gone ...but I would like to set the record straight.
    After coming back and reading this post again I realized I my memory was a bit foggy about what a VB bound column property was doing. In fact, you DON'T need a CellRenderer to do this, because a CellRenderer is used to manipulate the visible aspect of the cell, and that has nothing to do with the VB bound column concept. I went into Access and reminded myself what VB is using the bound value for ...which is to store an additional value for each cell in the combo, apart from the value that will be displayed in each cell. This value is used to 'bind' the combo to a database query where the invisible 'bound column' value is a primary key value that is used to lookup the rest of the row for that selection. Of course in VB this all happens behind the scenes when you choose to fill the combo from a database query.
    In Java, unless you want to build an entire wizard to match the one in VB, you don't really approach the problem that way. You are going to have to do your own JDBC routine to fill the combo ...then listen for selections on that combo ...and query new values from the database each time the selection changes. However, you could give yourself a bit of leverage by considering the following two approaches.
    First off, you could ...as you read in the combo values from the db ...just add your own special data object into the combo that holds TWO values instead of just putting in the single visual object into the combo.
    //Loop through db results getting both the primaryKey
    //column values and the visible column values...
    mycombo.addItem( (Object) new MySpecialDataObject(primaryKey,visibleValue) );Your class for MySpecialDataObject could be something like this:
    public class MySpecialDataObject {
      private String primaryKey;
      private String visibleValue;
      public MySpecialDataObject(String primKey, String visVal) {
        primaryKey = primKey;
        visibleValue = visVal;
      public String getPrimaryKey() { return primaryKey; }
      public String getVisibleValue() { return visibleValue; }
    }And then when you get the selected object just cast it back into your special type, and then you can access both the primaryKey and the visibleValue for the selection. You can then requery the db using the primaryKey instead of having to use only the visible combo cell value.
    //Inside your action event for the combobox...
    MySpecialDataObject dao = (MySpecialDataObject) mycombo.getSelectedItem();
    String sql = "SELECT * FROM a_table WHERE primKey = " + dao.getPrimaryKey();However, this kind of forces the work onto the application developer to make this one (or possibly many of these) little data capsules each time they are using the combo. Another alternative could be to go to the data model for the combo, and create your own custom subclass that adds the characteristics you are looking for to the combobox itself, relieving the app developer of this minor nuisance. It might be a bit more work up front ...but it will streamline your development in the future by providing a customized combo class for your dev's to use.
    Here is an example of doing just that. The comments cover most of what I have done and why ...I did this over the weekend as my penance for giving you bad advice regarding the Cell renderer. As a bonus, I threw in an example of defining a custom cell renderer as well. Cheers ...silly old GumB.
    P.S. I am sure there are other approaches as well, good luck.
    * BoundJComboBoxModel.java
    * Created on May 23, 2003, 10:51 PM
    package com.gumbtech.ui;
    import java.util.ArrayList;
    * @author  gum
    public class BoundJComboBoxModel extends javax.swing.DefaultComboBoxModel {
      private ArrayList boundObjects = new ArrayList();
       * Above, is an ArrayList for storing the bound values for each element.
       * Below, I have overriden all three constructors from DefaultComboBoxModel.
       * Notice how the second two just create default 'bound values' equal to a
       * string representation of the elements array index integer.  This may
       * work as a default if your primary keys in the database agreed (which
       * they quite possibly could).  However, the model is not really intended
       * to be filled this way.  Instead, use the overloaded addElement method
       * (below) and provide each item and corresponding bound value as a pair.
      public BoundJComboBoxModel() {
        super();
      public BoundJComboBoxModel(Object[] items) {
        super(items);
        for(int i=0; i<items.length; i++) {
          boundObjects.add(String.valueOf(i));
      public BoundJComboBoxModel(java.util.Vector v) {
        super(v);
        for(int i=0; i<v.size(); i++) {
          boundObjects.add(String.valueOf(i));
       * This method overloads its counterpart from DefaultComboBoxModel.
       * This provides a way to add a complete element, by providing values
       * for both the display value and the bound value all at once.
      public void addElement(Object item, Object boundValue) {
        boundObjects.add(boundValue);
        super.addElement(item);
       * Here are the new methods that 'decorate' the original DefaultComboBoxModel.
       * They provide ways to set and get the bound value for a specific element.
       * The method setBoundValueAt is called from the gui when we fill the combo.
       * The method getBoundValueAt is called from the BoundJComboBox class that
       * we are going to build next. It could be called directly on the model, but
       * making a special JComboBox class that used this model seemed a little nicer.
       * You will see the JComboBox class that uses this model next in the example.
      public void setBoundValueAt(int index, Object boundValue) {
        boundObjects.set(index, boundValue);
      public Object getBoundValueAt(int index) {
        return boundObjects.get(index);
      public Object getBoundValueForItem(Object item) {
        int index = getIndexOf(item);
        return boundObjects.get(index);
       * These methods override thier counterparts from DefaultComboBoxModel.
       * They are overriden so we can keep the bound value list in sync.
       * For example, consider the original addElement method from the superclass.
       * Used when no bound value is provided, the method will add a bound value
       * equal to a string representation of the elements array index integer.
       * The other two overriden methods are self explanatory.
      public void addElement(Object item) {
        int idNum = boundObjects.size();
        boundObjects.add(String.valueOf(idNum));
        super.addElement(item);
      public void removeElement(Object item) {
        int index = super.getIndexOf(item);
        boundObjects.remove(index);
        super.removeElement(item);
      public void removeAll() {
        boundObjects = new ArrayList();
        super.removeAllElements();
    * BoundJComboBox.java
    * Created on May 23, 2003, 10:00 PM
    package com.gumbtech.ui;
    import java.util.ArrayList;
    import com.gumbtech.ui.BoundJComboBoxModel;
    * @author  gum
    public class BoundJComboBox extends javax.swing.JComboBox {
       * Here, I have overriden all three constructors from JComboBox.
       * We will 'force' our custom JComboBox to use the BoundJComboBoxModel.
      public BoundJComboBox() {
        super(new BoundJComboBoxModel());
      public BoundJComboBox(Object[] items) {
        super(new BoundJComboBoxModel(items));
      public BoundJComboBox(java.util.Vector v) {
        super(new BoundJComboBoxModel(v));
       * These are the new methods that 'decorate' the original JComboBox
       * class.  We have added methods that match the two methods JComboBox
       * provides for finding elements in the models list, except that our
       * new methods access the bound value list instead of the item list.
       * I only use the getSelectedBoundValue method in this example.  I
       * provided the other because together the two make a complete match
       * to the way the original class lets you query the original model.
      public Object getSelectedBoundValue() {
        return ((BoundJComboBoxModel)this.dataModel)
                .getBoundValueAt(getSelectedIndex());
      public Object getBoundValueAt(int index) {
        return ((BoundJComboBoxModel)this.dataModel)
                .getBoundValueAt(index);
    * BoundComboTest.java
    * Created on May 24, 2003, 12:18 PM
    package com;
    import java.awt.Color;
    import com.gumbtech.ui.BoundJComboBox;
    import com.gumbtech.ui.BoundJComboBoxModel;
    import com.gumbtech.ui.MyCustomCellRenderer;
    * This is a test gui that lets us demonstrate the custom
    * BoundJComboBox that we have created.  We are going to
    * emulate the 'bound column' characteristic of a VB bound
    * combo box object.
    * @author  gum
    public class BoundComboTest extends javax.swing.JFrame {
      public final static String T = "    ";
      private BoundJComboBox boundJComboBox;
      private javax.swing.JLabel msgLbl;
       * The constructor just calls methods that
       * build the gui and then fill the combo box.
      public BoundComboTest() {
        initComponents();
        fillCityComboByProvince("Alberta");
       * This method just sets up the gui components for our example.
      private void initComponents() {
      //Create an instance of BoundJComboBox (our customized JComboBox).
        boundJComboBox = new BoundJComboBox();
      //Plug in a custom renderer for the element cells visual appearance.
      //I put this here so you can see what a CellRenderer does, but this
      //actually plays no part in creating our VB like bound column combobox.
      //Out of interest, you can look at the MyCustomCellRenderer class later on.
        boundJComboBox.setRenderer(new MyCustomCellRenderer(new Color(40,100,60)));
      //Listen for change events on the combo box with an action listener.
      //Inside this action (see the comboActionPerformed method below) lies
      //the real reason for needing the bound column value.  The action needs
      //to translate the combo selection into a database query that retrieves
      //the values to be used on the form that this combo box is controlling.
        boundJComboBox.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            comboActionPerformed(evt);
      //Create other stuff to host our combo box in (irrelevent to our example).
        msgLbl = new javax.swing.JLabel();
        setTitle("Bound Combo Example");
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            System.exit(0);
        getContentPane().add(boundJComboBox, java.awt.BorderLayout.NORTH);
        getContentPane().add(msgLbl, java.awt.BorderLayout.CENTER);
        pack();
        java.awt.Dimension screenSize =
           java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setSize(new java.awt.Dimension(400, 200));
        setLocation((screenSize.width-400)/2,(screenSize.height-200)/2);
       * So, your 'bound' combo box needs a visual label that will be
       * displayed in the combo box, here we use city names from a db.
       * Your VB like 'bound column' is going to be the city_ID number, which is
       * the primary key we need to use to look up this cities values in other
       * tables.  Being different from the visible text label ...this value needs
       * to be stored in the special 'bound column' area of our combo box model.
      private void fillCityComboByProvince(String province) {
      //We can get the model out of our JComboBox, notice that the model is of
      //type BoundJComboBoxModel ...which is our own customized ComboBoxModel.
        BoundJComboBoxModel model = (BoundJComboBoxModel) boundJComboBox.getModel();
      //Clear out the combo so we can load it fresh  See how the methods we are
      //used to using in a regular ComboBoxModel now seamlessly handle our
      //parallel list of 'bound column' values.  That's because we over-rode
      //them appropriately in our customized BoundJComboBoxModel.
        model.removeAll();
      //Pretend this is the query we would use to get the values...
      //If we were selecting all the rows in the table, we might not need a bound
      //column bacause they may have a linear set of incrementing primary keys.
      //However, we are selecting a filtered set of cities ...only those from Alberta
      //...so the primary keys will not follow any regular pattern.  This is why the
      //'bound column' concept is used ...to hold a non-visible list of primary keys
      //that match each label in the combo box.  Even though we choose the value
      //'Calgary' in the combo ...we need to use '54' to look it up in the database.
        String sql = "SELECT name, city_ID FROM cities WHERE province = "+ province;
      //Pretend this is the results from our query to the db.
        final Object[] cityNames = {"Calgary", "Edmonton", "Lethbridge", "Red Deer"};
        final Object[] primaryKeys = {"54", "89", "101", "193"};
      //Use the overloaded addElement method we created in BoundJComboBoxModel to
      //fill the combo with both the visual text value, and the 'bound' value.
        for(int i=0; i<cityNames.length && i<primaryKeys.length; i++) {
            model.addElement(cityNames, primaryKeys[i]);
    //See, the combo box now has a 'bound column' for each visual element in
    //its list, which we will use to query the db each time the selection changes.
    //This is all your 'bound column' is doing in your VB wizard ...except you
    //never see the code for it. In Java, you just write the code to give your
    //JComboBox this behaviour ...and more if you so choose (which is really
    //the whole the point here!)
    * The next method handles the selection change event for our combo box.
    * This is where you use the 'bound value'. You use it to requery
    * the db so you can fill in your form with new values each time
    * the combobox selection is changed by the user.
    * This method is your action event for the combo ...and it is doing
    * the same thing that your VB program will do with your 'bound column'
    * in your VB combo box. In VB you just can't see the code, that's all.
    private void comboActionPerformed(java.awt.event.ActionEvent evt) {
    //Get the combobox that performed the action event...
    boundJComboBox = (BoundJComboBox) evt.getSource();
    //If we had a database here for real, we would query for our new form
    // values using the 'bound column' value as the primary key in the query.
    //This is what it means to use the 'bound column' of a VB combobox or list.
    //Its just a value for each element in the combo box that is different from
    //the value that will be displayed in the combo list. That's all it means.
    //VB just uses the bound value to query the database, so we can do that too.
    String sql =
    "SELECT * FROM cities WHERE city_ID = " +
    boundJComboBox.getSelectedBoundValue();
    //Since we don't really have a db, I'll just show the values for the element.
    String msg = "<html><font color=#006666>"+
    T +"Index Selected : "+ boundJComboBox.getSelectedIndex() +"<br>"+
    T +"Value Selected : "+ boundJComboBox.getSelectedItem() +"<br>"+
    T +"Bound Column Value: "+ boundJComboBox.getSelectedBoundValue() +"<br>"+
    T +"</font><font color=#dd3366>"+ sql +"</font></html>";
    msgLbl.setText(msg);
    public static void main(String args[]) {
    new BoundComboTest().show();
    * MyCustomCellRenderer.java
    * Created on May 23, 2003, 9:21 PM
    package com.gumbtech.ui;
    import java.awt.Color;
    import javax.swing.JList;
    import javax.swing.DefaultListCellRenderer;
    * usage:
    * String[] data = {"one", "two", "free", "four"};
    * JList dataList = new JList(data);
    * dataList.setCellRenderer(new MyCustomCellRenderer());
    * @author  I think this structure and the comments are a variation of
    *          David Flanagans example from Java Examples 2. (O'Reilly)
    public class MyCustomCellRenderer extends DefaultListCellRenderer {
      private static Color selectedColor = new Color(240,99,99);
      private static Color selectedBG = new Color(163,186,168);
      public MyCustomCellRenderer() {
      public MyCustomCellRenderer(Color selectedColor) {
        this.selectedColor = selectedColor;
       * This is the only method defined by ListCellRenderer.
       * We just reconfigure the Jlabel each time we're called.
      public java.awt.Component getListCellRendererComponent(
             JList list,
             Object value,   // value to display
             int index,      // cell index
             boolean iss,    // is the cell selected
             boolean chf)    // the list and the cell have the focus
         * The DefaultListCellRenderer class will take care of
         * the JLabels text property, it's foreground and background
         * colors, and so on.
        super.getListCellRendererComponent(list, value, index, iss, chf);
         * We additionally set the JLabels color properties here,
         * but only for the cell that is currently selected (highlighted).
        if(iss) {
          setForeground(selectedColor);
          this.setBackground(selectedBG);
        return this;

  • Large DB Performance problems when updating schemas

    Hi,
    I'm facing performance problems updating the schema of large databases in SQLServer 2008 R2 and I can't find a proper solution. I would have thought that this is a fairly common problem so here it goes.
    I have a database which is about 700Gb in size. I am going to detail 2 different issues:
    EXAMPLE 1: CHANGING A FIELD TYPE
    In that Database I have a table with the schema detailed below as Table_TB. This table contains several million records. As you can see there is a column of type TEXT (Comment_FD). What I am trying to do is changing  the column type to NVARCHAR(MAX) to
    remove the deprecated TEXT type and support UNICODE characters in that field.
    The command I am running is the following one:
    ALTER TABLE DBA.Table_TB ALTER COLUMN Comment_FD NVARCHAR(MAX)
    This operation takes several hours to complete.
    I tried the following:
    -Adding the new column to the same table and copying the data over
    -Creating a new entire table with the new field type modified and copy the data over
    -Exporting to disk the contents of the table, truncate the table and reimporting the data both with Management Studio and the bcp tool. 
    -When copying to a new table I made also tried removing the PK of the table to skip the overhead of creating an index. 
    -I also tried using a simple spd to copy the data over (to the column in the same table and the other table) in batches. 
    In ALL my tests I set the SQLServer Recovery model to Simple to skip as much as I can the overhead of generating logs.
    No matter what I do, the times to complete this operation seem to be unusable. 
    Please note that I am reducing this problem to its minimum expression. Can't say precisely how long the operation takes, but a script that contain 5 field type changes identical to that one in that and other two tables takes 7 days to complete!!! The REAL problem
    is that I have several other fields to which I need to change the type, and they currently amount to a total running time of 14 days!. And this is just changing a handful of fields in a handful of tables. At some point every string in the system will need
    to be migrated to get unicode support, making this completely impracticable.
    **Based on smaller DBs in the same system I guesstimate this table will contain about 14M records and will be about 44Gb in size. 
    EXAMPLE 2: ADDING COLUMNS
    I have another table int the same DB, with a schema detailed below as Table_2_TB, and again several million records in it. I am trying to add a colum using the following SQL:
    ALTER TABLE DBA.Table2_TB ADD strFiDatasourceName_FD VARCHAR(64) NOT NULL DEFAULT ''
    This operation takes a bit more than 7 hours to complete.
    **Based on smaller DBs in the same system I guesstimate this table will contain about 54M records, and a size of 98Gb.
    QUESTIONS:
    ---->Am I doing something wrong, or is there any way to optimize either the SQL or the SQLServer configuration to speed this up?
    ---->Are these performance levels normal at all when dealing with databases of this size? 
    ---->Anyone out there with experience on DBs of this size?
    ---->Does Microsoft offer some kind of service (cloud?) to make structural changes in large Dbs?
    Thanks a lot for your help in advance!
    This is the schema for the first table:
    CREATE TABLE [DBA].[Table_TB](
    [BranchCode_FD] [char](2) NOT NULL,
    [FolderNo_FD] [int] NOT NULL,
    [DateTime_FD] [datetime] NULL,
    [Staff_FD] [char](3) NULL,
    [Action_FD] [varchar](25) NULL,
    [Comment_FD] [text] NULL,
    [Team_FD] [varchar](8) NULL,
    [Group_FD] [varchar](8) NULL,
    [PopUpDate_FD] [smalldatetime] NULL,
    [nRecordID_FD] [smallint] NOT NULL,
    [nFiFoldItemID_FD] [smallint] NOT NULL,
    PRIMARY KEY CLUSTERED
    [BranchCode_FD] ASC,
    [FolderNo_FD] ASC,
    [nRecordID_FD] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    ALTER TABLE [DBA].[Table_TB] ADD CONSTRAINT [DF__Table_TB__DateTime] DEFAULT ('1980-01-01') FOR [DateTime_FD]
    GO
    ALTER TABLE [DBA].[Table_TB] ADD CONSTRAINT [DF__Table_TB__PopUp__096A45D7] DEFAULT ('1980-01-01') FOR [PopUpDate_FD]
    GO
    ALTER TABLE [DBA].[Table_TB] ADD DEFAULT ((-1)) FOR [nFiFoldItemID_FD]
    GO
    This is the schema for the second table:
    CREATE TABLE [DBA].[Table2_TB](
    [strBBranchCode_FD] [char](2) NOT NULL,
    [lFFoldNo_FD] [int] NOT NULL,
    [nFiFoldItemID_FD] [smallint] NOT NULL,
    [strFiType_FD] [char](3) NOT NULL,
    [dtFiCreateDate_FD] [smalldatetime] NOT NULL,
    [strFiBookingRef_FD] [varchar](32) NOT NULL,
    [strFiBookingRefDayMonth_FD] [varchar](5) NOT NULL,
    [strFiBookedVia_FD] [varchar](50) NOT NULL,
    [bFiInterfaced_FD] [smallint] NOT NULL,
    [nFiSortOrder_FD] [smallint] NOT NULL,
    [strFiCreateStaffCode_FD] [char](3) NOT NULL,
    [strPcProductCode_FD] [varchar](5) NOT NULL,
    [dtFiStartDateTime_FD] [smalldatetime] NOT NULL,
    [lFiFinanVendID_FD] [int] NOT NULL,
    [lFiItinVendID_FD] [int] NOT NULL,
    [dtFiVendBalDueDate_FD] [smalldatetime] NOT NULL,
    [dtFiVendDepositDueDate_FD] [smalldatetime] NOT NULL,
    [strFiStatus_FD] [varchar](2) NOT NULL,
    [bFiTransFeeHasBeenApplied_FD] [smallint] NOT NULL,
    [bFiATOLTypeMan_FD] [smallint] NOT NULL,
    [nFiATOLType_FD] [smallint] NOT NULL,
    [strCcClassCode_FD] [varchar](10) NOT NULL,
    [strFiStartPointCode_FD] [varchar](5) NOT NULL,
    [strFiEndPointCode_FD] [varchar](5) NOT NULL,
    [strFiAirlineCode_FD] [varchar](3) NOT NULL,
    [strFiVendDocNo_FD] [varchar](16) NOT NULL,
    [dtFiIssueDate_FD] [smalldatetime] NOT NULL,
    [strFiDiscReasonCode_FD] [varchar](3) NOT NULL,
    [nFiLastFoldPricingID_FD] [smallint] NOT NULL,
    [strFiPrintingNote_FD] [text] NOT NULL,
    [strFiNonPrintingNote_FD] [text] NOT NULL,
    [dtFiStatusExpiryDate_FD] [smalldatetime] NOT NULL,
    [strFiClientFreqTravellerNo_FD] [varchar](20) NOT NULL,
    [strFiRouteNo_FD] [varchar](5) NOT NULL,
    [nFiNumBum_FD] [smallint] NOT NULL,
    [dtFiEndDateTime_FD] [smalldatetime] NOT NULL,
    [strFiFareBase_FD] [varchar](15) NOT NULL,
    [strFiInterfaceItemID_FD] [varchar](15) NOT NULL,
    [strFiEndPointLoc_FD] [varchar](255) NULL,
    [strFiStartPointLoc_FD] [varchar](255) NULL,
    [strMcMealCode_FD] [varchar](5) NOT NULL,
    [strFiSeatNote_FD] [text] NOT NULL,
    [strFiMealNote_FD] [text] NOT NULL,
    [strFiAirCraftType_FD] [varchar](5) NOT NULL,
    [strFiJourneyTime_FD] [varchar](8) NOT NULL,
    [strFiCheckInMins_FD] [varchar](10) NOT NULL,
    [lFiJourneyDist_FD] [int] NOT NULL,
    [nFiNumStop_FD] [smallint] NOT NULL,
    [strFiBaggageAllow_FD] [varchar](15) NOT NULL,
    [strFiIssueStaffCode_FD] [varchar](20) NOT NULL,
    [dtFiDispatchDate_FD] [smalldatetime] NOT NULL,
    [strFiDispatchStaffCode_FD] [varchar](3) NOT NULL,
    [strDmDispatchCode_FD] [varchar](2) NOT NULL,
    [lfFiVendDepositDueAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiRateCode_FD] [varchar](50) NOT NULL,
    [strFiRatePlan_FD] [varchar](2) NOT NULL,
    [strFiCabinNo_FD] [varchar](8) NOT NULL,
    [strFiMileage_FD] [varchar](10) NOT NULL,
    [strFiStartPointLocTelNo_FD] [varchar](40) NULL,
    [strFiBookingGuarantee_FD] [varchar](60) NOT NULL,
    [strFiSpecialRemarks_FD] [varchar](250) NULL,
    [strFiCxnCondition_FD] [varchar](100) NOT NULL,
    [bFiFlyDrive_FD] [smallint] NOT NULL,
    [strFiConfNo_FD] [varchar](32) NOT NULL,
    [lFiLinkID_FD] [int] NOT NULL,
    [strFiCategory_FD] [varchar](15) NOT NULL,
    [nFiNumRoom_FD] [smallint] NOT NULL,
    [nFiNumDay_FD] [smallint] NOT NULL,
    [nFiSaleFoldItemID_FD] [smallint] NOT NULL,
    [bFiRefundItem_FD] [smallint] NOT NULL,
    [strFiFareSavingCode_FD] [varchar](2) NOT NULL,
    [lfFiFareSavingAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiRateNote_FD] [text] NOT NULL,
    [strFiDiscCode_FD] [varchar](20) NOT NULL,
    [strFiReqDispatchMethodCode_FD] [varchar](2) NOT NULL,
    [dtFiReqDispatchDateTime_FD] [smalldatetime] NOT NULL,
    [nFiReqDispatchVoucherType_FD] [smallint] NOT NULL,
    [nFiLastFoldItemDetailID_FD] [smallint] NOT NULL,
    [nFiNumConjunction_FD] [smallint] NOT NULL,
    [lfFiBSPFrgnBaseFareAmt_FD] [decimal](17, 2) NOT NULL,
    [lfFiBSPBaseFareAmt_FD] [decimal](17, 2) NOT NULL,
    [lfFiBSPTaxDiscrepancy_FD] [decimal](17, 2) NOT NULL,
    [lfFiBSPPenaltyFeeAmt_FD] [decimal](17, 2) NOT NULL,
    [nFiRegion_FD] [smallint] NOT NULL,
    [strFiOpenTktNo_FD] [varchar](16) NOT NULL,
    [strFiTktSource_FD] [varchar](3) NOT NULL,
    [strFiJourneyType_FD] [varchar](3) NOT NULL,
    [strFiTktType_FD] [varchar](3) NOT NULL,
    [strFiInterfaceNameRemark_FD] [varchar](50) NULL,
    [nFiATOLIssuedStatus_FD] [smallint] NOT NULL,
    [strFiFareSavingFareBase_FD] [varchar](13) NOT NULL,
    [strFiPaxType_FD] [varchar](3) NOT NULL,
    [strFiActualCarrier_FD] [varchar](2) NOT NULL,
    [strFiNetRemitType_FD] [varchar](1) NOT NULL,
    [strFiFareConstruction_FD] [text] NOT NULL,
    [lfFiBSPTotVATAmt_FD] [decimal](17, 2) NOT NULL,
    [bFiNetFare_FD] [smallint] NOT NULL,
    [strFiTourCode_FD] [varchar](50) NOT NULL,
    [strFiSuppFOPInfo_FD] [varchar](255) NOT NULL,
    [lfFitBSPPublishedCommPerc_FD] [decimal](12, 6) NOT NULL,
    [strFiBSPFareCurrCode_FD] [varchar](3) NOT NULL,
    [strFiTktIssueIataNo_FD] [varchar](8) NOT NULL,
    [lfFiFareOfferedSavingAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiFareOfferedSavingCode_FD] [varchar](2) NOT NULL,
    [strFiDesc_FD] [varchar](8000) NOT NULL,
    [lfFiBSPFareBuyDiscrepancyAmt_FD] [decimal](17, 2) NOT NULL,
    [bFiNoPrintOnItin_FD] [smallint] NOT NULL,
    [dtFiStatusCodeChangeDateTime_FD] [smalldatetime] NOT NULL,
    [bFiNoPrintIfAllPricingsZeroCustAmt_FD] [smallint] NOT NULL,
    [strFiFareSavingFareBaseLow_FD] [varchar](13) NOT NULL,
    [lfFiFareSavingLowAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiBrochureCode_FD] [varchar](8) NOT NULL,
    [bFiVendPayDepositNow_FD] [smallint] NOT NULL,
    [bFiVendPayBalanceNow_FD] [smallint] NOT NULL,
    [strFiBankBranchCode_FD] [varchar](2) NOT NULL,
    [strFiOperatingAirlineCode_FD] [varchar](2) NOT NULL,
    [strFiFarePassengerTypeCode_FD] [varchar](3) NOT NULL,
    [strFiAssociatedFarePricingInfoID_FD] [varchar](15) NOT NULL,
    [bFiVerificationReq_FD] [smallint] NOT NULL,
    [dtFiLastVerifiedDateTime_FD] [datetime] NOT NULL,
    [lFiLastVerifiedLevel_FD] [int] NOT NULL,
    [lFiLastVerifiedWithCount_FD] [int] NOT NULL,
    [dtFiTktingStatusChangeDateTime_FD] [smalldatetime] NOT NULL,
    [strFiTktingInformation_FD] [text] NOT NULL,
    [strFiTktingStatus_FD] [varchar](2) NOT NULL,
    [lfFiBSPFareSellDiscrepancyAmt_FD] [decimal](17, 2) NOT NULL,
    [lfFiBSPTaxBuyDiscrepancyAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiTktingBatchID_FD] [varchar](15) NOT NULL,
    [dtFiTktingBatchDateTime_FD] [smalldatetime] NOT NULL,
    [lIplPolicyLevelID_FD] [int] NOT NULL,
    [strFiTktingDescription_FD] [varchar](1000) NOT NULL,
    [strFiTktingDataVersion_FD] [varchar](10) NOT NULL,
    [strFiSourceTktingSystem_FD] [varchar](20) NOT NULL,
    [strFiOthPtsPmtCode_FD] [varchar](3) NOT NULL,
    [bFiManualPtsEntry_FD] [smallint] NOT NULL,
    [strFiEndorsement_FD] [varchar](500) NOT NULL,
    [strFiOwnedByStaffCode_FD] [char](3) NOT NULL,
    [strFiThirdPartyTrackingID_FD] [varchar](25) NOT NULL,
    [strFiAdditionalPrintingNote_FD] [text] NULL,
    [bFiOverridePrintingNote_FD] [smallint] NOT NULL,
    [lfFiCarbonOffsetWeightAmt_FD] [decimal](17, 2) NOT NULL,
    [strFiCancellationPolicyNote_FD] [text] NULL,
    [bFiPEProcessed_FD] [smallint] NOT NULL,
    [bFiActingAsAgentFor_FD] [smallint] NOT NULL,
    [nFiOriginalBuyingBasis_FD] [smallint] NOT NULL,
    [bFiIsOpenSegment_FD] [smallint] NOT NULL,
    [nFiCreateSource_FD] [smallint] NOT NULL,
    [strFiBookingSourceInvoiceNo_FD] [varchar](7) NOT NULL,
    [strFiGDSPaxTypeCode_FD] [varchar](8) NOT NULL,
    [strFiNetFareGDSAccountCode_FD] [varchar](8) NOT NULL,
    [strFiPOSID_FD] [varchar](50) NOT NULL,
    [bFiIsPOSEditable_FD] [smallint] NOT NULL,
    [lfFiCustExchRate_FD] [decimal](16, 8) NOT NULL,
    [lfFiCustFareSavingLowAmt_FD] [decimal](17, 2) NOT NULL,
    [lfFiCustFareSavingAmt_FD] [decimal](17, 2) NOT NULL,
    [lfFiCustFareOfferedSavingAmt_FD] [decimal](17, 2) NOT NULL,
    [bFiCCItemPayableToBranch_FD] [smallint] NOT NULL,
    [dtFiExternalAccountingDate_FD] [smalldatetime] NOT NULL,
    [strFiSourceSystemBookResponseText_FD] [text] NOT NULL,
    [bFiIsConnection_FD] [smallint] NOT NULL,
    [bFiIsPEFoldLevelItem_FD] [smallint] NOT NULL,
    [nFiReqdEndorsedConjTktType_FD] [smallint] NOT NULL,
    [bFiEndorsedConjTktDetailIsManual_FD] [smallint] NOT NULL,
    [strFiReqdEndorsedConjTktDetailText_FD] [varchar](30) NOT NULL,
    [lFiLastTktingTemplateID_FD] [int] NOT NULL,
    [dtFiBookedDate_FD] [smalldatetime] NOT NULL,
    [strFiTktingVerificationWarning_FD] [varchar](1000) NOT NULL,
    [strFiTktingVerificationError_FD] [varchar](1000) NOT NULL,
    [strFiTktingError_FD] [varchar](1000) NOT NULL,
    [strFiCustomerAccountingData00_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData01_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData02_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData03_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData04_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData05_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData06_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData07_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData08_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData09_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingDataNote_FD] [varchar](100) NOT NULL,
    [strFiCustomerAccountingData10_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData11_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData12_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData13_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData14_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData15_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData16_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData17_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData18_FD] [varchar](50) NOT NULL,
    [strFiCustomerAccountingData19_FD] [varchar](50) NOT NULL,
    [nFiFlightBasis_FD] [smallint] NOT NULL,
    [lFiStartPointVendID_FD] [int] NOT NULL,
    [lFiEndPointVendID_FD] [int] NOT NULL,
    [lCtID_FD] [int] NOT NULL,
    [strFiContractCode_FD] [varchar](25) NOT NULL,
    [strFiContractPeriodCode_FD] [varchar](50) NOT NULL,
    PRIMARY KEY CLUSTERED
    [strBBranchCode_FD] ASC,
    [lFFoldNo_FD] ASC,
    [nFiFoldItemID_FD] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    ALTER TABLE [DBA].[Table2_TB] WITH NOCHECK ADD FOREIGN KEY([nFiReqDispatchVoucherType_FD])
    REFERENCES [DBA].[VoucherTypes_TB] ([nVtCode_FD])
    GO
    ALTER TABLE [DBA].[Table2_TB] WITH NOCHECK ADD FOREIGN KEY([strPcProductCode_FD], [strFiType_FD])
    REFERENCES [DBA].[ProductCodes_TB] ([ProductCode_FD], [Type_FD])
    GO
    ALTER TABLE [DBA].[Table2_TB] WITH NOCHECK ADD FOREIGN KEY([strBBranchCode_FD], [lFFoldNo_FD])
    REFERENCES [DBA].[Folder_TB] ([BranchCode_FD], [FolderNo_FD])
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strBB__44AB0736] DEFAULT ('') FOR [strBBranchCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lFFol__459F2B6F] DEFAULT (0) FOR [lFFoldNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiFo__46934FA8] DEFAULT ((-1)) FOR [nFiFoldItemID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__478773E1] DEFAULT ('') FOR [strFiType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiC__487B981A] DEFAULT ('1980-01-01') FOR [dtFiCreateDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__strFiBookingRef] DEFAULT ('') FOR [strFiBookingRef_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__4A63E08C] DEFAULT ('') FOR [strFiBookingRefDayMonth_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__strFiBookedVia_FD] DEFAULT ('') FOR [strFiBookedVia_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiIn__4C4C28FE] DEFAULT (0) FOR [bFiInterfaced_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiSo__4D404D37] DEFAULT ((-1)) FOR [nFiSortOrder_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__4E347170] DEFAULT ('') FOR [strFiCreateStaffCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__strPcProductCode] DEFAULT ('') FOR [strPcProductCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiS__501CB9E2] DEFAULT ('1980-01-01') FOR [dtFiStartDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lFiFi__5110DE1B] DEFAULT ((-1)) FOR [lFiFinanVendID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lFiIt__52050254] DEFAULT ((-1)) FOR [lFiItinVendID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiV__52F9268D] DEFAULT ('1980-01-01') FOR [dtFiVendBalDueDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiV__53ED4AC6] DEFAULT ('1980-01-01') FOR [dtFiVendDepositDueDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__54E16EFF] DEFAULT ('') FOR [strFiStatus_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiTr__55D59338] DEFAULT (0) FOR [bFiTransFeeHasBeenApplied_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiAT__56C9B771] DEFAULT (0) FOR [bFiATOLTypeMan_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiAT__57BDDBAA] DEFAULT (0) FOR [nFiATOLType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strCc__58B1FFE3] DEFAULT ('') FOR [strCcClassCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__strFiStartPointCode] DEFAULT ('') FOR [strFiStartPointCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__strFiEndPointCode] DEFAULT ('') FOR [strFiEndPointCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__5B8E6C8E] DEFAULT ('') FOR [strFiAirlineCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__5C8290C7] DEFAULT ('') FOR [strFiVendDocNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiI__5D76B500] DEFAULT ('1980-01-01') FOR [dtFiIssueDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__5E6AD939] DEFAULT ('') FOR [strFiDiscReasonCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiLa__5F5EFD72] DEFAULT ((-1)) FOR [nFiLastFoldPricingID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__605321AB] DEFAULT ('') FOR [strFiPrintingNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__614745E4] DEFAULT ('') FOR [strFiNonPrintingNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiS__623B6A1D] DEFAULT ('1980-01-01') FOR [dtFiStatusExpiryDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__632F8E56] DEFAULT ('') FOR [strFiClientFreqTravellerNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6423B28F] DEFAULT ('') FOR [strFiRouteNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_TB__nFiNumBum] DEFAULT ((-1)) FOR [nFiNumBum_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiE__660BFB01] DEFAULT ('1980-01-01') FOR [dtFiEndDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__67001F3A] DEFAULT ('') FOR [strFiFareBase_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__67F44373] DEFAULT ('') FOR [strFiInterfaceItemID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__68E867AC] DEFAULT ('') FOR [strFiEndPointLoc_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__69DC8BE5] DEFAULT ('') FOR [strFiStartPointLoc_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strMc__6AD0B01E] DEFAULT ('') FOR [strMcMealCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6BC4D457] DEFAULT ('') FOR [strFiSeatNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6CB8F890] DEFAULT ('') FOR [strFiMealNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6DAD1CC9] DEFAULT ('') FOR [strFiAirCraftType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6EA14102] DEFAULT ('') FOR [strFiJourneyTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__6F95653B] DEFAULT ('') FOR [strFiCheckInMins_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lFiJo__70898974] DEFAULT (0) FOR [lFiJourneyDist_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiNu__717DADAD] DEFAULT (0) FOR [nFiNumStop_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7271D1E6] DEFAULT ('') FOR [strFiBaggageAllow_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7365F61F] DEFAULT ('') FOR [strFiIssueStaffCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiD__745A1A58] DEFAULT ('1980-01-01') FOR [dtFiDispatchDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__754E3E91] DEFAULT ('') FOR [strFiDispatchStaffCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strDm__764262CA] DEFAULT ('') FOR [strDmDispatchCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiV__77368703] DEFAULT (0) FOR [lfFiVendDepositDueAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__782AAB3C] DEFAULT ('') FOR [strFiRateCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__791ECF75] DEFAULT ('') FOR [strFiRatePlan_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7A12F3AE] DEFAULT ('') FOR [strFiCabinNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7B0717E7] DEFAULT ('') FOR [strFiMileage_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7BFB3C20] DEFAULT ('') FOR [strFiStartPointLocTelNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7CEF6059] DEFAULT ('') FOR [strFiBookingGuarantee_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7DE38492] DEFAULT ('') FOR [strFiSpecialRemarks_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__7ED7A8CB] DEFAULT ('') FOR [strFiCxnCondition_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiFl__7FCBCD04] DEFAULT (0) FOR [bFiFlyDrive_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__00BFF13D] DEFAULT ('') FOR [strFiConfNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lFiLi__01B41576] DEFAULT ((-1)) FOR [lFiLinkID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__02A839AF] DEFAULT ('') FOR [strFiCategory_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiNu__039C5DE8] DEFAULT (0) FOR [nFiNumRoom_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiNu__04908221] DEFAULT (0) FOR [nFiNumDay_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiSa__0584A65A] DEFAULT ((-1)) FOR [nFiSaleFoldItemID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiRe__0678CA93] DEFAULT (0) FOR [bFiRefundItem_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__076CEECC] DEFAULT ('') FOR [strFiFareSavingCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiF__08611305] DEFAULT (0) FOR [lfFiFareSavingAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__0955373E] DEFAULT ('') FOR [strFiRateNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__0A495B77] DEFAULT ('') FOR [strFiDiscCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__0B3D7FB0] DEFAULT ('') FOR [strFiReqDispatchMethodCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__dtFiR__0C31A3E9] DEFAULT ('1980-01-01') FOR [dtFiReqDispatchDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiRe__0D25C822] DEFAULT (0) FOR [nFiReqDispatchVoucherType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiLa__0F0E1094] DEFAULT ((-1)) FOR [nFiLastFoldItemDetailID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiNu__100234CD] DEFAULT (0) FOR [nFiNumConjunction_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiB__10F65906] DEFAULT (0) FOR [lfFiBSPFrgnBaseFareAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiB__11EA7D3F] DEFAULT (0) FOR [lfFiBSPBaseFareAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiB__12DEA178] DEFAULT (0) FOR [lfFiBSPTaxDiscrepancy_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiB__13D2C5B1] DEFAULT (0) FOR [lfFiBSPPenaltyFeeAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiDo__14C6E9EA] DEFAULT (0) FOR [nFiRegion_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__15BB0E23] DEFAULT ('') FOR [strFiOpenTktNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__16AF325C] DEFAULT ('') FOR [strFiTktSource_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__17A35695] DEFAULT ('') FOR [strFiJourneyType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__18977ACE] DEFAULT ('') FOR [strFiTktType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__198B9F07] DEFAULT ('') FOR [strFiInterfaceNameRemark_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__nFiAT__1A7FC340] DEFAULT ((-1)) FOR [nFiATOLIssuedStatus_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__1B73E779] DEFAULT ('') FOR [strFiFareSavingFareBase_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__1C680BB2] DEFAULT ('') FOR [strFiPaxType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__1D5C2FEB] DEFAULT ('') FOR [strFiActualCarrier_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__1E505424] DEFAULT ('') FOR [strFiNetRemitType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__1F44785D] DEFAULT ('') FOR [strFiFareConstruction_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiB__20389C96] DEFAULT (0) FOR [lfFiBSPTotVATAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__bFiNe__212CC0CF] DEFAULT (0) FOR [bFiNetFare_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__2220E508] DEFAULT ('') FOR [strFiTourCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__23150941] DEFAULT ('') FOR [strFiSuppFOPInfo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFit__24092D7A] DEFAULT (0) FOR [lfFitBSPPublishedCommPerc_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__24FD51B3] DEFAULT ('') FOR [strFiBSPFareCurrCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__25F175EC] DEFAULT ('') FOR [strFiTktIssueIataNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__lfFiF__27D9BE5E] DEFAULT (0) FOR [lfFiFareOfferedSavingAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD CONSTRAINT [DF__Table2_T__strFi__251D4D44] DEFAULT ('') FOR [strFiFareOfferedSavingCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiDesc_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lfFiBSPFareBuyDiscrepancyAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiNoPrintOnItin_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-1-1') FOR [dtFiStatusCodeChangeDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiNoPrintIfAllPricingsZeroCustAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiFareSavingFareBaseLow_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lfFiFareSavingLowAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiBrochureCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiVendPayDepositNow_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiVendPayBalanceNow_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiBankBranchCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiOperatingAirlineCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiFarePassengerTypeCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiAssociatedFarePricingInfoID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiVerificationReq_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-01-01') FOR [dtFiLastVerifiedDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lFiLastVerifiedLevel_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lFiLastVerifiedWithCount_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-01-01') FOR [dtFiTktingStatusChangeDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingInformation_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingStatus_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lfFiBSPFareSellDiscrepancyAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lfFiBSPTaxBuyDiscrepancyAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingBatchID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-01-01') FOR [dtFiTktingBatchDateTime_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((-1)) FOR [lIplPolicyLevelID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingDescription_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingDataVersion_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiSourceTktingSystem_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiOthPtsPmtCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiManualPtsEntry_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiEndorsement_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiOwnedByStaffCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiThirdPartyTrackingID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiAdditionalPrintingNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiOverridePrintingNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [lfFiCarbonOffsetWeightAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCancellationPolicyNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiPEProcessed_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiActingAsAgentFor_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [nFiOriginalBuyingBasis_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiIsOpenSegment_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [nFiCreateSource_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (' ') FOR [strFiBookingSourceInvoiceNo_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiGDSPaxTypeCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiNetFareGDSAccountCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiPOSID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT (0) FOR [bFiIsPOSEditable_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [lfFiCustExchRate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [lfFiCustFareSavingLowAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [lfFiCustFareSavingAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [lfFiCustFareOfferedSavingAmt_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [bFiCCItemPayableToBranch_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-01-01') FOR [dtFiExternalAccountingDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiSourceSystemBookResponseText_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [bFiIsConnection_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [bFiIsPEFoldLevelItem_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [nFiReqdEndorsedConjTktType_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [bFiEndorsedConjTktDetailIsManual_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiReqdEndorsedConjTktDetailText_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((-1)) FOR [lFiLastTktingTemplateID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('1980-01-01') FOR [dtFiBookedDate_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingVerificationWarning_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingVerificationError_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiTktingError_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData00_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData01_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData02_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData03_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData04_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData05_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData06_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData07_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData08_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData09_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingDataNote_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData10_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData11_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData12_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData13_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData14_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData15_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData16_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData17_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData18_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiCustomerAccountingData19_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((0)) FOR [nFiFlightBasis_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((-1)) FOR [lFiStartPointVendID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((-1)) FOR [lFiEndPointVendID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ((-1)) FOR [lCtID_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiContractCode_FD]
    GO
    ALTER TABLE [DBA].[Table2_TB] ADD DEFAULT ('') FOR [strFiContractPeriodCode_FD]
    GO

    Hi,
    I just wanted to summarize the conclusions we got here, in case it helps someone else.
    For the case of the ALTER statement:
    First we analyzed the query performance and found out that the query was I/O bound. A handful of useful scripts can be found on the links below. Some high values on PAGEIOLATCH wait times suggested some memory pressure, so we incremented the amount of memory
    dedicated to the server up to 32GB. This single change was one of the most effective ones and reduced the query execution time by about 40%-50%. I guess SQLServer needs less paging to perform the operation when it can load more pages in memory at the same
    time.
    We run more tests tweaking some other mentioned variables like the server maxDOP, which made in fact the query slower the higher the value we set. The initial server config was set with auto CPU affinity, but I/O mask affinity set to the first 4 CPUs, and
    we found out that setting it to ALL AUTO perform faster for some reason.
    After some analysis made by Microsoft on the diagnostics/metrics data, the only interesting finding was that a couple of the storage volumes were performing slightly slower than the rest causing a bit of a bottleneck. We recommended the customer to look
    into it with their storage team, but even with those fixed, we won't expect the query to run much faster.
    No other tweaks have been found useful to speed up the ALTER statement. Basically it comes up to how fast you I/O subsystem is, and how much can SQLServer can cache in memory. No other suggestion has been made by Microsoft, and they've advised that any
    other tweaked query (split the column addition and the constraints for example) is going to perform worse than the plain and simple alter statement.
    On the NVARCHAR type problem:
    As it was suggested by Erland Sommarskog, SQLServer 2014 Enterprise edition performed this operation about 40% faster than SQLServer 2008 R2 with the same hardware specs.
    At the moment upgrading the customer infrastructure is not an option for us, so we don't have a proper solution to accomplish this in a workable time frame on SQLServer 2008. 
    The strategy that we found might be the best option was the one suggessted by E. Sommarskog, bind our code for reading access to a COALESCED calculated column, and writing on the new converted NVARCHAR column. Schedule a batch job in the backgroud
    to migrate all the data over time to the new column, and finally remove the old column.
    Thanks a lot everyone for your help.
    David.
    Useful links:
    http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/
    http://msdn.microsoft.com/en-us/library/ms189768.aspx
    http://rusanu.com/2014/02/24/how-to-analyse-sql-server-performance/

  • How to pass the Bound values to VO SQL Query during runtime?

    Hi all,
    I have the following sql query;
    SELECT NOTIFICATION_ID
    FROM xx_NOTIFICATION_V
    WHERE COMPANY = NVL(:1, COMPANY)
    AND INITIATOR = NVL(:2,INITIATOR)
    AND PAYGROUP = NVL(:3, PAYGROUP)
    AND SOURCE = NVL(:4, SOURCE)
    AND SUPPLIER_NAME = NVL(:5,SUPPLIER_NAME)
    AND TRX_DATE BETWEEN NVL(:6,TRX_DATE)
    AND NVL(:7,TRX_DATE)      
    If i click GO button on search page then it pass the selected Poplists values as a Bound values to VO Sql query at runtime after this I store the search results in a Table(Which is created by using New Region Wizard).
    I want to pass the Bind parameter values to VO SQL query during runtime and :1,:2,:3,:4,:5,:6,:7 values are coming from Poplists.
    I search through forum I found many threads regarding Bind Values but those all are passing ID's only not String(Varchar) values.
    How to pass the Character values to VO Query.
    Please anyone help me on this.
    Thanks in Advance.

    Hi All,
    Below one is the recent error Stack.
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT NOTIFICATION_ID
    , COMPANY
    , PAYGROUP
    , SOURCE
    , INITIATOR
    , SUPPLIER_NAME
    , TRX_DATE
    FROM LMG_NOTIFICATION_V
    WHERE COMPANY = NVL(:1,COMPANY)
    AND INITIATOR = NVL(:2,INITIATOR)
    AND PAYGROUP = NVL(:3,PAYGROUP)
    AND SOURCE = NVL(:4,SOURCE)
    AND SUPPLIER_NAME = NVL(:4,SUPPLIER_NAME)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:544)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processRequest(OAHeaderBean.java:366)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:328)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:920)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1536)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:363)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:330)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2121)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1562)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
         at OA.jspService(OA.jsp:45)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01008: not all variables bound
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:627)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:515)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3289)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:1207)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4146)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:567)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:537)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:614)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3253)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3240)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:411)
         at oracle.apps.fnd.framework.webui.OAWebBeanBaseTableHelper.queryData(OAWebBeanBaseTableHelper.java:960)
         at oracle.apps.fnd.framework.webui.beans.table.OATableBean.queryData(OATableBean.java:717)
         at ls.oracle.apps.fnd.wf.worklist.webui.WorklistFindCO.processRequest(WorklistFindCO.java:78)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:518)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processRequest(OAHeaderBean.java:366)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:328)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:920)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1536)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:363)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:330)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2121)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1562)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
         at OA.jspService(OA.jsp:45)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01008: not all variables bound
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:627)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:515)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3289)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:1207)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4146)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:567)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:537)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:614)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3253)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3240)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:411)
         at oracle.apps.fnd.framework.webui.OAWebBeanBaseTableHelper.queryData(OAWebBeanBaseTableHelper.java:960)
         at oracle.apps.fnd.framework.webui.beans.table.OATableBean.queryData(OATableBean.java:717)
         at ls.oracle.apps.fnd.wf.worklist.webui.WorklistFindCO.processRequest(WorklistFindCO.java:78)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:518)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processRequest(OAHeaderBean.java:366)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:328)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:920)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1536)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:363)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:330)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2121)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1562)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
         at OA.jspService(OA.jsp:45)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    Please anyone help me on this?
    Thanks

  • Spatial Queries are CPU bound and show very heavy use of query buffers

    Hi,
    Spatial Queries:
    When using tkprof to analyse spatial queries it is clear that
    there are implicit queries being done by Oracle spatial which
    use vast amounts of buffers, and seem unable to cache basic
    information from query to query - thus resulting in our machine
    being CPU bound when stress testing Oracle Spatial, for example
    the example below shows how information which is fixed for a
    table and not likely to change very often is being retrieved
    inefficiently (note the 26729 query buffers being used to do 6
    executions of what should be immediately available!!!):
    TKPROF: Release 8.1.7.0.0 - Production on Tue Oct 16 09:43:38
    2001
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    SELECT ATTR_NO, ATTR_NAME, ATTR_TYPE_NAME, ATTR_TYPE_OWNER
    FROM
    ALL_TYPE_ATTRS WHERE OWNER = :1 AND TYPE_NAME = :2 ORDER BY
    ATTR_NO
    call count cpu elapsed disk query rows
    Parse 6 0.00 0.01 0 0 0
    Execute 6 0.00 0.01 0 0 0
    Fetch 6 0.23 0.41 0 26729 5
    total 18 0.23 0.43 0 26729 5
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    0 SORT ORDER BY
    0 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 TABLE ACCESS FULL ATTRIBUTE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 INDEX UNIQUE SCAN (object id 255)
    578 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    578 TABLE ACCESS CLUSTER USER$
    578 INDEX UNIQUE SCAN (object id 11)
    289 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN (object id 11)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    and again:
    SELECT diminfo, nvl(srid,0)
    FROM
    ALL_SDO_GEOM_METADATA WHERE OWNER = 'NAGYE' AND TABLE_NAME =
    NLS_UPPER('TILE_MED_LINES_MBR') AND '"'||COLUMN_NAME||'"'
    = '"GEOM"'
    call count cpu elapsed disk query
    current rows
    Parse 20 0.00 0.04 0
    0 0 0
    Execute 20 0.00 0.00 0
    0 0 0
    Fetch 20 0.50 0.50 0 5960
    100 20
    total 60 0.50 0.54 0 5960
    100 20
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE) (recursive depth: 1)
    Rows Row Source Operation
    1 FILTER
    2 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE
    2 INDEX RANGE SCAN (object id 24672)
    1 UNION-ALL
    1 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS
    1 TABLE ACCESS FULL OBJ$
    1 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN (object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX UNIQUE SCAN (object id 33)
    0 INDEX UNIQUE SCAN (object id 33)
    0 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    1 TABLE ACCESS CLUSTER SEG$
    1 INDEX UNIQUE SCAN (object id 9)
    1 TABLE ACCESS CLUSTER TS$
    1 INDEX UNIQUE SCAN (object id 7)
    1 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    0 FILTER
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    0 TABLE ACCESS FULL USER$
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX RANGE SCAN (object id 34)
    0 INDEX UNIQUE SCAN (object id 97)
    0 INDEX UNIQUE SCAN (object id 96)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    Note: The actual query being performed is:
    select a.id, a.geom
    from
    tile_med_lines_mbr a where sdo_relate(a.geom,mdsys.sdo_geometry
    (2003,NULL,
    NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') =
    'TRUE'
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.08 0.08 0 4 0 0
    Fetch 5 1.62 21.70 0 56 0 827
    total 7 1.70 21.78 0 60 0 827
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    827 TABLE ACCESS BY INDEX ROWID TILE_MED_LINES_MBR
    828 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    827 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'TILE_MED_LINES_MBR'
    828 DOMAIN INDEX OF 'TILE_MLINES_SPIND'
    CPU: none, I/O: none
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 92
    Execute 1 0.00 0.00 0 22
    Fetch 1 0.00 0.00 38 236
    total 3 0.00 0.00 38 350
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    12 TABLE ACCESS BY INDEX ROWID ROADELEMENT_MBR
    178 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    12 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'ROADELEMENT_MBR'
    178 DOMAIN INDEX OF 'RE_MBR_SPIND'
    CPU: none, I/O: none
    Can Oracle improve the performance of Oracle spatial by
    improving the implementation so as to perform alternative
    implicit queries so as not to use these vast amounts of memory?
    Cheers
    Alex Eadie

    Hi Ravi,
    Thankyou for your reply.
    Here are some more details for you:
    Yes the queries are cached in that it gets its data from RAM and
    not from disk however the number of buffers used internally by
    Oracle RDBMS/Spatial is rather large and results in significant
    CPU usage (namely > 5000 per query or >40MByte). Which I'm sure
    you'd agree? Those numerous internal queries taking >10ms CPU
    time each, which is culmulative.
    A single real of ours query of will take between 180ms and 580ms
    depending on the number of results returned.
    An example query is:
    select a.id, a.geom
    from tile_med_lines_mbr a where sdo_relate
    (a.geom,mdsys.sdo_geometry
    (2003,NULL, NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') = 'TRUE'
    Our 500Mhz PC Server database can only execute 3 processes
    running these queries simultaneously to go to 100% CPU loaded.
    The disk is hardly utilized.
    The data is the main roads in Sydney, Australia.
    The tables, data and indexes were created as shown below:
    1.     Create the Oracle tables:
    create table tile_med_nodes_mbr (
         id     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    create table tile_med_lines_mbr (
         id     number not null,
         fromid     number not null,
         toid     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    2.     Use the sqlldr Oracle loader utility to load the data
    into Oracle.
    % sqlldr userid=csiro_scats/demo control=nodes.ctl
    % sqlldr userid=csiro_scats/demo control=lines.ctl
    3.     Determine the covering spatial extent for the tile
    mosaic and use this to create the geometry metadata.
    % sqlplus
    SQLPLUS>     set numw 12
    SQLPLUS>     select min(xl), min(yl), max(xh), max(yh)
         from (select xl, yl, xh, yh
              from tile_med_nodes_mbr union
              select xl, yl, xh, yh
              from tile_med_lines_mbr);
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_NODES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_LINES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    4.     Validate the data loaded:
    create table result
    (UNIQ_ID number, result varchar2(10));
    execute sdo_geom.validate_layer
    ('TILE_MED_NODES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    truncate table result;
    execute sdo_geom.validate_layer
    ('TILE_MED_LINES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    drop table result;
    5.     Fix any problems reported in the result table.
    6.     Create a spatial index, use the spatial index advisor to
    determine the sdo_level.
    create index tile_mlines_spind on
    tile_med_lines_mbr (geom) indextype is
    mdsys.spatial_index parameters
    ( 'sdo_level=7,initial=1M,next=1M,pctincrease=0');
    7.     Analyse table:
    analyze table TILE_MED_LINES_MBR compute statistics;
    8.     Find the spatial index table name:
    select sdo_index_table, sdo_column_name
    from user_sdo_index_metadata
    where sdo_index_name in
    (select index_name
    from user_indexes
    where ityp_name = 'SPATIAL_INDEX'
    and table_name = 'TILE_MED_LINES_MBR');
    9.     Analyse spatial index table:
    analyze table TILE_MLINES_SPIND_FL7$
    compute statistics;
    I hope this helps.
    Cheers
    Alex Eadie

  • Parallel Query Error - 1008 Not All Variables Bound

    Using DB 10g Enterprise Edition Release 10.2.0.1.0
    I am trying to query a table in SQL plus using a bind variable. When I run the query the first time it fails but if I run it again, it works! See the following :
    SQL> var b1 number;
    SQL> exec :b1 := 133348;
    PL/SQL procedure successfully completed.
    SQL> set autot on exp stat
    SQL> select 2 from pension_details where party_id = :b1;
    select 2 from pension_details where party_id = :b1
    ERROR at line 1:
    ORA-12801: error signaled in parallel query server P001
    ORA-01008: not all variables bound
    SQL> /
    2
    2
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
    1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
    Card=1 Bytes=11)
    If I add a hint suppressing the parallel index option, then it works first time :
    1* select /*+NOPARALLEL_INDEX (PENSION_DETAILS) */ 4 from pension_details where party_id = :b1
    SQL> /
    4
    4
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=11)
    1 0 INDEX (RANGE SCAN) OF 'PENDTL_PK' (INDEX (UNIQUE)) (Cost=2
    Card=1 Bytes=11)
    Can anyone shed any light on why this happens or what I need to check on the table and index? I have tried to replicate this on a different table (and a different db) with the parallel option on both the table and index but it works fine!

    Seeing as there have been no replies, I thought I would update my own thread!
    It turns out this is a bug that has been fixed in 11i. The fix has been back-ported to certain versions/os's.
    I will post the bug reference (it is on Metalink somewhere!) later. In the meantime, a workaround is to use the noparrallel_index hint.

  • Out bound proxy query.

    Hi all,
    I am a ABAP -er.
    I am facing one issue .
    Scenario : When ever user create some Business partner or change some Bp , that thing will trigger in GIS system through PI.
    We developed proxy & outbound proxy program .
    It is working fine after running the program every time.
    My query : When ever user create some Business partner or change some Bp ,how it will trigger every times ? will we need to run Z program every times or any other PI Or BASIS or abap things or batch job to be done ?
    Thanks
    Kumar Gourav.

    Hi Gourav,
    You need to call the outbound proxy method inside user exit or enhancement spot for BP transaction code, normally you need to look for user exits or enhancement spots for save button on BP transaction.
    When ever user clicks on save button the use exit will get trigger and the proxy method also called and send the data to PI.
    I hope i clarified your question.
    Regards,
    Praveen.

  • How to bound the query  fields value to the arry?

    My code:
    <cfloop query="test">
    <cfset data=ArrayNew(1)>
    <cfloop from="1" to="#listlen(test.columnlist)#"
    index="x">
    Here i wanted to give the filed value to the data[x],but only
    the column name was gived,not the filed value,how to do it?
    <cfset
    FiledName=#test.GetMetaData().getColumnName(JavaCast( 'int', x
    ))#>
    <cfset data[x]= #FiledName#>
    </cfloop>
    </cfloop>
    Thanks a lot.

    and why would you need to convert a query result into an
    array?
    are you familiar with array notation?
    yourqueryname.columnname[rownumber]
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Cfselect bound to query w/o initial value?

    Here's the code:
    <cfinvoke component="Functions"
    method="GetAllStewards"
    returnVariable="AllStewards"
    </cfinvoke>
    <cfselect Name="NewSteward"
    query="AllStewards"
    display="FullName"
    value="MemberID"
    required="No"   
    selected=" "
    </cfselect>
    Here's the problem:  The cfselect always "contains" the MemberID value for the first steward in the list.
    Here's what I want:  If the values in the cfselect are not clicked, I want the value in NewSteward to be blank.  How do I do this?

    Introduce a blank option, then use the attribute queryPosition to position the items from the query relative to the blank option
    <cfselect  Name="NewSteward"
    query="AllStewards"
    display="FullName"
    value="MemberID"
    required="No"
    queryPosition="below">
    <option value="your_default_value"></option>
    </cfselect>

Maybe you are looking for

  • Increased Slide Size resolution and everything shrunk

    after I set it back to 800x600 (the res I want). Is there a way to get it all to show at the original size that I had prior to the change? Thanks, John iMac 24"   Mac OS X (10.4.9)  

  • Nokia 5320 and bh-105

    Phone nokia 5320 and nokia bluetooth headset bh-105 not fond evribody. P.S. help my pliz. samsung 3010 fond  nokia bluetooth headset bh-105 all rait/

  • Plugin Exception

    I have managed to successfully deploy the sample plugin code. After working with it a while I have decided that I wuld like to use this technology in my current project. To begin the development process I created a session bean modeled after the samp

  • Any fix for iSO6.0.2 battery problem?

    Any Fix yet?

  • Slide transition not smooth when using a continue button

    Hopefully someone can help me with this issue. I'm not new to Captivate, but cannot resolve this one on my own. I'm using CS4. I've created a Captivate movie that has a combination of software simulation and simple slides that have a caption on them.