Choice of database column types, part 2: float(53) (or BINARY_DOUBLE) versu

Original post in this series:
http://forum.java.sun.com/thread.jspa?threadID=629958
Issue #2: float(53) (or BINARY_DOUBLE) vs float(126)
The original database design uses float(126) for several floating point type columns. Conversation with one of the database guys involved reveals that this was not a particularly conscious choice, but came when migrating an earlier database which simply used float as the column type.
From my perspective as a Java programmer who needs to work with this data via JDBC, the choice of float(126) as a type is poor as it (a) is probably overkill, storing unneeded precision and thus wasting space (b) is unrepresentable as a Java double type unless truncation error is introduced (c) might be the cause of subtle bugs.
Point (a) needs no further explanation.
For point (b), note that oracle's float(53), not float(126), is the float type that best corresponds with Java's (IEEE 754) double type.
Unfortunately, float(53) is NOT exactly equivalent to Java's double: Oracle internally uses binary coded decimal to represent numbers (float is essentially an oracle number type with added restrictions), which will not be the same bits as Java's double format (for a reference, see http://builder.com.com/5100-6388-5224536.html). This means that there can be conversion and rounding issues even when you use float(53) (see http://www.stanford.edu/dept/itss/docs/oracle/9i/java.920/a96654/oraint.htm#1000888 which states "Performing mathematical manipulations of the data directly in SQL format avoids the loss of precision that occurs in converting between SQL and Java formats").
For point (c), here is an example of how I think that subtle bugs can be introduced. Suppose that you do a query and among the results is some floating point type, internally stored in the db as float(126) but which can only be represented in a normal computer language program by a double type, which is equivalent to a float(53). (No one wants to use a class like Java's BigDecimal if at all possible because it is very awkward to use and is extremely slow as well.) So truncation has to occur. Then suppose that the programmer wishes to use that floating point value, unmodified, as part of a subsequent query, say in an equals condition. But now it may not equal because the value in his program has lost information present in the original, so the query does not work as expected. Of course, for this scenario, one could query based on "approximately equal" instead of exactly equal. But that assumes that the programmer knows to do this, and then even if he does, it is a pain to write, may be a performance hit, and subjectivity is involved (e.g. in how much being off you will tolerate). So, if it is at all possible to reasonably avoid this, yuo want to.
It appears that Oracle 10g now offers the BINARY_DOUBLE type which DOES exactly correspond to Java's double type; see http://builder.com.com/5100-6388-5224536.html
What are people's thoughts on the points that I raise above: is using a float(126) a suboptimal design choice, or are there no significant issues?
Anyone have experience with the new BINARY_DOUBLE type? (Unfortunately, we are currently using Oracle 9i so this may not be an option for us.)

Original post in this series:
http://forum.java.sun.com/thread.jspa?threadID=629958
You could have posted it as a reply to that post. :)
It's difficult managing to keep multiple posts close together.

Similar Messages

  • SQL*loader support database columns Of Binary Double/Float

    Does SQL*loader support database columns Of Binary Double/Float when applying Direct Path?

    Why not use Google and find out for yourself.
    The first hit on Google is this
    Go see for yourself
    Regards
    FJ

  • Database Column Type for Rich Text Editor

    Hi,
    I have a page item as Rich Text Editor. Now I want to store the data in tables in the same format as user entered in the page item.
    What would be the database column type for that?
    Thanks,
    Mehabub

    Mehabub Sheikh wrote:
    I have a page item as Rich Text Editor. Now I want to store the data in tables in the same format as user entered in the page item.
    What would be the database column type for that?As usual, the answer is "It depends".
    In this case it depends on the nature and size of the content. For content up to 4000 bytes in length, use VARCHAR2 or NVARCHAR2 (depending on the DB character set and globalization requirements), for content of longer length use CLOB or NCLOB (again depending on DB characterset and your globalization requirements).
    Note the effect of DB character set on the number of characters you can store in a VARCHAR2 or NVARCHAR2 column, and the overhead of HTML tags generated by formatting in the Rich Text Editor.

  • Wrong XML OraDbType code for database column type CHAR

    Hi there!
    I have a strange issue with the XML retrieved from an Oracle DB. I'm using OraDB11g and my problem is described next:
    When I create a table with a CHAR type columns and get the XML from a query the returns a cursor with the table rows, I get the supposed right OraDbType code 104:
    Table creation:
    create table AA_Table1
    ID number(2,0) not null,
    ColumnA         char(1)                    null,
    ColumnB         char(1)   default 'S'   not null,
    constraint PK_AA_Table1
    primary key ( ID )
    tablespace "X"
    storage
    compress for all operations
    and the returned XML:
    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema id="o_ListaTable" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
    <xs:element name="o_ListTable" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="o_List" msprop:REFCursorName="REFCursor">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="ID" msprop:OraDbType="111" type="xs:short" minOccurs="0" />
    *<xs:element name="COLUMNA" msprop:OraDbType="104" type="xs:string" minOccurs="0" />*
    *<xs:element name="COLUMNB" msprop:OraDbType="104" type="xs:string" minOccurs="0" />*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    BUT...when I insert another column on the table, changing it, after that, I get a wrong OraDBType code on the returned XML for the new added column...
    Added new column:
    alter table AA_Table1 add ColumnC char(1) default 'S' not null;
    The returned XML is:
    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema id="o_ListaTable" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
    <xs:element name="o_ListTable" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="o_List" msprop:REFCursorName="REFCursor">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="ID" msprop:OraDbType="111" type="xs:short" minOccurs="0" />
    <xs:element name="COLUMNA" msprop:OraDbType="104" type="xs:string" minOccurs="0" />
    <xs:element name="COLUMNB" msprop:OraDbType="104" type="xs:string" minOccurs="0" />
    *<xs:element name="COLUMNC" msprop:OraDbType="126" type="xs:string" minOccurs="0" />*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    My question is: why is this OraDbType code different? Check that the same column type CHAR(1) NOT NULL DEFAULT 'S' is created on table create and the OraDbType is ok, so I think this can be a bug...Because of this, I cannot do a right XML parser to convert CHAR(1) columns in other type I want, in this case, to convert it to .Net bool type. My parser now is ignoring the OraDbType code 126, because this is also the code used for nvarchar2, and I won't convert nvarchar2 to bool.
    How can I solve this problem?
    Some additional tests I've done:
    Have also inserted new columns nullable/not nullable and with default value:
    alter table AA_Table1 add ColumnD char(1);
    alter table AA_Table1 add ColumnE char(1) not null;
    alter table AA_Table1 add ColumnF char(1) default 'S';
    And the returned XML was:
    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema id="o_ListTable" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
    <xs:element name="o_ListTable" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="o_Lista" msprop:REFCursorName="REFCursor">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="COLUMNA" msprop:OraDbType="104" type="xs:string" minOccurs="0" />
    <xs:element name="COLUMNB" msprop:OraDbType="104" type="xs:string" minOccurs="0" />
    <xs:element name="COLUMNC" msprop:OraDbType="126" type="xs:string" minOccurs="0" />
    *<xs:element name="COLUMND" msprop:OraDbType="104" type="xs:string" minOccurs="0" />*
    *<xs:element name="COLUMNE" msprop:OraDbType="104" type="xs:string" minOccurs="0" />*
    *<xs:element name="COLUMNF" msprop:OraDbType="104" type="xs:string" minOccurs="0" />*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    All OraDbTypes are right, except that one for the column not null and with default value. Any solution for this issue?
    If I change the type of the column that returns the wrong code (ColumnC) to CHAR(1) null default 'S' and then change it again to the original type CHAR(1) not null default 'S', I get the right ORaDbType code 104 as expcted and not the 126. This behaviour is strange - can this be an Oracle bug?
    I am using the following Oracle DLL and respective version:
    oci.dll (version 11.2.0.1)
    Oracle.DataAccess.dll (version 4.112.3.0)
    orannzsbb11.dll (version 11.0.0.1)
    oraocci11.dll (version 11.2.0.3)
    OraOps11w.dll (version 2.112.3.0)
    Edited by: 929091 on 23/Abr/2012 2:44

    Have you tried using minOccurs="1" ? Since the column is not null, it is guaranteed 1 value, correct?

  • Checking whether data exists in a BLOB type database column in Forms 6i

    I am developing an application regarding inventory of a plant's spare parts. I am storing photo (.bmp) of spares in the database in a column of BLOB type. Once user punches spare's code, form displays spares data on screen using EXECUTE_QUERY. At this stage I want to check whether picture (.bmp) data was found in BLOB type database column or not. I want to take action accordingly. How to check this. If it would be a numeric column, I would have checked NULL but NULL does not work with BLOB type coloumns.
    Pl. help.
    Thanks in anticipation.

    Did you look in the database documentation? The DBMS_LOB package has the method you need: getlength().
    This was more of a database question than a Forms question, so you'd probably have more luck with these types of questions on one of the other forums, like the database or SQL forums.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Pre populate an item with source type="Database Column"

    Hello gurus,
    How can I pre populate an item with source used "Always, replacing any..." and source type="Database Column"?
    I have a form that creates/updates rows in a table and when creating a new row I want to populate some of the fields based on some parameters from the previous page. How can I achieve this?
    I tried adding a conditional process when PK is null and populate the expected fields, but in the browser they are not shown with those values, even if I look into the session I can see that they have the values assigned in the process ?!?!?!
    Thanks in advance,
    Florin

    Florin,
    Use the Default Value item attribute. In you case, set the Default Value Type to Static Text with Session State Substitutions and enter your item using the &P1_ITEM_NAME. syntax in the Default value text box.
    Thanks,
    - Scott -

  • (Error due to database column of type Number)oracle.jbo.PiggybackException: JBO-28300

    Hi,
    I have deployed a BC4J component as an EJB on OC4J using JDeveloper. The database column of the table is of type Number, because of which I am encountering the eroor below. The application works fine if the database type is varchar or something else.
    I even tried changing the attribute of entity object to an integer, but this doesn't work.
    below is the error:
    oracle.jbo.PiggybackException: JBO-28300: Piggyback read error
    void oracle.jbo.JboException.<init>(java.lang.String)
    void oracle.jbo.PiggybackException.<init>(java.lang.String)
    void oracle.jbo.common.PiggybackInput.<init>(oracle.jbo.common.ObjectMarshaller, byte[])
    void oracle.jbo.client.remote.ApplicationModuleImpl.processPiggyback(byte[])
    void oracle.jbo.client.remote.ApplicationModuleImpl.executeQuery(int, boolean)
    void oracle.jbo.client.remote.RowSetImpl.executeQuery()
    void oracle.jbo.client.remote.ViewUsageImpl.executeQuery()
    void oracle.jbo.uicli.binding.JUIteratorBinding.executeQueryIfNeeded()
    void oracle.jbo.uicli.binding.JUFormBinding.executeIfNeeded()
    void oracle.jbo.uicli.jui.JUPanelBinding.executeIfNeeded()
    void fast.track.LYPanelUsermasterView.<init>(boolean)
    void fast.track.LYPanelUsermasterView.<init>()
    void fast.track.AppletUsermasterView.init()
    void fast.track.AppletUsermasterView.main(java.lang.String[])
    ## Detail 0 ##
    java.io.InvalidClassException: oracle.jbo.domain.Number; Local class not compatible: stream classdesc serialVersionUID=-7730629917230930297 local class serialVersionUID=-6507359405709672486
    void java.io.ObjectStreamClass.validateLocalClass(java.lang.Class)
    void java.io.ObjectStreamClass.setClass(java.lang.Class)
    java.io.ObjectStreamClass java.io.ObjectInputStream.inputClassDescriptor()
    java.lang.Object java.io.ObjectInputStream.readObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject()
    int java.io.ObjectInputStream.inputObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject()
    void oracle.jbo.common.PiggybackRowEntry.readObject(java.io.ObjectInputStream)
    java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
    boolean java.io.ObjectInputStream.invokeObjectReader(java.lang.Object)
    int java.io.ObjectInputStream.inputObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject()
    void oracle.jbo.common.PiggybackInput.<init>(oracle.jbo.common.ObjectMarshaller, byte[])
    void oracle.jbo.client.remote.ApplicationModuleImpl.processPiggyback(byte[])
    void oracle.jbo.client.remote.ApplicationModuleImpl.executeQuery(int, boolean)
    void oracle.jbo.client.remote.RowSetImpl.executeQuery()
    void oracle.jbo.client.remote.ViewUsageImpl.executeQuery()
    void oracle.jbo.uicli.binding.JUIteratorBinding.executeQueryIfNeeded()
    void oracle.jbo.uicli.binding.JUFormBinding.executeIfNeeded()
    void oracle.jbo.uicli.jui.JUPanelBinding.executeIfNeeded()
    void fast.track.LYPanelUsermasterView.<init>(boolean)
    void fast.track.LYPanelUsermasterView.<init>()
    void fast.track.AppletUsermasterView.init()
    void fast.track.AppletUsermasterView.main(java.lang.String[])
    Please help me out
    Thanks in advance
    null

    Hi Raman,
    This error is normally occured when there is a attribute mismatch.When you added new field in OAF page, associate this field to the new view attribute of the extended VO. It is always recommended to add this new attribute at the end
    Thanks
    Sandeep

  • How to retrieve view column type?

    I know how to retrieve column names and comments from
    table all_col_comments.But I don't know retrieving view column type.If somebody know please help.

    ALL_TAB_COLUMNS
    ALL_TAB_COLUMNS describes the columns of the tables, views, and clusters accessible to the current user. To gather statistics for this view, use the SQL ANALYZE statement or the DBMS_STATS package.
    Related Views
    DBA_TAB_COLUMNS describes the columns of all tables, views, and clusters in the database.
    USER_TAB_COLUMNS describes the columns of the tables, views, and clusters owned by the current user. This view does not display the OWNER column.
    Column Datatype NULL Description
    OWNER
    VARCHAR2(30)
    NOT NULL
    Owner of the table, view, or cluster
    TABLE_NAME
    VARCHAR2(30)
    NOT NULL
    Name of the table, view, or cluster
    COLUMN_NAME
    VARCHAR2(30)
    NOT NULL
    Column name
    DATA_TYPE
    VARCHAR2(30)
    Datatype of the column
    DATA_TYPE_MOD
    VARCHAR2(3)
    Datatype modifier of the column
    DATA_TYPE_OWNER
    VARCHAR2(30)
    Owner of the datatype of the column
    DATA_LENGTH
    NUMBER
    NOT NULL
    Length of the column in bytes
    DATA_PRECISION
    NUMBER
    Decimal precision for NUMBER datatype; binary precision for FLOAT datatype, null for all other datatypes
    DATA_SCALE
    NUMBER
    Digits to right of decimal point in a number
    NULLABLE
    VARCHAR2(1)
    Specifies whether a column allows NULLs. Value is N if there is a NOT NULL constraint on the column or if the column is part of a PRIMARY KEY.
    COLUMN_ID
    NUMBER
    NOT NULL
    Sequence number of the column as created
    DEFAULT_LENGTH
    NUMBER
    Length of default value for the column
    DATA_DEFAULT
    LONG
    Default value for the column
    NUM_DISTINCT
    NUMBER
    These columns remain for backward compatibility with Oracle7. This information is now in the TAB_COL_STATISTICS views. This view now picks up these values from HIST_HEAD$ rather than COL$.
    LOW_VALUE
    RAW(32)
    HIGH_VALUE
    RAW(32)
    DENSITY
    NUMBER
    NUM_NULLS
    NUMBER
    Number of nulls in the column
    NUM_BUCKETS
    NUMBER
    The number of buckets in histogram for the column
    Note: The number of buckets in a histogram is specified in the SIZE parameter of the SQL statement ANALYZE. However, Oracle does not create a histogram with more buckets than the number of rows in the sample. Also, if the sample contains any values that are very repetitious, Oracle creates the specified number of buckets, but the value indicated by this column may be smaller because of an internal compression algorithm.
    LAST_ANALYZED
    DATE
    The date on which this column was most recently analyzed
    SAMPLE_SIZE
    The sample size used in analyzing this column
    CHARACTER_SET_NAME
    VARCHAR2(44)
    The name of the character set: CHAR_CS or NCHAR_CS
    CHAR_COL_DECL_LENGTH
    NUMBER
    The length
    GLOBAL_STATS
    VARCHAR2(3)
    For partitioned tables, indicates whether column statistics were collected for the table as a whole (YES) or were estimated from statistics on underlying partitions and subpartitions (NO).
    USER_STATS
    VARCHAR2(3)
    Were the statistics entered directly by the user?
    AVG_COL_LEN
    NUMBER
    Average length of the column (in bytes)
    CHAR_LENGTH
    NUMBER
    Displays the length of the column in characters. This value only applies to the following datatypes:
    CHAR
    VARCHAR2
    NCHAR
    NVARCHAR
    CHAR_USED
    VARCHAR2(1)
    B | C. B indicates that the column uses BYTE length semantics. C indicates that the column uses CHAR length semantics. NULL indicates the datatype is not any of the following:
    CHAR
    VARCHAR2
    NCHAR
    NVARCHAR2
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2143.htm#1302694
    Joel P�rez

  • Test Database Column Value

    I want to change the parameter of the title based on the results of the returned query by testing the value of a specific database column. If the value of that column = 'XXXXX' then parameter of title is assigned to 'This type of Report', else, That type of Report.
    Can this be accomplished?

    Not exactly what I was looking for.Why not? What is the problem with that solution? It's very simple.
    P_STATUS := 'value of status column after query runs'That is not possible: you cannot assign a value in the after parameter form like that, because the query hasn't run yet.
    You can program (a part of) the query in the after parameter form to get p_status. If you have a complicated query, I wouldn't suggest that. Is there a simple way to get p_status without running the whole query that you defined in the data model?
    Edited by: InoL on May 9, 2011 2:04 PM

  • How to create a variance on data that exists iIn only one database column

    How to create a variance on data that exists iIn only one database column?
    I'm trying to create a calculation to show the difference between the budgets for two different years in a Discoverer crosstab query.
    I'm using the lag function to repeat the value of a column for the current year and the year before.

    Lag and lead seems to be the only choice and they work excellent. Checkout the new 10g Database features. There is new SQL modal clause which might give additional and powerful analytics but in this case lag and lead should be sufficient.
    regards
    http://www.infocaptor.com/workbook-dump.php

  • Is there a way to Insert Data into a Lookup Column Type on a SharePoint List Destination in SSIS?

    Greetings.
    I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
    http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
    However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
    is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
    I have read and re-read the SharePoint SSIS Adapters 2011.docx from
    http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
    "Looking Up Values in a SharePoint List
    If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
    data in the lookup column on the ";#" delimiter to separate the ID value from the description.
    If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
    I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
    I have several of these lookup column types pointing to several different lists.
    Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
    Thank you.
    My errors are:
    Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
    Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
    inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will

    I have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
    In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
    Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
    column --> SharePoint displays “4005” and successfully links to the lookup list.
    Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
    with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
    and things work well.
    There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
    1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
    2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
    3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
    Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
    SELECT
    pps.SSNm,
    pps.file_updated,
    pps.Employee_id,
    /* pps.CheckDistNm,*/
    Check_Distribution_id = COALESCE( d.ID, 0 ),
    pps.Job_nbr,
    pps.SeqNm,
    pps.action_eff_dt,
    Fund_id = COALESCE( f.id, 0 ),
    Appropriation_id = COALESCE( ap.id, 0 ),
    ActionCode_id = COALESCE( ac.id, 0 ),
    SpecNumber_id = COALESCE( jt.ID, 0 ),
    pps.Employee_id,
    /* pps.Fund,
    pps.Approp,
    pps.Unit,*/
    Unit_id = COALESCE( u.ID, 0 ),
    PosNm,
    PosCode,
    pps.LastName,
    pps.FirstName,
    pps.MI
    FROM
    x_PPS.aReportVw.pps_screens_active AS pps
    LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
    pps.CheckDistNm = d.Check_Distribution
    LEFT OUTER JOIN dbo.Units AS u ON
    pps.Fund = u.Fund AND
    pps.Approp = u.Approp AND
    pps.Unit = u.Unit
    LEFT OUTER JOIN dbo.Appropriations AS ap ON
    pps.Approp = ap.Approp
    LEFT OUTER JOIN dbo.Funds AS f ON
    pps.Fund = f.Fund
    LEFT OUTER JOIN dbo.ActionCodes AS ac ON
    pps.ActionCode = ac.ActionCode
    LEFT OUTER JOIN dbo.JobTitles AS jt ON
    pps.SpecNm = jt.SpecNumber AND
    pps.JurisClass = jt.JurisClass

  • Invalid column type error while calling db function.

    We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
    When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
    Thanks,
    Vijay.
    stackTrace:
    java.sql.SQLException: Invalid column type
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
    at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
    at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
    at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
    at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
    at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
    ----------------------

    Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
    The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
    What is happening at runtime may be the following:
    (1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
    (2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
    Are you using JDK 1.2 / runtime12.zip?
    In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs.

  • How to track changes in text [column type]  changes in MDM

    Hi,
    How to keep track changes in Text[column type] in MDM tables.Is it the only way that I have to declare it as Name field?

    Hi,
    You keep track of changes for a field by enabling change tracking for that field in MDM.  This functionality is available in the MDM Console. 
    For more information  please have a look at the MDM Console Reference Guide -> Part 4: Repository Maintenance -> Other System Tables -> Change Tracking Table
    The MDM Console Reference Guide can be found in http://service.sap.com/instguides -> SAP NetWeaver -> Release 04 -> Operations -> SAP MDM -> MDM 5.5 SP02 - Console Reference Guide
    Hope this helps,
    Richard

  • SQL Data Sync - column type invalid for use as a key column

    Hello,
    our sync group is failing to do the sync. Here's a tracingID:
    For more information, provide tracing ID ‘e3e568b5-140a-4ae5-a4c8-c178c6bf805d’ to customer support.
    I must say, that the column in DB is not a PK or INDEX-ed, it was initially VARCHAR(MAX), after some reading I changed it to VARCHAR(200) and later to TEXT, but the result of syncing is still the same.
    Thank you,
    Bojan

    Hi Bojan,
    The error “column type invalid for use as a key column” could be due to the existence of unsupported data types or column properties when implementing the synchronization. I recommend you check your database according to this article:
    SQL Database Data Types supported by SQL Data Sync.
    Besides, before you design and implement a data synchronization plan, please check the following articles about system requirements for SQL Data Sync and so on.
    System Requirements for SQL Data Sync
    https://msdn.microsoft.com/en-us/library/azure/jj127278.aspx
    Known SQL Data Sync Limits
    https://msdn.microsoft.com/en-us/library/azure/jj590380.aspx
    SQL Data Sync Best Practices
    https://msdn.microsoft.com/en-us/library/azure/hh667328.aspx
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • ADF How to Download BLOB File from Database Column

    Hi,
    We have one blob Database Column in which we use for storing attachments(eg Image,.doc or.zip) . We are able to upload attachments.
    How can I build page which will access that particular record and will be able to download attachment in it.
    It should prompt to Save and then we can save it on Local machine.
    Thanks,
    Jit

    Sorry, I don't get your question.
    If you have a file name including the suffix like 'Test.file.doc' you can pass this file name as parameter to the method and get the MIME type back. I your sample it would be "application/msword"
    String mime = ContentTypes.get("Test.file.doc");
    public class ContentTypes
        public static String get(String fileName)
            String mime = null;
            String ext = fileName.toLowerCase();
            if (ext.endsWith(".pdf"))
                mime = "application/pdf";
            else if (ext.endsWith(".doc"))
                mime = "application/msword";
            else if (ext.endsWith(".xls"))
                mime = "application/msexcel";
            else if (ext.endsWith(".docx"))
                mime = "application/msword2007";
            else if (ext.endsWith(".xlsx"))
                mime = "application/msexcel2007";
            else if (ext.endsWith(".ppt"))
                mime = "application/vnd.ms-powerpoint";
            else if (ext.endsWith(".rar"))
                mime = "application/octet-stream";
            else if (ext.endsWith(".zip"))
                mime = "application/zip";
            else if (ext.endsWith(".jpg"))
                mime = "image/jpeg";
            else if (ext.endsWith(".jpeg"))
                mime = "image/jpeg";
            else if (ext.endsWith(".gif"))
                mime = "image/gif";
            else if (ext.endsWith(".png"))
                mime = "image/png";
            return mime;
    }Timo

Maybe you are looking for

  • ORA-03113 while importing a file

    Hi all. I know this is a very general error but, I need some help trying to figure out the workaround or the cause of this error. I am importing a big export file (like half a gig) created in a 10.2 environment, into a brand new 11.1.0.7 environment.

  • Drilling via Hierarchy - how to display upper levels of the hierarchy??

    Hi all. I'm using Discoverer 10.1.2 I have a worksheet which contains only one Pie graph. Users can drill down and up by clicking on the slices of the graph, because I definied Hierarchy in the Administrator. Everything's fine, but when drilling down

  • Discontinuation of Widescreen Format

    Hello All, I did a search on "widescreen, letterbox, discontinuation, original aspect ratio, etc... and found null,zip, zero. I have been an ardent supporter of  home video programming shown in the original aspect ratio chose by the director and cine

  • 10.5.4 Server/10.3.9 Client user home mounting issue

    Hi all, hopefully someone can help me out with this. I know this might be an AFP issue but if you read on you'll see why I think it might be Open Directory's "fault". I'm the admin at a school running Leopard Server with Leopard, Tiger, and Panther c

  • My after effects is not letting me put the video in 1080p

    help me