DB2 | table shows incorrect columns

Has anybody encountered this? Using IDM 6 and 7.
I have configured the database table adapter to connect to a DB2 table. The DB2 version is 7.1, so we are forced to use Type 2 jdbc driver (and not type 4).
I then installed db2connect and configured a dsn and connected to that dsn in the database table adapter wizard. It all connects fine and I can see all tables views etc that are accessible to the user configured inside the dsn.
It so happens that there are 2 tables with the same name with different owners (creators). But the dropdown listing all tables do not show the table owners - only table names are shown. I can see my table listed twice, but regardless of which one I pick, the same columns are shown and it happens to belong to the wrong table - not the table I am interested in.
Is there some setting I can use somewhere (dbconnect or java) where I can force jdbc to pull a specific table (owned by a specific user)? Or is there any workaround at all for this?
Thanks

Thanks.. - OK this is what I ended up doing. Since the user did not own ANY tables (or objects) in DB2, I created a database table resource for a local mysql table.
Then I went into debug and changed the type back to DB2 and put the correct table name with the owner prefix. Of course I had to change the name to something more appropriate. I removed the id and imported back into IDM. Now I had a new resource - I click on this and edited the schema to include the other columns. And it works fine so far.
best regards

Similar Messages

  • Fact table showing incorrect quantity measure

    Hi,
    I have a scenario where i have a fact table with multiple rows and two quantity fields.  My source system holds sales by "package" which can contain any number of components.  The grain of my invoice table is component level.  See
    structure below:
    PACKAGE1
    - Component1 - each package contains 2 of these
    - Component2 - each package contains 1 of these
    So if i am reporting a sale of PACKAGE1, for a quantity of 2 - component1 had a total sales quantity of 4 and component2 has a total sales quantity of 2.  However the package was only sold 2 of, but because of the sum aggregation, i see a total quantity
    sold for PACKAGE1  of 6, but it should only show 2 at that level.  I have looked at semi-additive measures but am unsure of how this would work in this scenario, or which option would work best for me here.
    My fact table has 2 rows, each of which reference the component as one dimension and the package as another dimension.
    As a workaround, I have created a calculation to divide the quantity by the number of package components (so it would show a 1 for each of the component lines in my fact table), but then the sales quantities of the components reported are incorrect.
    What is the best approach for this?  
    Thanks in advance,
    Dom

    Hi Dominic, 
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Thanks,
    Simon Hou
    TechNet Community Support

  • UD Datasource Proposal Tab Shows Incorrect Column Names

    I created a UD datasource in BW and the "Proposal" tab showed me the correct column names for the table I had selected.  A couple of column names were then changed for this table in the source system but they are not showing up in the "Proposal" tab (the old column names are still there).  I refreshed and reactivated the source system in BW but it didn't work.  Any ideas on how to get the new column names to show up in the "Proposal" tab?  Thanks for any help on this.

    hi,
    check with the following steps you carried out in the ud data source creation.
    You are in the DataSource tree in the Data Warehousing Workbench.
           1.      Select the application components in which the DataSource is to be created and choose Create DataSource.
           2.      In the next screen, enter a technical name for the DataSource, select the type of the DataSource and choose Copy.
    The DataSource maintenance screen appears.
           3.      Go to the General tab page.
                                a.      Enter descriptions for the DataSource (short, medium, long).
                                b.      If necessary, specify if the DataSource builds an initial non-cumulative and supplies potentially duplicate data records within a request.
           4.      Go to the Extraction tab page.
                                a.      Define the delta method for the DataSource.
                                b.      Specify whether you want the DataSource to support direct access to data.
                                c.      UD Connect does not support real-time data acquisition.
                                d.      The system displays Universal Data Connect (Binary Transfer) as the adapter for the DataSource.
    Choose Properties if you want to display the general adapter properties.
                                e.      Select the UD Connect source object.
    The connection to the UD Connect source is established. All source objects that are available in the selected UD Connect source can be selected using input help. Source objects can be multi-dimensional storage or relational objects.
           5.      Go to the Proposal tab page.
    The system displays the elements of the source object (for JDBC for example fields, or for XMLA and ODBO characteristics and key figures) and creates a mapping proposal for DataSource fields. The mapping proposal is based on the similarity of the names of the source object element and DataSource field and the compatibility of the respective data types.
    Note that source object elements can have a maximum of 90 characters. Both upper and lower case are supported.
                                a.      Check the mapping and change the proposed mapping as required. Assign the non-assigned source object elements to free DataSource fields.
    You cannot map elements to fields if the types are incompatible. The system produces an error message in this case.
                                b.      Under Copy to Field List, select the fields that you want to transfer to the field list for the DataSource. All fields are selected by default.
           6.      Maintain the Fields tab page.
    Here you edit the fields that you transferred to the field list of the DataSource from the Proposal tab page.
                                a.      Under Transfer, specify the decision-relevant DataSource fields that should be available for extraction and transferred to BI.
                                b.      If required, change the values for the key fields of the source.
    These fields are generated as a secondary index in the PSA. This is important in ensuring good performance for data transfer process selections, in particular with semantic grouping.
                                c.      If required, change the data type for a field.
                                d.      Specify whether the source provides the data in the internal or external format.
                                e.      If you choose an External Format, ensure that the output length of the field (external length) is correct. Change the entries, as required.
                                  f.      If required, specify a conversion routine that converts data from an external format into an internal format.
                                g.      Select the fields for which you want to be able to set selection criteria when you schedule a data request using an InfoPackage. Data for this type of field is transferred in accordance with the selection criteria specified in the InfoPackage.
                                h.      Choose the selection options (such as EQ, BT) that you want to be available for selection in the InfoPackage.
                                  i.      Under Field Type, specify whether the data to be selected is language-dependent or time-dependent, as required.
    Note
    If you did not transfer the field list from a proposal, you can define the fields of the DataSource directly. Choose Insert Row and enter a field name. You can specify InfoObjects in order to define the DataSource fields. Under Template InfoObject, specify InfoObjects for the fields of the DataSource. This allows you to transfer the technical properties of the InfoObjects into the DataSource field.
    Entering InfoObjects here does not equate to assigning them to DataSource fields.  Assignments are made in the transformation. When you define the transformation, the system proposes the InfoObjects you entered here as InfoObjects that you might want to assign to a field.
           7.      Check, save and activate the DataSource.
           8.      Go to the Preview tab page.
    If you select Read Preview Data, the number of data records you specified in your field selection is displayed in a preview.
    This function allows you to check whether the data formats and data are correct.
    Result
    The DataSource is created and added to the DataSource overview for the UD Connect source system in the application component in the Data Warehousing Workbench. When you activate the DataSource, the system generates a PSA table and a transfer program.
    You can now create an InfoPackage. You define the selections for the data request in the InfoPackage. The data can be loaded into the entry layer of the BI system, the PSA. Alternatively you can access the data directly if the DataSource allows direct access and you have a VirtualProvider in the definition of the data flow.
    http://help.sap.com/saphelp_nw70/helpdata/en/bc/ed1640b7b6dd5fe10000000a155106/frameset.htm
    hope this give you an idea
    regards
    harikrishna N

  • Cfquery of MVS DB2 table containing BLOB Column

    Using ColdFusion MX 7. Able to convert the BLOB into a string
    when the data source is in UDB (Our development Database) however
    when the data source changes to MVS DB2 (Staging and Production
    Databases) the template no longer renders the data to the screen.
    code snippet from template:
    <cfoutput>
    <cfquery name="acct_selector"
    datasource="#request.ds#">
    SELECT DISTINCT * from dbo.Account
    where cf_token = '#cftoken#' and cf_pid = '#cfid#' and
    account_system!='I'
    order by account_num
    </cfquery>
    <cfset acctname=arraynew(1)>
    <cfset acctnumb=arraynew(1)>
    <cfset i=1>
    <cfloop query="acct_selector">
    <cfset acctname
    =account_name>
    <cfset acctnumb=account_num>
    <cfset i=i+1>
    </cfloop>
    <cfset
    rpdt1=dateformat(sDate,"yyyy-mm-dd")&"-00.00.00.000000">
    <cfset
    rpdt2=dateformat(sDate,"yyyy-mm-dd")&"-23.59.59.999999">
    <cfquery name="reflexReport"
    datasource="#request.db2#">
    select
    reflex_rpt_id,account_num,report_tmstp,sequence_num,fk_report_typ,report_txt
    from #request.db2qlfr#.gzb005_reflex_rpt
    where (<cfloop
    query="acct_selector">account_num='#account_num#' or
    </cfloop> account_num='0')
    and report_tmstp>='#rpdt1#' and
    report_tmstp<='#rpdt2#'
    </cfquery>
    </cfoutput>
    <cfif reflexReport.recordcount gt 0>
    ... (report headers built here) ....
    <cfoutput query="reflexReport">
    <cfset rpdata=tostring(report_txt)>
    I know there are rows being selected into the cursor because
    the headers are displaying on the browser page. If no rows are
    selected the process pops up an alert window tells the user there
    is no report data for the date selected.

    Well, I'm not familiar with DB2, but I've done a little
    research and from what I've found is that to resolve the problem
    you must do a rebind on the database. This typically happens if a
    Fixpack was applied. More information about rebinding bind files
    can be found in the Fixpakreadme.txt
    I hope this is applicable and does the trick for you.

  • How to Sort Dimension in Pivot Table via Order Column which is changing like Factual values

    Hi,
    Recently in of our product offerings we got stuck on this following question:
    How to Sort Dimension based on the Order Value which Keeps Changing with Factual Values??
    We have a data source laid out as (example)
    In the above the “Order” columns are changing per
    Company/(DimensionA) for DimesnsionB.
    Instead what we want is: (But only if we can get the following result without putting the “Order” Column in the “Values” Section. 
    If there are any configurations that we can make to our power pivot model for the similar data set so that the
    DimesnionB in this case can be sorted by the Order column, would be greatly helpful to us. 
    Sample File:
    http://tms.managility.com.au/query_example.xlsx
    Thanks
    Amol 

    Hi Amol,
    According to your description, you need to sort dimension members in Pivot Table via order column, and you don't want the order column show on the Pivot table, right?
    Based on my research, we can sort the data on the Pivot table based on one of the columns in that table, and we cannot sort the data based on the columns that not existed on the Pivot table. So in your scenario, to achieve your requirement, you can
    add the column to pivot table and hide it.
    https://support.office.com/en-gb/article/Sort-data-in-a-PivotTable-or-a-PivotChart-report-49efc50a-c8d9-4d34-a254-632794ff1e6e
    Regards,
    Charlie Liao
    TechNet Community Support

  • How do I create a header in the response table for a column I want to use that is not on the form it

    Example: My form has 10 fillable questions.  The Response table uses 10 columns to show the answers to those questions.  I would like to use 3 more columns to record internal information.  How do I insert the header titles?

    Hi,
    You can go to Responses view tab, focus on your last column header and then click menu Table->Add Column After. Or you click + button at the end of table - refer below image.
    I am not clear your question "How do I insert the header titles?" Do you mean you want to use your form title as data value in each cell in the column? If yes, you can set formula in the column following below steps.
    1. Click +Add a Row button
    2. Focus on the cell on column L (I assume you want to set your formular on this column).
    3. Input ="your form title" into the cell
    Then after you received a submission, the form title would display in the related cell in each row.
    Hope it will help you.
    Thanks,
    Ying

  • Set operations & tables with different columns

    I have a problem. I have 3 tables - Countries, Locations & Departments. I want to output the country_id and country_name from the countries tables for countries that have no departments. Locations has country_id and location_id columns and departments has location_id and department_id columns. All is in Database 11g. I can produce a table which gives me the locations with departments or without departments as follows:
    select location_id from locations intersect select location_id from departments;
    This gives me a list of locations with departments. Conversely I can get a list of locations without departments as follows:
    select location_id from locations minus select location_id from departments;
    However, to combine this output with the countries table I need to produce country_id in the output. However, when I try to add country_id to my code from above as follows:
    select country_id, location_id from locations intersect select to_char(null), location_id from departments;
    I get no rows found. I understand why. There is no intersection between country_id in locations and the null output from departments (where there is no country_id column). Alternatively, if I try as follow:
    select country_id, location_id from locations minus select to_char(null), location_id from departments;
    I get rows with every country_id whether they have departments or not. Again, I understand why. I am essentially subtracting nothing (the to_char(null) from departments) from the country_id column in locations and getting the entire country_id column as output.
    How can I use set operations to produce the country_id column? I also do not want to show the location_id problem.
    This problem is repeated when I try for the final country_id, country_name final output. The countries table has these columns. However, the locations table does not have the country_name column. It only has the country_id column. So a query such as this one:
    select country_id, country_name from countries intersect country_id, to_char(null) from locations;
    presents me with the same problem as above. The country_id column intersects nicely, but the country_name file does not intersect as it does not exist in the locations table. Again, how can I use set operations to produce the country_id and country_name columns.

    Hi,
    the method I outlined for you above should be fine. It doesn't matter that there are one-to-many relationships which may cause repeated output rows; set operations (except for UNION ALL ) always return distinct rows.
    Can you do a query on the countries table, that shows all countries?
    Can you do a query involving all 3 tables inner-joined, that shows the countries that are related to locations and departments? (Repeated rows are okay.)
    Then you can do a MINUS, to get only the countries that are not related to departments.
    If you get stuck, post a little sample data (CREATE TABLE and INSERT statements), the results you want from tha data, your best attemptat a query, and a description of the problem (including the full error message, if any).

  • Which table show port number of R12 application?

    Hi,
    Which table show R12 application port number ?
    Like FND_NODES shows node details.
    Thanks

    Hi,
    You can get those details from the following tables:
    FND_NODES
    FND_TNS_ALIASES
    FND_TNS_LISTENERS
    FND_TNS_ALIAS_SETS
    FND_TNS_LISTENER_PORTS
    FND_TNS_ALIAS_DESCRIPTIONS
    FND_TNS_ALIAS_ADDRESS_LISTS
    For more details about the tables/columns, please refer to eTRM.
    Regards,
    Hussein

  • Where statement on two different tables with same column name

    Hello,
    I have 2 financial tables:
    tblincome, tblexpenses
    in each table I have column name "monthPayed" (have values of all the months of the year).
    I would like to create a balance view table that will show me the financial status for the Q1 (for example).
    I have a column totalIncome and totalExpended respectively.
    I've create a view table that shows me the financial balance at the moment but I want it to be devide to Quarters of the year...
    Regards

     
    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Where is the code you already tried? Or are you so lazy, so rude or so privileged that you did not do anything for yourself? 
    In fact that silly “tbl-” prefix is so bad that it has a name! It is called Tibbling and Phil Factor even wrote a humor article on bad programmers that use it. 
    Your narrative is vague; it sounds like this is the DDL: 
    CREATE TABLE Incomes
    (payment_month CHAR(10) NOT NULL PRIMARY KEY,
     income_amt DECIMAL(12,2) NOT NULL
      CHECK (income_amt > 0.00),
    CREATE TABLE Expenses
    (payment_month CHAR(10) NOT NULL PRIMARY KEY,
     expense_amt DECIMAL(12,2) NOT NULL
      CHECK (expense_amt > 0.00),
    >> in each table I have column name "monthPayed" (have values of all the months of the year). <<
    I hope not! 2014 has not gotten to September, November or December yet! And the ISO-11179 data element name should be “payment_month”; but it is still wrong! An expense is not a payment! An income is not a payment! 
    >> I would like to create a balance view table that will show me the financial status for the Q1 (for example). <<
    Report Period Table
    Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
    The report period table gives a name to a range of dates that is common to the entire enterprise. 
    CREATE TABLE Something_Report_Periods
    (something_report_name CHAR(10) NOT NULL PRIMARY KEY
       CHECK (something_report_name LIKE <pattern>),
     something_report_start_date DATE NOT NULL,
     something_report_end_date DATE NOT NULL,
      CONSTRAINT date_ordering
        CHECK (something_report_start_date <= something_report_end_date),
    etc);
    These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
    data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
    Now figure it out for yourself, show us what effort you put into this, then we will help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Not showing the column name

    Hi
    I am using jdev 11.1.1.3
    .i i dragged an adf table from data control.it has got 3 columns.i changed the name of first column as Lang grades.when i run that it is showing the column name as lang grades.then in that table two fields r mandatory.so in the property inspector i put the show required as true.but after that on running it is not showing the column name as lang grades.there is only the star sign for showing the attribute as required only.

    Hi,
    not enough information. So from your description, a column that is not marked required on its cell renderer component is not displayed at runtime. I am not aware of such a problem and suggest to try a later version of 11g R1 (11.1.1.6) to see if this reproduces. This allows you to exclude a probelm with 11.1.1.3 only
    Frank

  • JDBC Receiver adapter Error for insert into DB2 table

    Hi all,
    I want to insert data into a DB2 table on AS400 via a Receiver JDBC adapter.
    The communication channel seems to be ok but when I try to send the message, I obtain the following message on the adapter monitoring :
    Error: TransformException error in xml processor class, rollback:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'GIK.GDT01' (structure 'Statement'): java.sql.SQLException: La table GDT01 de la bibliothèque GIK est incorrecte pour cette opération.
    Could someone help me?
    In the communication channel I have seen we can choose "native SQL String" as message protocol.
    Do you think it could be a workaround for me? if yes, could someone send me an example about it?
    thanks a lot,
    Philippe

    Hi,
    Try to remove GIK.GDT01 in table tag of your XML structure and put GDT01 alone and see.
    The solution to your problem is found on this particular link.
    http://www.websina.com/bugzero/faq/exception-as400.html
    Tell me if it works
    Best regards,
    Felix

  • Customer age analysis showing incorrect aging

    Hi All
    We have a rather complicated scenario, we captured journals for customers some of the journals are back dated , so when we check the aging it  has incorrect info on some of the suppliers and others are showing correct info.
    I've checked the payment terms and they are set to 30 days (start from month end + 1 Month)
    Others are showing correct figures under correct columns and others are showing incorrect instead of showing under 0 -30 (correct) and then the others are showing 31 - 60..(incorrect)... they both belong to the same posting month.
    Regards
    Bongani Dlamini

    Hi Bongani Dlamini,
    Your question is not very clear to me.  Which customers are showing incorrect figures?  Any patterns have you notices?  What are the differences you could find it out?
    Thanks,
    Gordon

  • Table with some columns with result of a query

    Hi:
    I would like to show the result of a query in some colums. For example, if I have a table of cities and I get 6 cities in my query, show them in two rows of 3 columns.
    I had thought use a forEach component of ADF, but I have no get nothing.... ;(
    Any ideas???
    Thanks
    Message was edited by:
    ALF

    Hi again:
    My idea is, for example show 3 columns of a query. Let´s suposse that we have 9 rows in the result of a query. I know how to show them in the same colum but... How to separate them in diferent colums?
    Result of the query = 1,2,3,4,5,6,7,8,9
    I would like to show the results so that:
    Col1 Col2 Col3
    1--------2--------3
    4--------5--------6
    7--------8--------9
    Thanks
    Message was edited by:
    ALF

  • Show hidden columns in a JTable

    Hi,
    I have a requirement for hiding some columns of a JTable and showing them back based on user actions.
    I have gone through some topics about hiding columns. which can be done by table.removeColumn();
    But when I use table.addColumn(); it adds the column at the end of the table.It should add in the same location as the previous column.
    How to show /reveal the hidden column back?.

    * Hide_Columns.java
    * This code contains a table model that allows you to
    * specify the columns to be hidden in a boolean array.
    * To use the model:
    *       model = new MyTableModel(data, columnNames);
    *       table.setModel(model);
    * The most important method in the model is "getNumber()", which converts a column number
    * into the number corresponding to the data to be displayed.
    * Visible columns can be dynamically changed with
    * model.setVisibleColumns(0, column0.isSelected());
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Hide_Columns extends JFrame {
        public Hide_Columns() {
            setTitle("Hide columns");
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            model = new MyTableModel(data, columnNames);
            table.setModel(model);
            getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
            for( int i=0; i<4; i++ ){
                final JCheckBox columnX = new JCheckBox("Column "+i);
                columnX.setSelected(true);
                final int col = i;
                columnX.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        model.setVisibleColumns(col, columnX.isSelected());
                toolBar.add(columnX);
            getContentPane().add(toolBar, BorderLayout.NORTH);
            setSize(400,300);
            setLocationRelativeTo(null);
            model.addRow(new Object[]{null,null,null,null});
            model.setValueAt("test0",0,0);
            model.setValueAt("test1",0,1);
            model.setValueAt("test2",0,2);
            model.setValueAt("test3",0,3);
        public static void main(String args[]) { new Hide_Columns().setVisible(true); }
        private JTable table = new JTable();
        private  JToolBar toolBar = new JToolBar();
        private   MyTableModel model;
        /** This is the data of the table*/
        private  Vector<Object> data = new Vector<Object>();
        /** Column names */
        Vector<String> columnNames = new Vector<String>();{
            columnNames.addElement("0");
            columnNames.addElement("1");
            columnNames.addElement("2");
            columnNames.addElement("3");
    class MyTableModel extends DefaultTableModel {
        /** Shows which columns are visible */
        private   boolean[] visibleColumns = new boolean[4];{
            visibleColumns[0] = true;
            visibleColumns[1] = true;
            visibleColumns[2] = true;
            visibleColumns[3] = true;
        public MyTableModel(Vector<Object> data, Vector<String> columnNames){
            super(data, columnNames);
        protected void setVisibleColumns(int col, boolean selection){
            visibleColumns[col] = selection;
            fireTableStructureChanged();
         * This function converts a column number of the table into
         * the right number of the data.
        protected int getNumber(int column) {
            int n = column;    // right number
            int i = 0;
            do {
                if (!(visibleColumns)) n++;
    i++;
    } while (i < n);
    // When we are on an invisible column,
    // we must go on one step
    while (!(visibleColumns[n])) n++;
    return n;
    // *** METHODS OF THE TABLE MODEL ***
    public int getColumnCount() {
    int n = 0;
    for (int i = 0; i < 4; i++)
    if (visibleColumns[i]) n++;
    return n;
    public Object getValueAt(int row, int column) {
    return super.getValueAt(row, getNumber(column));
    public void setValueAt(Object obj, int row, int column) {
    super.setValueAt(obj, row, getNumber(column));
    public String getColumnName(int column) {
    return super.getColumnName(getNumber(column));

  • ODP OracleCommandBuilder. Updating a table including DATE columns.

    Hi
    I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
    I have created a test table (called DATETEST) with three columns:
    STRINGCOLUMN     VARCHAR2 10
    DATECOLUMN DATE
    NUMBERCOLUMN     NUMBER
    The STRINGCOLUMN is the primary key.
    Then I created a typed dataset that looks like this:
    STRINGCOLUMN     string
    DATECOLUMN string
    NUMBERCOLUMN     long
    This is the XML schema for the typed dataset:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
         <xs:element name="DateDS" msdata:IsDataSet="true">
              <xs:complexType>
                   <xs:choice maxOccurs="unbounded">
                        <xs:element name="DATETEST">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    And this is the test code:
    Dim connection As Oracle.DataAccess.Client.OracleConnection
    Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
    Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
    Dim sqlstring As String
    Dim data As New DateDS() 'Typed dataset
    Const ConnectionString As String = "User Id=............."
    Try
    'Connect to database
    connection = New OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New OracleCommand(sqlstring, connection)
    Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    Getting the data from the database is not a problem.
    The dataset contains the correct information.
    But updating the database is impossible.
    I get errors like:
    ORA-01861: literal does not match format string
    And if I don't specify a DATE format in the TO_CHAR statement I get this error:
    Concurrency violation: the UpdateCommand affected 0 records.
    I think I've tried everything.
    I've used the OracleGlobalization class, with the SetSessionInfo method.
    I've tried all different types of date conversions to make sure that
    the date format on the database is the same as in the dataset.
    I've tried to change the NLS parameters on the DB server and in the registry on the client.
    I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
    But it still doesn't work.
    The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
    A strange thing is that when I instead of using the ODP classes use
    the System.Data.OracleClient and its OracleCommandBuilder
    the code works perfectly without any errors.
    This is the test code that works:
    Dim connection As System.Data.OracleClient.OracleConnection
    Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
    Dim dbCommand As New System.Data.OracleClient.OracleCommand()
    Dim data As New DateDS()
    Dim sqlstring As String
    Const ConnectionString As String = "User Id=......."
    Try
    'Connect to database
    connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
    Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    My experience until this came up is that the ODP provider is better on everything
    than the microsoft Oracle provider so I don't want to switch unless I have to.
    Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
    I would be the happiest man on earth if someone had a solution :-)
    Erik

    Don't convert the dates to strings. Ever.
    The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
    Also in your typed dataset you should change the type from a string to a date.
    David

Maybe you are looking for

  • Java Script and LOV

    Hi * I used in an PL/SQL Packages, which creat an HTML Pages the folloing Portal funktion to open an LOV ! htp.print(''); The folloing Link open the LOV : htp.print(''); With the Netscape Navigator 4.75 is no problem, but the Internet Explorer 5 coul

  • Connecting and Updating External Database from SAP

    Connecting and Updating External Database from SAP How can i connect SAP Database to External database? How can i update external databas from SAP withouting using BI/BW, Workflow or Net Weaver? If anyone know please let me inform. Thanks in Advance.

  • How to catch the New-page in a report ?

    Hi , I would like to know how the following can be done. While printing a report,how can we identify the beginning of a new page so that we can put the header on start of every new page ? Thanks, Sandip.

  • Synced iPhone to iMac now apps don't work

    I synced my iPhone to my iMac today. I don't know what happened. Apps that were working no longer work. Software was updated. When I tap an app, the screen sort of blinks, then nothing.  I cannot access the apps. Can anyone help, please?

  • What if two service modules fail on a MDS 9513?

    Hello, We recently had a service module failure on one of our core MDS 9513 directors. It is fixed now but I was wondering what would happen if the second service module had failed as well a bit later... Will the director still function? All line car