Handle Unmapped Required Values This page last changed on Nov 28, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Handle Unmapped Required Values This topic describes how to enable an update map when the data sources on the left have required elements that are not mapped from the return type on the right. Overview Draw the Mapping Cast a Constant See Also ## Overview When required mappings are missing, the Create-Update-Delete procedures for the update block are disabled. That means you cannot create, update, or delete the underlying data sources. In Workshop for WebLogic, the update map looks like this. ##### Required Mappings Are Missing A mapping that was deleted from or did not exist in the query map. An XML return type that does not contain all required elements. This can be valid, especially if you do not want to expose all elements in your data sources to a client application. If an element is required but does not have a value, it is marked with a Warning icon . In either case, the Create, Update, or Delete procedures do not work, so you need to resolve the error. You can do either of these: Draw the mapping in Query Map view. Enter an override value (either an expression or a constant) in the expression editor. ## Draw the Mapping To draw the mapping in the Query Map tab: Click Query Map. Drag from an element in a data source on the left to the matching element in a return type on the right. Make sure the elements have the same data types or similar data types that are cast implicitly. ## Cast a Constant If you enter a constant to override the missing mapping, it is only used with Create procedures, to insert data into the data source. Update procedures ignore the override values you enter and leave the data source unchanged. (Of course, Delete procedures delete a record from the data source, so override values are not relevant to them.) When you enter an override value, make sure the value you enter has the data type the element in the physical data source requires. You can enter a constant like "44" or "2007-01-01" and cast it to an XML Schema data type such as xs:integer or xs:date, using either of these: A built-in XQuery cast function The parentheses cast operator, as in xs:date("string"), to invoke an XML Schema type constructor function The parentheses cast operator uses any XML Schema data type outside the parentheses and a string that is appropriate for the data type you are casting to within the parentheses. For example, you can perform these casts:
    xs:date("2007-01-01")
    xs:dateTime("2007-01-01T16:44:44")
    xs:integer("44")
But you cannot perform these:
    xs:date("2007-01-01T16:44:44")
    xs:dateTime("date")
    xs:integer("text")
3. To cast a constant in the expression editor: Click the Update Map tab. Click an unmapped element in a data source on the left. In the expression editor, enter a constant that has the data type the element requires. For example, for an element of type xs:string, you might enter:
       "Bob"
   If the element has another data type, enter a string within a cast expression, for example:
       xs:integer("44")
       xs:dateTime("2007-07-17T09:00:00")
Continue for all disabled elements. In the Test tab, test an update using Run - Edit - Submit to make sure the value overrides work as you expect. ## See Also ##### Concepts Recognize When Something is Wrong ##### How Tos Cast Using a Built-In XQuery Function Cast Using a Custom XQuery Function Test an Update Map Cast ##### Other Resources XML Schema Datatypes Specification (W3C)

Document generated by Confluence on Jan 13, 2009 15:57