Derived Column

I'm getting the following error when I try to add a derived column or a link to a report region having a type of PL/SQL Function Body Returning SQL Query)
failed to parse SQL query:
ORA-00904: "COL60": invalid identifier
Any ideas?
Thanks
David

David,
You’re using generic column names. This setting generates 60 generic columns, and 60 columns is the maximum number of columns allowed. Adding a derived column or link column exceeds that number. So these types of column can’t be used with generic column based reports. Try enabling the “use query specific column names” option when editing your report source. This type of report would allow adding link columns and derived columns.
Regards,
Marc

Similar Messages

  • How to cast a column of a derived column in a view to NULL

    I have a derived column in my view and this column by default is picked up as not null.
    I want to cast it to null how can i do it ?
    Actual column
    column1 varchar(3) not null
    Expected column
    column1 varchar(3)  null
    Mudassar

    Shridar I  havent defined it but the derived column has been picked up as not null which is strange
    CREATE VIEW test
    AS
    SELECT 
    CASE
    WHEN COMPANY_SIZE IS NULL then  'a'
    ELSE 'b' 
    END AS
    column1 ----- added derived column identifier
    ,[Company_Size] AS [CompanySize]
    FROM xyz
    Mudassar

  • Can't change the connection string of SSIS package with derived columns?

    We upgraded SQL server 2008 to 2012, copied and converted all SSIS packages from Visual Studio 2008 to 2010.  When I opened a package in VS 2010 and tried to change the connection string, in the local connection managers, if the data source is another
    SSIS package B(.dtsx file) with derived columns, I can't change the connection string of package B. When I opened the file connection manager editor for package B and tried to locate a dtsx file in another location, saved the change, reopened the project.
    Package B still pointed to previous file.  Other packages without derived columns work fine. Any thoughts?

    We are using the package deployment model and refer to other packages in the same project. If
    we changed the path of package B (with derived columns) to "D:\Visual Studio 2010\xxxx", and refer it in package A, in the A's connection manager, the connection string of package B is still its previous location  "D:\Visual
    Studio 2008\xxxx". When we ran the package A in the SQL server agent, the data source is still
     "D:\Visual
    Studio 2008\xxxx", so how can I change it to "D:\Visual
    Studio 2010\xxxx"? Why has the package C (without derived columns) no such problem? thanks.

  • Checkbox derived column in report

    I added an HTML checkbox that has the same name for every row and a value of the pk for that row to a report. I also added a submit button.
    The submit button branches back to the same page.
    If I don't check ANY checkbox buttons the submit button just takes me back to the same report. If I even click one checkbox, I get a 404 "Page cannot be found" with the url saying: pls/htmldb/wwv_flow.accept
    why is this procedure doing this? How can I add a derived column containing a checkbox to a report for selection of report rows for further processing or adding of these rows to a "shopping cart/basket".

    Enough with this ..... link
    http://www.oracle.com/technology/products/database/htmldb/howtos/checkbox.html
    How many times do we have to see it in the forum....Enough.....
    Its so frustrating giving the same link time and time again...And the funny
    part is that most people's questions has nothing to do with that. But
    still some geniuses give the same link....I just feel so sorry for people
    who are struggling to get a answer and some idiots give the same link

  • Create a derived column based on a value within the file name

    I am importing a CSV file which is easy enough, but I have an issue where I need to manufacture a couple of column values based on the filename of the input.  So this same process will import different types of records to the same table in sql server.
     I need to pull out the record code from the file name.  
    For instance, say I can use the same package to input two different CSV files.  One is named Input_M02_Data.csv and one named Input_B15_Data.csv.  I need to create a derrived column and store the record code there (i.e.:  M02 or B15) based
    on which file it came out of.  
    fyi-
    I also need to create a second column for Dept based off of the file name as well.  M02 is dept 45 and B15 is dept 99  which I also need to insert into this table when I import the data from the .csv file.  
    Any help is greatly appreciated!

    Hi Jason,
    According to your description, you want to add two derived columns based on the file name to also insert into table. One stores the value between two “_” within file name, another stores the department based on that column.
    If in this scenario, we can add a variable FileName that stores the filename, then add the two variables as derived columns like below in the Derived Column Transformation:
    Name:
    SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],"_",1)+1,FINDSTRING(@[User::FileName],"_",2)-(FINDSTRING(@[User::FileName],"_",1)+1))
    Dept:
    @[User::Name] =="M02"?"dept 45":@[User::Name] =="B15"?"dept 99":"dept 00"
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • 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

  • Replace "\\\\''" from a derived column

    Hi All,
    Quick Question : need to replace in a string the value '' (quote quote) by \\'' (antislash antislash quote quote).
    This change could be done from a derived column transformation
    Obviously REPLACE(field_value,"''","\\\\''") doesn't run...
    Thx for your help

    Don't understand the following issue :
    1/ from a NEW project into a derived colum i enter :
    "REPLACE(field1,@[User::varSearch],@[User::varReplacement])" 
    => black font : it s running
    2/ from an existing project I create the both variable : varSearch, varReplacement
    and into a derived colum : "REPLACE(field1,@[User::varSearch],@[User::varReplacement])" 
    => red font : it s running
    I suppose a format (wstr) or lenght field issue... 

  • Output a derived column to a flatfile destination

    I'm a newbie. My source is a sql server table. Then I dropped a derived column icon. And finally a flatfile destination.
    When I open the flatfile destination, it does show the new column as 'Derived Column 1' in the Available Input Columns, but it's not shown in the Available Destination Columns.
    How do I add it to the Available Destination Columns?

    I had to open the flat file connection manager window and manually add a new column.

  • Adding Rank for a Column in SSIS Derived Column

    H
    I want to add rank to a column in ssis in a derived column actually.
    Can u please tell how to add it and the syntax for adding it in a derived column.

    Thanks,
    Can you please give the script for the same.
    I am unable to write the script for my logic to implement in SSIS.
    I will be very thankful if some one could help me with it.
    Thanks in Advance.
    Sam thats too generic there would be several ways to solve one problem ... 
    can u tell us what is ur source [i mean table view THE DATA which records tuples you suspect is having duplicates ] 
    on what basis u decide duplicate ? and what row qualifies to go into destination ... for eg  say ur source is 
    select id,name, date from source_table  
    duplicacy could mean id and name being repeated multiple times and may be business rule is like pick up rec with latest date vale if thats the case go for source as : 
    select id, name,max(date) from sourcetable 
    group by id,name 
    if all the columns are repeating in your source table may be use DISTINCT ... 
    would be great if u give ur destination, source and business requirement ..
    if you have got primary key violations and any record qualifies then may be simply at destination component set Ignore failure property and ur job is done ...
    may be removing duplicate at source itself ... might solve ur problem 
    check out more on duplicates : http://blog.sqlauthority.com/2009/06/23/sql-server-2005-2008-delete-duplicate-rows/
    i hope u got the idea ... 
    Hope that helps ... Kunal

  • Reference the value of a Derived Column

    Hi Folks.
    Starting a new tread on this because the title fo the original thread which I was replying to does not address the specific issue i have now.
    If I add a [derived column] to the report definition and give put the following in the HTML Expression..
    <input type="file">
    Then I get the file browser for each row.
    Now how can I reference the value of the derived column on a row by row basis. What is the syntax for referring to the column value?
    Any assistance greatly appreciated.
    Many thanks
    Simon

    It's a case of "Close, but no cigar" I'm afraid.
    Whilst this solution will capture the 'string' selected in the column. APEX still will not put the file into the APEX_APPLICATION_FILES table.
    This would appear to be the final missing link in the chain.
    Should you, or anyone, know how to do this, please post a reply. I did find seom info in this thread...
    insert multiple files from a single form
    but I'm finding it hard to follow, especially as the original tutorial link no longer works.
    This page, by Denes Kubicek seems to do the trick for him...
    http://htmldb.oracle.com/pls/otn/f?p=31517:161:474655789644959::NO
    Have asked him if he will post the backend code.
    Simon

  • How can I implement an user function in a derived column of a report ?

    Hello,
    I've a report and added a derived column.
    In this column should be displayed the result of a function.
    GETANZGJMONATE ( to_date(#START_AFA#,'DD.MM.YYYY'), #ND#, :P302_GJ );
    How can I implement this?
    Thanks in advance
    Regards Ulrike

    Ulrike - I would do this in the SQL statement (there may be other ways).
    Presumably START_AFA and ND are table columns?
    Presumably you've also created the GETANZGJMONATE function?
    So, something like this should work (this also assumes that START_AFA is of a DATE type - you'll need the TO_DATE call if not):
    SELECT COL1
    , COL2
    , START_AFA
    , ND
    , GETANZGJMONATE (START_AFA, ND, :P302_GJ)
    from TABLE
    where ...
    Can't remember if you have to grant any particular execute permissions on the function ('grant execute on GETANZGJMONATE to public', for example) when you call it from SQL on a page, but you could try that if the function call fails.
    Depending on what's in :P302_GJ and what the function parameter data type is, you might need to use the '&P302_GJ.' syntax or TO_NUMBER etc.
    Hope this helps.
    Regards,
    John.

  • Rounding to 2 decimal places in Derived column transform editor

    I want to replace the contents of a value column with itself but rounded to 2 decimal places.
    The current column is a double and I have tried to perform this using the following expression but it fails to work.
    Code Snippet
    Round(cc_vl,2)
    How should I achieve this?

    I’ll take a guess here but you started with this –
    123.45678
    Got this –
    123.45000
    Wanted this –
    123.45
    So the 123.45000 is absolutely correct, the value has been rounded to 2 digits. A double however has a scale greater than 2, and you only wanted two digits after the point because you were concerned about how the value looked rather than the actual value. This is certainly not a bug. It is how you format the data for display.
    Your solution is the way to do this, either on the Derived Column or Data Conversion Transformation. You got it in the end, the replace versus new, because you cannot change the type of a column. You may convert the value, but the storage type of the column means it will implicitly revert to the base column type when you put it back, albeit with a value that has been rounded.
    Does that explain it?

  • Derived Column in Query

    Can somebody help me with this syntax? I am taking two working
    queries and putting them together such that one becomes a
    derived column in the other. I am guessing that I must just be
    missing some small syntax point (I don't use Oracle much)
    because this query runs fine in a SQL Server. I thought I had
    gotten all the syntax converted, but I'm getting an error: "ORA-
    00936: Missing Expression". Here's the statement:
    SELECT A.CNTRCT_ID, A.VENDOR_ID,
    (Select X.XLATSHORTNAME
    From Sysadm.XLATTABLE X
    WHERE X.EFFDT =
    ( SELECT MAX(EFFDT)
    FROM Sysadm.XLATTABLE
    WHERE X.FIELDNAME = FIELDNAME AND X.LANGUAGE_CD =
    LANGUAGE_CD AND X.FIELDVALUE = FIELDVALUE
    AND EFFDT <= TO_DATE('12/26/2001','MM-DD-YY')
    And X.FIELDNAME = 'CNTRCT_STATUS' And X.FIELDVALUE=
    A.CNTRCT_STATUS
    ) as StatusExtended,
    A.CNTRCT_BEGIN_DT, A.CNTRCT_EXPIRE_DT, A.DESCR, B.NAME1
    FROM Sysadm.PS_CNTRCT_HDR A, Sysadm.PS_VENDOR B
    WHERE A.Z_PURCH_DOC_TYPE = 'B' AND A.CNTRCT_STATUS <> 'C' AND
    B.VENDOR_ID = A.VENDOR_ID AND B.SETID = A.VENDOR_SETID
    AND A.CNTRCT_EXPIRE_DT BETWEEN TO_DATE('12/26/2001','MM/DD/YY')
    AND TO_DATE('1/25/2002','MM/DD/YY')
    Order By B.NAME1
    Thanks for your help!

    Your code runs O.K. in Oracle 8.1.7.  I don't have 8.0.4 to test
    it on, but I suggest you try re-writing it something like below,
    and see if it works:
    SELECT   A.CNTRCT_ID,
             A.VENDOR_ID,
             A.CNTRCT_BEGIN_DT,
             A.CNTRCT_EXPIRE_DT,
             A.DESCR,
             B.NAME1,
             c.xlatshortname AS StatusExtended
    FROM     sysadm.PS_CNTRCT_HDR A,
             sysadm.PS_VENDOR B,
             (Select X.XLATSHORTNAME, x.fieldvalue
              From   sysadm.XLATTABLE X
              WHERE  X.EFFDT =
                     (SELECT MAX (EFFDT)
                      FROM   sysadm.XLATTABLE
                      WHERE  X.FIELDNAME = FIELDNAME
                      AND    X.LANGUAGE_CD = LANGUAGE_CD
                      AND    X.FIELDVALUE = FIELDVALUE
                      AND    EFFDT <=
                             TO_DATE ('12/26/2001', 'MM/DD/YYYY'))
              And    X.FIELDNAME = 'CNTRCT_STATUS') c
    WHERE    A.Z_PURCH_DOC_TYPE = 'B'
    AND      A.CNTRCT_STATUS <> 'C'
    AND      B.VENDOR_ID = A.VENDOR_ID
    AND      B.SETID = A.VENDOR_SETID
    AND      A.CNTRCT_EXPIRE_DT
             BETWEEN TO_DATE ('12/26/2001', 'MM/DD/YYYY')
             AND     TO_DATE ('01/25/2002', 'MM/DD/YYYY')
    And      c.FIELDVALUE = A.CNTRCT_STATUS
    Order By B.NAME1

  • Data Conversion and Derived Column issues

    I have a strange issue occurring with one of my SSIS packages. 
    What needs to happen:
    I have to read data from a table that stores a field in NCHAR(40)
    Send it through a Data Cleansing SSIS Component that forcefully outputs the data at a cleansed state as DT_STR(50)
    Update the same source table with cleansed data - Using an UPSERT third party tool
    Of course, I can't update the tables that stores data in NCHAR(40) with data from DT_STR(50), so I'm trying to use the Data Conversion Component, the Derived Column Component or a combination of, to set the data to DT_WSTR as well as to set the correct length,
    from 50 to 40.
    The Data Conversion Component fails when I try to set the incoming data (DT_STR(50)) to DT_WSTR(40):
    [Data Conversion [186]] Error: Data conversion failed while converting column "MD_Address1" (97) to column "_MD_Address1" (190).  The conversion returned status value 2 and status text
    "The value could not be converted because of a potential loss of data.".
    Now I tried the same thing with the Derived Column Component, converting the data from the DQS component from (DT_STR(50)) to DT_WSTR(40) and there's the error message:
    [Derived Column [196]] Error: The "Derived Column" failed because truncation occurred, and the truncation row disposition on "Derived Column.Inputs[Derived Column Input].Columns[_MD_Address1]"
    specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
    I also tried a combination of Data Conversion (From DT_STR(50) to DT_WSTR(50)) and a Derived Column just casting to the correct size, but that didn't work either. 
    Every time I try to change the size, one of the components fail. 
    It appears that my issue has nothing to do with the data types, but the actual data length.
    Why can't SSIS CAST my input from 50 to 40?
    What do I need to do to cast/convert data from DT_STR(50) to DT_WSTR(40)?

    Hi IgorSantos_FL,
    It is the expected behavior when we try to convert DT_STR(50) (means maximum 50 characters in the value) to DT_WSTR(40) (means maximum 40 characters in the value). However, the truncation issue should not occur if you convert DT_STR(50) to
    DT_WSTR(50). Could you post the error message that you received when converting DT_STR(50) to DT_WSTR(50)? It may be a different issue.
    Regards,
    Mike Yin
    TechNet Community Support

  • Best way to derive a "week ending" date using the Derived Column Transformations

    Hi, I have an interesting challenge. I am working on creating a BI DB that contains timesheet data. The data contains a column representing the date "worked"  ([Date]. Nearly all output reporting is based on a timesheeting week that end on
    a Wednesday. My thinking has been to create a derived column "WE" (week ending) that represents the entries of the preceding 6 days.
    (Originally I entertained deriving this value view SQL view - however we are talking about a DB that is is a substantial DB (excess of 100M timesheet bookings) and an index on the WE field is warranted) so decided a derived WE column was best approach.
    The Date field is represented from a SAP format (German long dated format) - however I cannot use the convert option ;( in the TE.
    The Date field is derived via: (DT_DATE)(SUBSTRING([Date      ],7,4) + "-" + SUBSTRING([Date      ],4,2) + "-" + SUBSTRING([Date      ],1,2))
    I would welcome some recommendation on how to best derive a WE column. (The DT_DATE format is not susceptible to a /7, mod7 operation).
    Thanks in advance,
    /L

    Try this solution :
    http://stackoverflow.com/questions/1803987/how-do-i-exclude-weekend-days-in-a-sql-server-query

  • Problem with derived column

    Hi friends,
    [Reports 6i - 6.0.8.20.1 & DB 9.2.0.8 ]
    I have problems in one report to rerieve the value of a column in my Query1 in a derived column.
    Let's say that we have a query (Q1) that obtain the departments of a company.
    And a second query that obtain certain data for each department of Q1 and (this is important) we can't (due to others requirements) use a "link" to join the querys.
    So my idea was to create a formula column (FC1) in Q1 where the departement is stored... and, out of the query, create a derived column that would have the value of FC1.
    Then ... in design model... I'll have 2 repeating frames... one based on Q1 and other based on Q2..
    Q1 Frame is ok and shows all departments... but... Q2 repeating... only shows values for 1 department... So my derived column seems not to change when the value of FC1 changes...
    Any ideas?
    Thanks,
    Jose

    If your query1 is something like
    SELECT ...
    d.deptno,
    FROM
    ...dept d
    WHERE ...
    and you want to do query2
    SELECT ...
    FROM ...
    for all departments but then split the output on display by department.
    I'd go with the suggestion from the other poster above:
    Do your query1 as
    SELECT ...Query1Fields,
    Query2Fields
    FROM Query1Tables, (put query2 here) q2
    where q2.deptno = dept.deptno -- or whatever the conditions are
    Or use
    WITH q2 AS (put query2 here)
    SELECT ...Query1Fields,
    Query2Fields
    FROM Query1Tables, q2
    where q2.deptno = dept.deptno -- or whatever the conditions are
    That second format should ensure that query2 is done as one whole unit.
    Then in the data model drag and drop the query2fields outside the query1 group to form a new group below it. Then in the layout you have a repeating group based on the query1 group and within it a repeating group based on the new "query2" group.

Maybe you are looking for