Expression derived coloumn

I have an column in my source table as
Valyyyymmdd   [Valyyyymmdd]
[nvarchar](24) NULL 
=================
20130503
20120403
00000000
20110523
20100715
I want to get the difference with getdate()
so i used the below query in my source
DATEDIFF(DAY, IIF( [Valyyyymmdd] ='00000000', CONVERT(VARCHAR(8), GETDATE(), 112), [Valyyyymmdd]) , getdate()) as SalesStageAging
but i need to get the Valyyyymmdd and do ssis derived column to get the difference in date resulting in int value.
I tryed as below
DATEDIFF("d",[Valyyyymmdd] == "00000000" ? GETDATE() : (DT_DBDATE)(SUBSTRING([Valyyyymmdd],1,4) + "-" + SUBSTRING([Valyyyymmdd],5,2) + "-" + SUBSTRING([Valyyyymmdd],7,2)),GETDATE())
kindly provide me the expression which has to be written in derived column expression
ShanmugaRaj

Note  :
SourceColumn  [Valyyyymmdd]
[nvarchar](24) NULL  
DestinationColumn   [DestColumn] [int] NULL,
After Implementing 
((DT_WSTR,24)DestColumn == "00000000" ? GETDATE() : (DT_DBDATE)(SUBSTRING((DT_WSTR,10)DestColumn,1,4) + "-" + SUBSTRING((DT_WSTR,10)DestColumn,5,2) + "-" + SUBSTRING((DT_WSTR,10)DestColumn,7,2)))
[OLE_DST TargetTable [89]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
[OLE_DST TargetTable [89]] Error: There was an error with OLE_DST TargetTable.Inputs[OLE DB Destination Input].Columns[DestColumn] on OLE_DST TargetTable.Inputs[OLE DB Destination Input]. The column status returned was: "The value could not be converted because
of a potential loss of data.".
[OLE_DST TargetTable [89]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "OLE_DST TargetTable.Inputs[OLE DB Destination Input]" failed because error code 0xC0209077 occurred, and the error row disposition on "OLE_DST TargetTable.Inputs[OLE
DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE_DST TargetTable" (89) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (102). The identified component returned
an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
ShanmugaRaj

Similar Messages

  • Getdate - yyyymmdd returining int in derived coloumn

    In table, if the column is having 20140810  [ date in yyyymmdd format ]
    Result to be 11 returning in the expression using derived 
    destination value is the [columndate] - getdate
    ================
    Source Table Column [Valyyyymmdd] [nvarchar](24) NULL  
    Destination Table Column  
    [DestColumn] [int] NULL,
    =================
    20130503
    20120403
    00000000
    20110523
    20100715
    I want to get the difference with getdate()
    so i used the below SQL query in my source
    DATEDIFF(DAY, IIF( [Valyyyymmdd] ='00000000', CONVERT(VARCHAR(8), GETDATE(), 112), [Valyyyymmdd]) , getdate()) as SalesStageAging
    but i need to get the Valyyyymmdd and do ssis derived column to get the difference in date resulting in int value.
    I tryed as below 
    ((DT_WSTR,24)DestColumn == "00000000" ? GETDATE() : (DT_DBDATE)(SUBSTRING((DT_WSTR,10)DestColumn,1,4) + "-" + SUBSTRING((DT_WSTR,10)DestColumn,5,2) + "-" + SUBSTRING((DT_WSTR,10)DestColumn,7,2)))
    ShanmugaRaj

    Are you trying to get the datedifference for those integer date format against getdate() and store the integer day value in the destination table ? If it is correct i have a recomendation to filter your integer date format by length, if possible by date
    validity as well. For this use SQL command in OLEDB source i.e select Valyyyymmdd from sourceTable where len(Valyyyymmdd) = 8.
    And use the below expression in the derived column transformation,
    Valyyyymmdd == "00000000" ? 0 : DATEDIFF("d",(DT_DATE)(SUBSTRING(Valyyyymmdd,5,2) + "/" + SUBSTRING(Valyyyymmdd,7,2) + "/" + SUBSTRING(Valyyyymmdd,1,4)),GETDATE())
    Regards, RSingh

  • SSIS: Using CASE Statement Within A Derived Column Transformation Expression

    The following is my Data Flow:
    Ole DB Source > Copy Column > Derived Column >Ole DB Command
    My OLE DB Source has the following SQL command task:
    SELECT *
    FROM Repair R
    LEFT OUTER JOIN Vehicle V
    ON R.SN = V.SN
    AND R.Reg = V.Reg
    LEFT OUTER JOIN Product P
    ON R.PID = P.PID
    This yields a column of concern for me named PartNumber, which are represented by the following 2 formats:
    The following are my Copied Columns:
    Input Column = PartNumber
    Output Alias = Copy of PartNumber
    The following are my Derived Column expressions:
    Derived Column Name Derived Column Expression
    Name Replace 'PartNumber' LEFT(PartNumber,FINDSTRING(PartNumber,"-",1) - 1)
    Copy of Name Replace 'Copy of PartNumber' RIGHT([Copy of PartNumber],LEN([Copy of PartNumber]) - FINDSTRING([Copy of PartNumber],"-",1))
    So My PartNumber Column is Replaced with ######### of type
    string and the Copy of PartNumber column is replaced with
    #### of type int
    As I stated earlier PartNumber also is in the format of %-%-% which raises the following question:
    How can I replace PartNumber Column with NULL if in format of
    %-%-% and take the PartNumber and put it in new column named
    SubPart while keeping all the logic within SSIS objects?
    So in essence I want to do something like the following:
    PartNumber = CASE
    WHEN 'PartNumber' LIKE '%-%-%'
    THEN ABC = PartNumber AND PartNumber IS NULL
    END
    I have tried the case statement in a Derived Column expression and is not working. Would I add the
    CASE statement to the SQL command task in my OLE DB Source?
    I hope this question is concise for you.

    If it must be in SSIS, I would put a derived column stage earlier in the process to do my check for me. Then in the second derived column stage do the check against each output column (part, subpart, copy of part) to decide which way it goes
    PS Not sure if it's a 2012 function but SSIS has a function called TOKEN that will allow you to pull your subparts for you rather than the left/right you are doing

  • What is derivation in atg

    Hi Guys,
    we code like this is customCatalog.xml file
    <property name="parentCategory" item-type="category"
                  category-resource="categoryCategoryRelated" display-name-resource="categoryParentCategory">
          <derivation method="firstNonNull">
            <expression>parentCategoryForCatalog</expression>
            <expression>defaultParentCategory</expression>
          </derivation>
          <attribute name="propertySortPriority" value="-1"/>
        </property>
    what is this derivation
    Please give me clear explanation on this.

    Hi,
    the derived properties functionality is described in the docs at:
    Oracle ATG Web Commerce - Derived Properties
    you should find the answer there.

  • Cannot convert between unicode and non-unicode string data types.

    I'm trying to copy the data from 21 tables in a SQL 2005 database to a MS Access database using SSIS. Before converting the SQL database from 2000 to 2005 we had this process set up as a DTS package that ran every month for years with no problem.  The only way I can get it to work now is to delete all of the tables from the Access DB and have SSIS create new tables each time. But when I try to create an SSIS package using the SSIS Import and Export Wizard to copy the SQL 2005 data to the same tables that SSIS itself created in Access I get the "cannot convert between unicode and non-unicode string data types" error message. The first few columns I hit this problem on were created by SSIS as the Memo datatype in Access and when I changed them to Text in Access they started to work. The column I'm stuck on now is defined as Text in the SQL 2005 DB and in Access, but it still gives me the "cannot convert" error.

    I was getting same error while tranfering data from SQL 2005 to Excel , but using following method i was able to tranfer data. Hopefully it may also help you.
    1) Using Data Conversion transformation
       data types you need to select is DT_WSTR (unicode in terms of SQL: 2005)
    2) derived coloumn transformation
       expression you need to use is :
        (DT_WSTR, 20) (note : 20 can be replace by your character size)
    Note:
    Above teo method create replica of your esting coloumn (default name will be copy of <coloumn name>).
    while mapping data do not map actual coloumn to the destination but select the coloumn that were created by any of above data transformer (replicated coloumn).

  • What is diff b/w pick and switch activity in bpel?

    what is the difference between pick activity and switch activity in BPEL? example Please

    1)The switch activity is an IfElse with two different flows, based on a conditional expression, derived out of existing message(s) in your process.
    Eg. i) Whether the salary is greater than 10,000 or not.
    ii) Whether the age is greater than 60 or not.
    iii) whether the department is finance or not.
    2)The pick activity is an IfElse with two different flows, based on two different messages/signals, that you can expect to receive(when you are waiting for a message) from outside of your process.
    Eg. i) whether you received a reply message or a timeout signal.
    ii) whether you received a AddNewEmployee message or UpdateEmployee message.
    The (decision for which route to be taken for) pick activity is based on the MessageType, while the switch is based on the contents in a message. The pick activity implies that you are waiting for a message, this can occur, at the start of your process or in the mid of your process. However, switch activity doesnot wait for any message, hence can only occur in the mid of the process and can not be the start of a process.
    Mark the posting appropriately as "helpful" or "correct answer", if your issue is solved.

  • How to send recursive deadline monitoring mails?

    Hi all,
    I have to send a deadline monitoring mails to the approver for every 3 days till the approver takes some action. I am able to send the deadline monitoring mail once by using 'LATEST END' tab.
    even tried using loop, but i am getting mails continuously.
    Please help me..
    Regards,
    Gautham P

    Hi Gautham,
    <b>Activation</b>
    Deadline Monitoring is activated by selecting a reference date /time for the relevant deadline (on the relevant tab page of step).
    <b>Reference date/time options</b>
    Creation date/time of the work item
    Creation data/time of the workflow
    A date in the form of an expression (derived from application
      context)
      E.g. 2 days for document type CMR, 3 days for CMR
    <b>Recipient and Text</b>
    Deadline Text and Recipient of deadline has to be mentioned on tab page Display text.
    NOTE:
    The deadline work item is completed when the deadline recipient processes it or the original work item is completed.
    In the task itself trigger to receive mails but only thing you have to maintain <b>Fork</b>.
    <b>Information on monitored workitem</b>
    Workitem Type: Dialog step
    Status: In Process
    Current Agent: xyz
    Thanks and Regards,
    Prabhakar Dharmala

  • Atg.repository.dp.LanguageTranslation

    Hi ,
    I want to know the reason for using "atg.repository.dp.LanguageTranslation" in the xml.
    Regareds
    Kavi

    Hi David,
    Am done with the implementation i have some more quesitons for my understandings...
    <item-descriptor name="category" xml-combine="append">
        <table name="dcs_category" type="primary" id-column-name="category_id">
               <property name="displayName" xml-combine="remove"/>
               <property name="displayNameDefault" data-type="string" column-name="display_name"/>
          <property name="displayName" data-type="string" writable="false" hidden="true" queryable="true" display-name-resource="displayName">
             <derivation user-method="atg.repository.dp.LanguageTranslation">
                   <expression>displayNameDefault</expression> 
             </derivation>
                  <attribute name="defaultProperty" value="displayNameDefault"/>
                   <attribute name="defaultLocale" value="en_US"/>
         <table name="crs_cat_cat_xlate" type="multi" multi-column-name="locale" id-column-names="category_id">
          <property name="translations" display-name="Translations" column-name="translation_id" data-type="map"  component-item-type="categoryTranslation"/>
        </table>
      </item-descriptor>
      <item-descriptor name="categoryTranslation" id-space-name="categoryTranslation">
        <table name="crs_cat_xlate" type="primary" id-column-name="translation_id">
          <property name="displayName" column-names="display_name" data-type="string"/>
         </table>
    </item-descriptor>
    Question 1:
    i have highligted displayName why these property name is same/Unique why not different ?
    Question 2:
    How atg.repository.dp.LanguageTranslation identifies the second item descriptor categoryTranslation and gets the corresponding values ?
    Regards
    G.KaviMani

  • Entity Object (EO) issue using "Derived from SQL Expression" funtionality

    I am using JDeveloper 11.1.1.6
    In my use case I am trying to get my EO to return results from a query such as the following:
                   SELECT table1.my_id,table1.my_des,
                   count(table2.store_num) as storeCount
                   FROM table1
                   LEFT JOIN table2
                   ON table1.my_id = table2.my_id
                   group by table1.my_id,table1.my_des
    I have chosen to follow the path described in the following URL:
    http://www.exploreoracle.com/2010/09/07/using-transient-attribute-with-derived-from-sql-expression-in-jdeveloper-11g/
    To begin with, I created my EO's and VO's by using the "Business Components from Tables" wizard. This created EO and VO's for my 2 tables based on the DB schema.
    I added the VO's to an app module and tested both VO's. I was able to navigate both VO's.
    I then crreated a new attribute for the table1 EO. Please note that table1 does include 7 fields prior to this field therefore this becomes the 8th field. That is important once you get to the exception being thrown. The XML is as follows
              <Attribute
              Name="StoreCount"
              IsUpdateable="false"
              IsQueriable="false"
              IsPersistent="false"
              Precision="5"
              Scale="0"
              ColumnName="STORECOUNT"
              SQLType="NUMERIC"
              Type="oracle.jbo.domain.Number"
              ColumnType="NUMBER"
              Expression="(select coalesce(count(*),0) as StoreCount from table2 where my_id = table1.my_id)">
              <Properties>
              <SchemaBasedProperties>
                   <LABEL
                   ResId="STORE_COUNT"/>
              </SchemaBasedProperties>
              </Properties>
              </Attribute>
    I then tested the VO's again in the app module and everything continues to work fine.
    I then added the new attribute to the VO by doing "Add Attribute from Entity".
    I then tested the VO for Table1 and now get the following error. Could you please advise me as to what I might be doing wrong.
    [132] oracle.jbo.AttributeLoadException: JBO-27021: Failed to load custom data type value at index 8 with java object of type oracle.jbo.domain.Number due to java.sql.SQLException.
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1375)
         at oracle.jbo.server.AttributeDefImpl.loadFromResultSet(AttributeDefImpl.java:2536)
         at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:3885)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:2555)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:6044)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:5822)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3693)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3548)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:2261)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:5111)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2971)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2827)
         at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:3068)
         at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:2785)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1259)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1060)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2810)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2787)
         at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1616)
         at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3544)
         at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:10165)
         at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:779)
         at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:679)
         at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:474)
         at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4474)
         at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:347)
         at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1605)
         at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:116)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:88)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:71)
         at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
         at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
         at oracle.jbo.jbotester.form.JTForm.<init>(JTForm.java:72)
         at oracle.jbo.jbotester.form.BindingForm.<init>(BindingForm.java:50)
         at oracle.jbo.jbotester.form.FormType$1.createForm(FormType.java:63)
         at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
         at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
         at oracle.jbo.jbotester.tree.ObjTreeNode$ShowAction.doAction(ObjTreeNode.java:399)
         at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:97)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:1494)
         at oracle.jbo.domain.Number$1facClass.createDatum(Number.java:113)
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1326)
         ... 81 more
    ## Detail 0 ##
    java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:1494)
         at oracle.jbo.domain.Number$1facClass.createDatum(Number.java:113)
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1326)
         at oracle.jbo.server.AttributeDefImpl.loadFromResultSet(AttributeDefImpl.java:2536)
         at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:3885)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:2555)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:6044)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:5822)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3693)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3548)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:2261)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:5111)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2971)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2827)
         at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:3068)
         at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:2785)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1259)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1060)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2810)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2787)
         at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1616)
         at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3544)
         at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:10165)
         at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:779)
         at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:679)
         at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:474)
         at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4474)
         at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:347)
         at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1605)
         at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:116)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:88)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:71)
         at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
         at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
         at oracle.jbo.jbotester.form.JTForm.<init>(JTForm.java:72)
         at oracle.jbo.jbotester.form.BindingForm.<init>(BindingForm.java:50)
         at oracle.jbo.jbotester.form.FormType$1.createForm(FormType.java:63)
         at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
         at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
         at oracle.jbo.jbotester.tree.ObjTreeNode$ShowAction.doAction(ObjTreeNode.java:399)
         at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:97)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    [133] JUErrorHandlerDlg.reportException(oracle.jbo.AttributeLoadException)
    [134] LoadFromResultSet failed (8)
    [135] DCBindingContainer.reportException :oracle.jbo.AttributeLoadException
    [136] oracle.jbo.AttributeLoadException: JBO-27021: Failed to load custom data type value at index 8 with java object of type oracle.jbo.domain.Number due to java.sql.SQLException.
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1375)
         at oracle.jbo.server.AttributeDefImpl.loadFromResultSet(AttributeDefImpl.java:2536)
         at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:3885)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:2555)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:6044)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:5822)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3693)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3548)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:2261)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:5111)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2971)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2827)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2787)
         at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1616)
         at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3544)
         at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:10165)
         at oracle.adf.model.binding.DCIteratorBinding.internalGetCurrentRowInBinding(DCIteratorBinding.java:2258)
         at oracle.jbo.uicli.binding.JUIteratorBinding.internalGetCurrentRowInBinding(JUIteratorBinding.java:500)
         at oracle.adf.model.binding.DCIteratorBinding.getCurrentRow(DCIteratorBinding.java:2203)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.internalCheckPermission(JUCtrlActionBinding.java:2050)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isOperationEnabled(JUCtrlActionBinding.java:325)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isActionEnabled(JUCtrlActionBinding.java:296)
         at oracle.jbo.uicli.controls.JUNavigationBar._isEnabled(JUNavigationBar.java:1342)
         at oracle.jbo.uicli.controls.JUNavigationBar._updateButtonStates(JUNavigationBar.java:1331)
         at oracle.jbo.jbotester.NavigationBar._updateButtonStates(NavigationBar.java:99)
         at oracle.jbo.uicli.controls.JUNavigationBar$3.run(JUNavigationBar.java:1246)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.Dialog$3.run(Dialog.java:1098)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Dialog.java:1096)
         at java.awt.Component.show(Component.java:1585)
         at java.awt.Component.setVisible(Component.java:1537)
         at java.awt.Window.setVisible(Window.java:842)
         at java.awt.Dialog.setVisible(Dialog.java:986)
         at oracle.jbo.uicli.controls.JUErrorDialog.showError(JUErrorHandlerDlg.java:289)
         at oracle.jbo.uicli.controls.JUErrorHandlerDlg$1myRunnable.run(JUErrorHandlerDlg.java:370)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:1494)
         at oracle.jbo.domain.Number$1facClass.createDatum(Number.java:113)
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1326)
         ... 60 more
    ## Detail 0 ##
    java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:1494)
         at oracle.jbo.domain.Number$1facClass.createDatum(Number.java:113)
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1326)
         at oracle.jbo.server.AttributeDefImpl.loadFromResultSet(AttributeDefImpl.java:2536)
         at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:3885)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:2555)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:6044)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:5822)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3693)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3548)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:2261)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:5111)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2971)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2827)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2787)
         at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1616)
         at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3544)
         at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:10165)
         at oracle.adf.model.binding.DCIteratorBinding.internalGetCurrentRowInBinding(DCIteratorBinding.java:2258)
         at oracle.jbo.uicli.binding.JUIteratorBinding.internalGetCurrentRowInBinding(JUIteratorBinding.java:500)
         at oracle.adf.model.binding.DCIteratorBinding.getCurrentRow(DCIteratorBinding.java:2203)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.internalCheckPermission(JUCtrlActionBinding.java:2050)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isOperationEnabled(JUCtrlActionBinding.java:325)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isActionEnabled(JUCtrlActionBinding.java:296)
         at oracle.jbo.uicli.controls.JUNavigationBar._isEnabled(JUNavigationBar.java:1342)
         at oracle.jbo.uicli.controls.JUNavigationBar._updateButtonStates(JUNavigationBar.java:1331)
         at oracle.jbo.jbotester.NavigationBar._updateButtonStates(NavigationBar.java:99)
         at oracle.jbo.uicli.controls.JUNavigationBar$3.run(JUNavigationBar.java:1246)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.Dialog$3.run(Dialog.java:1098)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Dialog.java:1096)
         at java.awt.Component.show(Component.java:1585)
         at java.awt.Component.setVisible(Component.java:1537)
         at java.awt.Window.setVisible(Window.java:842)
         at java.awt.Dialog.setVisible(Dialog.java:986)
         at oracle.jbo.uicli.controls.JUErrorDialog.showError(JUErrorHandlerDlg.java:289)
         at oracle.jbo.uicli.controls.JUErrorHandlerDlg$1myRunnable.run(JUErrorHandlerDlg.java:370)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    The Is Updatable attribute on the EO is false which I assume is the same as never. Here is the current config for it:
    <Attribute
    Name="StoreCount"
    IsUpdateable="false"
    IsQueriable="false"
    IsPersistent="false"
    Precision="5"
    Scale="0"
    ColumnName="STORECOUNT"
    SQLType="NUMERIC"
    Type="oracle.jbo.domain.Number"
    ColumnType="NUMBER"
    Expression="(select coalesce(count(*),0) as StoreCount from table2 where my_id = table1.my_id)">
    <Properties>
    <SchemaBasedProperties>
    <LABEL
    ResId="STORE_COUNT"/>
    </SchemaBasedProperties>
    </Properties>
    </Attribute>
    This attribute is in the same order in the VO and it is in the EO. The VO code is as follows:
    <ViewAttribute
    Name="StoreCount"
    IsUpdateable="false"
    IsQueriable="false"
    IsPersistent="false"
    PrecisionRule="true"
    EntityAttrName="StoreCount"
    EntityUsage="MyTable2EO"/>
    The VORowImpl has the attributes in the same order as well.
    Do you have any additional suggestions.

  • DIfference b/w expression builder logical column and derived logical column

    Hi Experts,
    Can anyone tellme the difference between expression builder (when we double click the logical column) of derived logical column and expression builder of logical column( we see this in column mapping of LTS) ??
    Thanks in advance.

    Hi,
    Formula given in the "expression builder of logical column( we see this in column mapping of LTS)" is performed on the physical layer of the RPD. I guess it is calculated in the Physical Query which is good for performance.
    Formula in the expression builder of derived column is calculated in the BMM layer i.e in the logical query.
    Regards,
    Amrutha.

  • Convert SQL Query to Derived Column Expression

    I'm in the process of reworking some SSIS packages I inherited. A lot of these use Execute SQL Statement components to update certain fields in the tables once they've been loaded. I'd like to replace these individual UPDATE statements with Derived Column
    components.
    I've got 95% of them converted, except for a couple, one of which has me a bit perplexed and was hoping someone could provide some insight.
    Essentially, there is a column called POSTPERIOD which is a date in string format YYYYMM (i.e., 201503). The SQL update parses out the month piece and converts it to the month name and populates a column called POSTPERIOD_MONTH.
    Here is the SQL:
    select DateName(month , DateAdd(month, CONVERT(INT, SUBSTRING(POST_PERIOD,5,2)), 0 ) - 1 )
    I'd like to accomplish this using a Derived Column, but not sure how to go about doing this...
    If someone could point me in the right direction, it would be greatly appreciated!
    Thanks!
    A. M. Robinson

    Visakh:
    Thank you for the reply! I've tried your solution but am getting the following error(s):
    Warning 17 Validation warning. Populate STAGING_DIM_AP_DETAIL - RADIO: {ACAA99C4-272C-4641-BF44-B4D4409D1EFB}: The expression "(DT_STR,8,1252)((DT_I4)[SUBSTRING](#85,5,2) == 1 ? (DT_STR,8,1252)"January" : ((DT_I4)[SUBSTRING](#85,5,2)
    == 2 ? (DT_STR,8,1252)"February" : ((DT_I4)[SUBSTRING](#85,5,2) == 3 ? (DT_STR,8,1252)"March" : ((DT_I4)[SUBSTRING](#85,5,2) == 4 ? (DT_STR,8,1252)"April" : ((DT_I4)[SUBSTRING](#85,5,2) == 5 ? (DT_STR,8,1252)"May" :
    ((DT_I4)[SUBSTRING](#85,5,2) == 6 ? (DT_STR,8,1252)"June" : ((DT_I4)[SUBSTRING](#85,5,2) == 7 ? (DT_STR,8,1252)"July" : ((DT_I4)[SUBSTRING](#85,5,2) == 8 ? (DT_STR,8,1252)"August" : ((DT_I4)[SUBSTRING](#85,5,2) == 9 ? (DT_STR,8,1252)"September"
    : ((DT_I4)[SUBSTRING](#85,5,2) == 10 ? (DT_STR,8,1252)"October" : ((DT_I4)[SUBSTRING](#85,5,2) == 11 ? (DT_STR,8,1252)"November" : (DT_STR,8,1252)"December")))))))))))" will always result in a truncation of data. The expression
    contains a static truncation (the truncation of a fixed value).   Dimension Finance - Load STAGING_DIM_AP_DETAIL_DERIVED_COLUMNS.dtsx 0 0 
    This is the derived column expression I'm using:
    (DT_STR,8,1252) ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 1? (DT_STR,8,1252) "January" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 2 ? (DT_STR,8,1252) "February" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 3 ? (DT_STR,8,1252) "March" :((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 4 ? (DT_STR,8,1252) "April":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 5 ? (DT_STR,8,1252) "May" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 6 ? (DT_STR,8,1252) "June" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 7 ? (DT_STR,8,1252) "July" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 8 ? (DT_STR,8,1252) "August":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 9 ? (DT_STR,8,1252) "September":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 10? (DT_STR,8,1252) "October": ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 11 ? (DT_STR,8,1252) "November" : (DT_STR,8,1252)"December")))))))))))
    Some info that might be of some help in the matter...the POST_PERIOD field is a VARCHAR(8), the POST_PERIOD_MONTH field is also a VARCHAR(8).
    There is a computed column Any help would be appreciated once again!!!
    A. M. Robinson

  • EXPRESSION SYNTAX REQUIRED FOR DERIVED COLUMN

    Hi
    I've had a look around and can't find the correct syntax for an Expression in a Derived Column task.
    Below is the logic in TSQL. Please could someone help me convert it?
    CASE
    WHEN FIELD1
    =
    'A'
    AND FIELD2
    IS
    NULL
    THEN
    'A'
    WHEN FIELD1
    =
    'B'
    AND FIELD2
    IS
    NULL
    THEN
    'B'
    WHEN FIELD1
    =
    'A'
    AND FIELD2
    =
    'C'
    THEN
    'C_A'
    WHEN FIELD1
    =
    'B'
    AND FIELD2
    =
    'C'
    THEN
    'C_B'
    WHEN FIELD1
    =
    'A'
    AND FIELD2
    =
    'D'
    THEN
    'D_A'
    WHEN FIELD1
    =
    'B'
    AND FIELD2
    =
    'D'
    THEN
    'D_B'
    ELSE
    '0'
    END
    Thanks in advance
    Lucy

    Hi Lucy,
    Try like below expression in derived columns.. 
     ((FIELD1 = 'A'
    && FIELD2 IS NULL)
    ? "A" :
      (FIELD1 = 'B'
    && FIELD2 IS NULL)
    ? "Y" :
    (FIELD1 = 'A' && FIELD2 = 'C' )?
    ”C_A” :
    (FIELD1 = 'B' && FIELD2 = 'C' )
    ? “'C_B” :
    (FIELD1 = 'A' && FIELD2 = 'D' )
    ? “'D_A'” :
    (FIELD1 = 'B' AND FIELD2 = 'D' )
    ? “'D_B”
    : "0"))

  • Derive Expressions

    Hello All,
    My sample data xml file is
    <Mappings>
    <Mapping LogicalTableSource="OLTP Forecast Summary">
    <Expression xmlns:xlink="http://www.w3.org/1999/xlink">
    <RefPhysicalColumn dataType="DOUBLE" id="3003:61335" name="S_FCST_ITEM_DTL.REV_AMT" nullable="true"/> *
    <RefPhysicalColumn dataType="DOUBLE" id="3003:61338" name="S_FCST_ITEM_DTL.WIN_PROB" nullable="true"/> / 100.0 * IFNULL(
    <RefPhysicalColumn dataType="DOUBLE" id="3003:66526" name="S_ETL_EXCH_RATE (Fcst Summary).EXCH_RATE" nullable="false"/>, VALUEOF("ETL Unknown Exchange Rate"))
    </Expression>
    <PhysicalColumn phycolname="REV_AMT" PhysicalTable="S_FCST_ITEM_DTL" PhysicalSchema="dbo" PhysicalCatalog="Catalog" PhysicalDatabase="Forecasting Siebel OLTP">
    <Mappings/>
    </PhysicalColumn>
    <PhysicalColumn phycolname="WIN_PROB" PhysicalTable="S_FCST_ITEM_DTL" PhysicalSchema="dbo" PhysicalCatalog="Catalog" PhysicalDatabase="Forecasting Siebel OLTP">
    <Mappings/>
    </PhysicalColumn>
    <PhysicalColumn phycolname="EXCH_RATE" PhysicalTable="S_ETL_EXCH_RATE (Fcst Summary)" PhysicalSchema="dbo" PhysicalCatalog="Catalog" PhysicalDatabase="Forecasting Siebel OLTP">
    <Mappings/>
    </PhysicalColumn>
    </Mapping>
    </Mappings>
    In my report output i want to derive this expression as something like this
    S_FCST_ITEM_DTL.REV_AMT * S_FCST_ITEM_DTL.WIN_PROB / 100 * IFNULL(S_ETL_EXCH_RATE (Fcst Summary).EXCH_RATE,VALUEOF("ETL Unknown Exchange Rate"))
    Any hep please?

    I thought one should be able to.
    The "problem" I had was that I'd thrown a Data Viewer on the pipeline, and the Data Viewer grid only showed the first derived column.  I jumped to the conclusion that the second column wasn't being created.
    I don't know if anyone else has experienced this with Data Viewers following a Derived Column transform.  When I had two separate transforms with a Data Viewer following the second, both derived columns appeared in the Data Viewer.
    I was able to get both derived columns accomplished in one transform.
    Thanks for the help
    Chris

  • Expression for derived column

    Hi,
    In my SSRS package I have a field which may have a null value. I want to create a derived column that does the following:
    If the value is null replace with 0 else return the value
    How do I script this?The fiels is my [Qty Remaining] field. I thought it might have been something like this but I was obviously wrong:
    ISNULL([Qty Remaining])  ? "0" :  [Qty Remaining]
    Cheers
    Paul

    Try this
    ISNULL([number])  ? (DT_I4) "0" : [number]
    "0" is unicode string, you have to convert it to number, in my case integer or choose yourself

  • Can not display long derived measure - ORA-33674

    I would need calculated measures for compiling some special URL, but there seems to be now way to have results longer than 60 characters. I tried creating the measure using AWM and using OLAP API. Both will result in:
    ORA-33674: Data block exceeds the maximum size of 60 bytes.
    ... so its not possible to view the auto-generated view any more. The whole thing seems to be similar to this [Cannot view dimension if description is more than 60 characters|http://wiki.oracle.com/thread/2121955/Cannot+View+Dimension+If+Description+Is+More+Than+60+Characters]
    But here it is about DerivedMeasures, so the workaround is not applicable. There is no corresponding option. Unfortunate this has not been fixed by BugFix 6940809 as described in [AWM 11.1.0.7.0B Readme|http://www.oracle.com/technology/products/bi/olap/11g/awm/awm11.1.0.7b_readme.html]
    I also tired to create the DerivedMeasure via OLAP API and casting it an CLOB. No success either, different Error.
    MdmDerivedMeasure msTemp = mdmCube.findOrCreateDerivedMeasure("TEST");
    StringExpression strexTemp = new StringExpression("Toooooooooooooooo Loooooooooooooooooooooong Txxxxxxxxxxxxxxxxxxt");
    +msTemp.setMeasureExpression( strexTemp.toCLOB() );+
    Exception in thread "main" Die Transaktion kann nicht festgeschrieben werden: "Auf dem Server ist ein Fehler aufgetreten
    Fehlerklasse: Express-Fehler
    Server-Fehlerbeschreibungen:
    DPR: Server-Cursor kann nicht erstellt werden, Allgemein in TxsOqDefinitionManager::generic<CommitRoot>
    +INI: XOQ-01600: OLAP DML-Fehler "Analytisches Arbeitsbereichsobjekt TO_CLOB ist nicht vorhanden." bei der Ausführung von DML "SYS.AWXML!R11_MANAGE_CALC_MEASURE('SALES_CUBE.URImdm.MEASURE' 'ALTER' 'TEXT' SYS.AWXML!___R11_LONG_ARG_VALUE(SYS.AWXML!___R11_LONG_ARG_DIM 1) NA NA)", Allgemein in TxsOqStdFormCommand::execute"+
    +     at oracle.olapi.transaction.BaseTransaction.commit(Unknown Source)+
    +     at oracle.olapi.transaction.BaseTransactionProvider.commitCurrentTransaction(Unknown Source)+
    +     at daemz.eval.createExpression.main(createExpression.java:103)+
    Translating from German: While writing to the DB he finds out he doesn't actually have some object called TO_CLOB. Does they API offer functionality not supported by the DB?
    Played around with this for quite a while - suggestions more than welcome.
    I'm evaluating on the OLAP Option, using AWM 11.1.0.7.0B, Oracel DB & OLAP 11.1.0.7.0, OLAP API 11.1.0.6.0 (delivered with AWM 11.1.0.7.B) and the Oracle OLAP 11g Sample Schema.
    Edited by: user7008111 on Jun 27, 2009 11:27 AM
    Edited by: user7008111 on Jun 27, 2009 11:27 AM

    This is similar, bot not quite the same problem as for attributes. In the case of attributes, the problem was bad defaulting of the VARCHAR2 length by AWM. To fix it is was just necessary to give an appropriate length.
    Your issue is more serious since it lies in the server itself, which attempts (badly in this case) to derive the data type from the expression. In this it determines that the data type is VARCHAR2, but it defaults the data length to 60 instead of deriving the length from the contents. I am not aware of any workarounds in 11.1.0.7 for this problem. CAST, for example, does not solve the problem. The bug is addressed in 11.2 beta releases, but it was a non-trivial project that is no likely to be back ported to 11.1.0.7. It may be possible to bump up the default of 60 to something higher, but this is not a general solution.
    The TO_CLOB error is due to the fact that the CLOB data type (and hence TO_CLOB function) is not supported by the AW. It is supported by relational tables, which is why it is listed in the OLAP API. It can be used, for example, in the mapping between cube and table as long as you resolve the CLOB into an AW data type again.

Maybe you are looking for

  • Qty is automatically getting zero at the time of PGI from Deliveries in WM

    When we go to PGI an order it changed all of the deliveries to zero and created an invoice at zero value. It is happening dramatically. it is not happening with every delivery. Thanks in advance

  • Document type for S_ALR_87012291

    Hi I tried to execute the report S_ALR_87012291 and wanted to specify the document type. However, the Doc Type field is gray off. It cannot be input. Is there a way to enable it ? Regards Angel.

  • Looking for the Round Card technical reference manual

    I'm currently evaluating a new application for FieldBus Round Card. We need certain specific info usually found on technical reference manuals. Thanks in advance for your help.

  • Outlook error 08

    using exchange 2013 and desktop outlook 2007.using the selfsigned certificate it was setup and running the person running the desktop retired we created a new outlook profile. with new email for new user now i get outlook error 08 about certificate e

  • How can I transfer playlists from Windows 7 to Windows 8 on the same computer?

    Windows 7 and a new Windows 8 OS are each on a seperate SSD, and all mp3 and m4a files are on a third. Can I transfer/sync playlists from iTunes 11 on Windows 7 to iTunes 11 on Windows 8?  If so, can one OS update the others changes?