Urgent SQL question : how to flip vertical row values to horizontal ?

Hello, Oracle people !
I have an urgent SQL question : (simple for you)
using SELECT statement, how to convert vertical row values to horizontal ?
For example :
(Given result-set)
MANAGER COLUMN1 COLUMN2 COLUMN3
K. Smith ......1
K. Smith ...............1
K. Smith ........................1
(Needed result-set)
MANAGER COLUMN1 COLUMN2 COLUMN3
K. Smith ......1 .......1 .......1
I know you can, just don't remeber how and can't find exactly answer I'm looking for. Probably using some analytic SQL function (CAST OVER, PARTITION BY, etc.)
Please Help !!!
Thanx !
Steve.

scott@ORA92> column vice_president format a30
scott@ORA92> SELECT f.VICE_PRESIDENT, A.DAYS_5, B.DAYS_10, C.DAYS_20, D.DAYS_30, E.DAYS_40
  2  FROM   (select t2.*,
  3                row_number () over
  4                  (partition by vice_president
  5                   order by days_5, days_10, days_20, days_30, days_40) rn
  6            from   t2) f,
  7           (SELECT T2.*,
  8                row_number () over (partition by vice_president order by days_5) RN
  9            FROM   T2 WHERE DAYS_5 IS NOT NULL) A,
10           (SELECT T2.*,
11                row_number () over (partition by vice_president order by days_10) RN
12            FROM   T2 WHERE DAYS_10 IS NOT NULL) B,
13           (SELECT T2.*,
14                row_number () over (partition by vice_president order by days_20) RN
15            FROM   T2 WHERE DAYS_20 IS NOT NULL) C,
16           (SELECT T2.*,
17                row_number () over (partition by vice_president order by days_30) RN
18            FROM   T2 WHERE DAYS_30 IS NOT NULL) D,
19           (SELECT T2.*,
20                row_number () over (partition by vice_president order by days_40) RN
21            FROM   T2 WHERE DAYS_40 IS NOT NULL) E
22  WHERE  f.VICE_PRESIDENT = A.VICE_PRESIDENT (+)
23  AND    f.VICE_PRESIDENT = B.VICE_PRESIDENT (+)
24  AND    f.VICE_PRESIDENT = C.VICE_PRESIDENT (+)
25  AND    f.VICE_PRESIDENT = D.VICE_PRESIDENT (+)
26  AND    f.VICE_PRESIDENT = E.VICE_PRESIDENT (+)
27  AND    f.RN = A.RN (+)
28  AND    f.RN = B.RN (+)
29  AND    f.RN = C.RN (+)
30  AND    f.RN = D.RN (+)
31  AND    f.RN = E.RN (+)
32  and    (a.days_5 is not null
33            or b.days_10 is not null
34            or c.days_20 is not null
35            or d.days_30 is not null
36            or e.days_40 is not null)
37  /
VICE_PRESIDENT                     DAYS_5    DAYS_10    DAYS_20    DAYS_30    DAYS_40
Fedele Mark                                                          35473      35209
Fedele Mark                                                          35479      35258
Schultz Christine                              35700
South John                                                                      35253
Stack Kevin                                    35701      35604      35402      35115
Stack Kevin                                    35705      35635      35415      35156
Stack Kevin                                    35706      35642      35472      35295
Stack Kevin                                    35707      35666      35477
Stack Kevin                                               35667      35480
Stack Kevin                                               35686
Unknown                             35817      35698      35596      35363      35006
Unknown                                        35702      35597      35365      35149
Unknown                                        35724      35599      35370      35155
Unknown                                                   35600      35413      35344
Unknown                                                   35601      35451      35345
Unknown                                                   35602      35467
Unknown                                                   35603      35468
Unknown                                                   35607      35475
Unknown                                                   35643      35508
Unknown                                                   35644
Unknown                                                   35669
Unknown                                                   35684
Walmsley Brian                                 35725      35598
23 rows selected.

Similar Messages

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to capture the row  value in Advanced Table on OAF ?

    Hi:
    I was wondering, if anyone has any idea as to how to capture a row value on an advanced table on a OAF Page.
    I am currently trying to capture the Expense Report Number ( first column) on the Track Expenses Reports table on the page /oracle/apps/ap/oie/webui/HomePG.
    Any idea would be helpful ?
    Thank You

    Hi,
    856070 wrote:
    This is what I am looking for :
    Default Functionality
    On the expenses home page there is a table for the Submitted expenses Table ( advanced table) with multiple Expense Number rows , which has a link associated with every expense number. When the user clicks the expense number link , EBS takes you to a more detail information page. ---As per default functionality :::whene ever user clicks on link it will takes u to details info page based expense no right.
    ---Check the property of the Destination URL of the ExpensionNumber column.
    ---In this property u can find the page path and paramam ex:pexpencenumber.
    Customized functionality
    I would like to capture the Expense number on the detailed page to call another application based on the expense number. The expense number on the
    detailed page is not available on the request-parameter or on the VO.
    I was thinking of capturing the ExpenseNumber when the user clicks it and save the expense number on a >transientvalue to retrieve it on the detaile dpage..but unable to do so.---Here get the paramereter pexpencenumber and pass it to another appilcation.
    Regards
    Meher Irk

  • Sql report, How to access current rows 6 columns data

    I have one page having page items & SQL report having 8 columns.
    First column of report is a link for editing.
    on clicking first column, that record gets displayed on page items, which are opn same page.
    Now my problem is i have used link column of report and set 3 page items value on click of link column.\
    But i need to set values for 2 more page items.
    I tried to create computation & process but not working. i am confused about which process point to select & whether onclick page gets submitted or not.
    I tried to write jscript but not succeeded. I dont know how to get current row id in jscript & different column values of current rowid.
    any help.

    Hi,
    Thanks for reply.
    in 5 items, first three are numeric and last two are timestamp fromtime, totime.
    as I mentioned earlier if i interchange 4 & 5 items i.e. now ITEM4 is totime & ITEM5 is fromtime
    and their values. I get value for totime & not for fromtime. all records contain values for all 5 columns. no null.
    So basically their is no problem in value or data, The only problem is whatever sequence is maintained first 4 items get value & 5th item remains blenk.
    Either I type all 5 ITEM NAMES in one Item name-value pair of link or use all three pairs, 5th ITEM remain blank.

  • How to get current row value from table when press the submit button

    Hi,
    I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table.
    I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press the first row's button means then i want to fetch the first row's SuccessionPlanId and if it is 3rd means then i want to get the value of third row's value.
    How to do it in controller extension?
    Please reply soon, its urgent.
    Thanks in advance,
    SAN

    Pratap,
    Yes, I tried with 'delete' button which is seeded one.
    For this, our code using row reference is working too fine. it throws exact SuccessionPlanId value of corresponding row.
    I created MessageStyledText, but here i need to give text value right, then only it 'll appear in the page.
    Instead i created one image and fired explicitly from the controller processRequest method.
    But the same problem remains..
    here my code:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean){
    super.processRequest(pageContext, webBean);
    OAButtonBean oabb = (OAButtonBean)webBean.findChildRecursive("XXSubmit");
    FireAction action = new FireAction("XXSubmit");
    oabb.setAttributeValue(UIConstants.PRIMARY_CLIENT_ACTION_ATTR, action);
    OAImageBean oaib=(OAImageBean)webBean.findChildRecursive("XXSubmitImage");
    oaib.setFireActionForSubmit("XXSubmitImage", null, null, true);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
    if("XXSubmitImage".equals(pageContext.getParameter("event"))){
    String succIdI="";
    String rowRefI = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    if(rowRefI != null && !("".equalsIgnoreCase(rowRefI ))){
    PerSuccPlanSearchVORowImpl rowI = (PerSuccPlanSearchVORowImpl)oaam.findRowByRef(rowRefI);
    if(rowI != null)
    succIdI=rowI.getAttribute("SuccessionPlanId").toString();
    }else{
    throw new OAException("Row is null");
    throw new OAException(succIdI, OAException.INFORMATION);
    }else{
    super.processFormRequest(pageContext, webBean);
    If i run the page using this controller, it throws exception without any value, because for 'succIdI' i initialized without any string.
    Can you please suggest me how to solve?

  • How to access each row value for a database item

    On my form I have a database datablock that represents a table in my database.
    5 rows are shown with a scroll bar that can be viewed to show the rest.
    The user is able to change some of the Database Item values represented in this datablock for any row shown in the datablock.
    I need to validate the correctness of the users change before allowing the database datablock to update the table in the database.
    But a database item in a datablock will represent a value for every row in the table. So how do I access each row value for a database item separately. What is the PL/SQL syntax?
    thanks,
    michelle

    In my situation it was better to use the loop instead
    of a when validate trigger because...Well it was clearly not better to use a loop that doesn't work. I don't understand what you're not clear on about the item and record validation triggers. If you have a specific validation rule for a single field (such as a date that cannot be in the future), that would go in a When-Validate-Item trigger on the date item. If the user enters a future date, your code would display an error message and raise a failure. Raising a failure prevents the item from being marked as valid. Invalid items prevent the record from being inserted/updated. Sometimes you have a validation rule that requires looking at more than one item at a time, such as two items that must either both be NULL or NOT NULL. In that case, you could not use a When-Validate-Item trigger because you can't clear or populate both at once. So then you would use a When-Validate-Record at the block level and if one field is NULL and the other isn't, you would display an error message and raise a failure. Forms is very civil in this respect; we don't throw exceptions around here, but then I digress.

  • How to convert a row value in CSV file to column value

    Hi
    We have one requirement where we have to show the row value to column level value
    for Example:
    Source file will be in below format
    Component Name :101
    **Batch #     **100% Mod     200% Mod      300% Mod      400% Mod     Tensile     Elongation     Thickness*
    8584-17     498     1211     1986     2601     3133 523     0.088
    Output Format has to be:
    **Batch #     **100% Mod     200% Mod      300% Mod      400% Mod     Tensile     Elongation     Thickness Component name*
    8584-17     498     1211     1986     2601     3133 523     0.088 101
    How can we achieve this using shell/Perl script

    .

  • How to propogate previous row value

    All,
    I have a query were I need to fill the null data with previous row value. Like I have a table were we record all the On hand quantity for a item for a date. Lets say I have only 2 rows in this table for a month then I am planning to write a view that will give me 31/30 rows for a month and if for a specific date is the value is null then it should read from previous row unitl it finds the data otherwise display 0.
    Ex. Actual table
    Item No Date Qty
    1 1/1/2010 10
    1 1/5/2010 15
    View I have written, I need to fill the null Qty with previous row data
    Item No Date Qty
    1 1/1/2010 10
    1 1/2/2010
    1 1/3/2010
    1 1/4/2010
    1 1/5/2010 15
    1 1/6/2010
    I want something like this how can i do this?
    Item No Date Qty
    1 1/1/2010 10
    1 1/2/2010 10
    1 1/3/2010 10
    1 1/4/2010 10
    1 1/5/2010 15
    1 1/6/2010 15
    Thanks

    Hi Sung, sorry by my delay
    Basically I'm building a Client Framework that a lot of actions are automatically managed, then I extend Objects
    for example EntityImpl. I let to user set any value to the
    database mapped fields but I will check this values
    using my own bussines rules before to insert into database
    and if this values are wrong I display an alert.
    My problem is that I catch insert event to call validate
    functions. But when any value is wrong I will show an alert, but if user commits transaction after validate
    funcion is not revalidated. Well I supose that is a bad implementation for validation rules, now amb reading about
    Validationlistener because I think is the best way to do
    all that I need. I let to the user add field values but
    these values not will commited while validationListeners
    return isValid = true;
    Thanks Sung.
    Albert.

  • How to convert some row values in columns

    Hello guys,
    I'm using Oracle 10g in a windows platform, I have the following data:
    with test as
    select '000-ME-001' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
    select '000-ME-001' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
    select '000-ME-001' tag_number, 'Capacity 350' tag_details1, '000-TS-M-228' tag_details2 from dual union all
    select '000-ME-002' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
    select '000-ME-002' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
    select '000-ME-002' tag_number, 'Capacity 350' tag_details1, '000-TS-M-228' tag_details2 from dual union all
    select '000-ME-003' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
    select '000-ME-003' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
    select '000-ME-003' tag_number, 'Capacity 350' tag_details1, '' tag_details2 from dual
    )How can I covert the values of tag_details1 as column name to achieve this result:
    tag_number     Capacity 150     Capacity 250     Capacity 350
    000-ME-001     000-TS-M-226     000-TS-M-227     000-TS-M-228
    000-ME-002     000-TS-M-226     000-TS-M-227     000-TS-M-228
    000-ME-003     000-TS-M-226     000-TS-M-227Hope you can help me, best regards.

    select tag_number
         , max (decode (tag_details1, 'Capacity 150', tag_details2))
         , max (decode (tag_details1, 'Capacity 250', tag_details2))
         , max (decode (tag_details1, 'Capacity 350', tag_details2))
      from test
    group by tag_numberas in
    SQL> with test as
      2  (
      3  select '000-ME-001' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
      4  select '000-ME-001' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
      5  select '000-ME-001' tag_number, 'Capacity 350' tag_details1, '000-TS-M-228' tag_details2 from dual union all
      6  select '000-ME-002' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
      7  select '000-ME-002' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
      8  select '000-ME-002' tag_number, 'Capacity 350' tag_details1, '000-TS-M-228' tag_details2 from dual union all
      9  select '000-ME-003' tag_number, 'Capacity 150' tag_details1, '000-TS-M-226' tag_details2 from dual union all
    10  select '000-ME-003' tag_number, 'Capacity 250' tag_details1, '000-TS-M-227' tag_details2 from dual union all
    11  select '000-ME-003' tag_number, 'Capacity 350' tag_details1, '' tag_details2 from dual
    12  )
    13  select tag_number
    14       , max (decode (tag_details1, 'Capacity 150', tag_details2))
    15       , max (decode (tag_details1, 'Capacity 250', tag_details2))
    16       , max (decode (tag_details1, 'Capacity 350', tag_details2))
    17    from test
    18   group by tag_number
    19  /
    TAG_NUMBER MAX(DECODE(T MAX(DECODE(T MAX(DECODE(T
    000-ME-002 000-TS-M-226 000-TS-M-227 000-TS-M-228
    000-ME-001 000-TS-M-226 000-TS-M-227 000-TS-M-228
    000-ME-003 000-TS-M-226 000-TS-M-227Edited by: Alex Nuijten on Jun 3, 2009 4:03 PM

  • How to get Current Row values in Af:ForEach

    Hi,
    We have a requirement to conditionally Display/Hide CommandLink item in af:forEach Loop.
    <af:forEach items="#{bindings.RegionalAreaPVO.rangeSet}" var="parent">
    <af:spacer height="10" id="s1"/>
    <af:commandLink inlineStyle="font-weight:bold;" text="#{parent.ItemName}" partialSubmit="true" actionListener="#{backingBeanScope.RegionalAreaBean.launchTaskflow}" id="cl1" rendered="*#{backingBeanScope.XXWFCRegionalAreaBean.modelEligibleflag eq true}*">
    <af:setActionListener from="#{parent.Code}" to="#{parentNode}"/>
    </af:commandLink>
    </af:forEach>
    I have added a Cutom Managed Bean Class and Returning boolean value to Control Render property which is working. But now i want to add business Logic based on 'parent.ItemName' or 'parentNode' Values in the bean method to return proper Boolean value.
    But i am unable to get the Current Iteration values in the bean method.
    I am using below EL expressions to get the values. But no luck.
    String nameel = (String)ADFUtil.evaluateEL("#{bindings.parent.ItemName}");
    String codeel = (String)ADFUtil.evaluateEL("#{parent.Code}");
    String nodeEl = (String)ADFUtil.evaluateEL("#{parentNode}");
    Also, i have tried getting the Row object like below but i am getting the First row details always. My intention is to get Current row values and use them for Business logic.
    ViewRowImpl row =
    (ViewRowImpl)ADFUtil.evaluateEL("#{bindings." + VoName +
    "Iterator.currentRow}");
    String code = (String)row.getAttribute("Code");
    Any help is highly appreciated.
    Thanks
    Kaja

    Hi Sascha,
    I have tried that. But in my case the functional logic behind the Rendering is based on more complex logic. Hence i am trying to add a method to return a boolean in Render property of the Link.
    But the real problem for me is, in the Managed bean method i am not finding a way to get the Current Iteration index. If i can get the Current iteration index, i can get the Corresponding Component ID of Command link (In the forEach Loop Component Id's are getting generated Dynamically based on Iteration Index), i can use that and add additional logic and derive true/false to return.
    Any inputs?
    Thanks
    Kaja

  • SQL help, how to split one row into many rows

    Hi,
    I got a question on SQL. One table, structure like this: (2 columns)
    A 123,456,789
    B 012,345
    C 678,901,234
    How to get the final result like below:
    A 123,
    A 456,
    A 789
    B 012,
    B 345,
    C 678,
    C 901,
    C 234
    Do I have to use PL/SQL? Appreciate any thought you have on it!

    i doubt the second column string operation can be acheived within single query to break it into rows.
    but here is the pl/sql to do it.
    SQL> create table test_data(col1 varchar2(5), col2 varchar2(30))
      2  /
    Table created.
    SQL> insert into test_data values('A','123,456,789')
      2  /
    1 row created.
    SQL> insert into test_data values('B','012,345')
      2  /
    1 row created.
    SQL> insert into test_data values('C','678,901,234')
      2  /
    1 row created.
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    pos   number:=0;
      3    str   test_data.col2%type;
      4  begin
      5    for i in (select col1, col2 from test_data)
      6    loop
      7      str := i.col2||',';
      8      loop
      9        pos := instr(str, ',');
    10        dbms_output.put_line(i.col1||' '||substr(str, 1, pos-1));
    11        str := substr(str, pos+1);
    12        exit when str is null;
    13      end loop;
    14    end loop;
    15  end;
    16  /
    A 123                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    A 456                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    A 789                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    B 012                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    B 345                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    C 678                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    C 901                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    C 234                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    PL/SQL procedure successfully completed.

  • Urgent!! How to delete a row with OrdImage (New)!!!

    I got a problem when I attempt to delete a row that contains a Image in a view object:
    I am using JDeveloper 3.2. And also I use BC4J for my project. I use a web bean to delete a row from a view object:
    For example, the web bean contain the following method "deletePic", the part code is following:
    try {
    JSPApplicationRegistry jr = JSPApplicationRegistry.getInstance ();
    ApplicationModule ei = jr.getAppModuleFromContexts("Testpackage_Test_TestAM", session, null);
    ViewObject s = ei.findViewObject ("PicVO");
    s.executeQuery ();
    if (s.hasNext ())
    s.next ().remove ();
    ei.getTransaction().commit();
    } catch (java.lang.Exception e) {
    System.out.println (e.toString ());
    I simply use the Row remove method to delete a row that contain a ORDImage Field. But I got the following error that is:
    oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Delete": SQL Statement " DELETE FROM TESTTABLE Testtable WHERE TESTID=:1".
    I check for this error only know this error ocurr when try to commit the transaction, but don't know how to solve it....
    pls help me..thx.
    null

    Hi Akira,
    I created a table using the following SQL statement:
    create table timg (id number primary key, image ordsys.ordimage);
    Then I inserted some records. Next, I populated the images in some rows.
    Then, I created a Business Components project. At last, I created a web bean and used this web bean in a JSP page.
    In the web bean, I used your code but modified the applicationId string and view name string to reflect the ones on my machine.
    The JSP ran successfully. The rows were deleted from the table by the web bean. I didn't see the exception. The database I am using is 817, the JDeveloper version is 3.2.3.
    thanks,
    Richard

  • SQL LOADER - How to combine 3 rows into 1

    Hi,
    I have an input file composed of 4 different data types in 4 rows.
    line1 has fld1 text(100)
    line2 has fld2 number(4)
    line3 has fld3 date(10) "mm/dd/yyyy"
    line4 has fld4 date(10) "mm/dd/yyyy"
    all line has data in it.
    This is my control file:
    LOAD DATA
    INFILE "fileA.txt"
    truncate
    CONCATENATE 4
    INTO TABLE ps_vz_ppc_blng_aud
    TRAILING NULLCOLS
    ( text_fld CHAR(100) TERMINATED BY WHITESPACE
    ,num_fld INTEGER EXTERNAL(4)
    TERMINATED BY WHITESPACE
    ,begin_date DATE(10) "mm/dd/yyyy"
    TERMINATED BY WHITESPACE
    ,end_date DATE(10) "mm/dd/yyyy"
    TERMINATED BY WHITESPACE
    ,row_added_dttm     sysdate
    ,row_added_oprid "USER"
    My error: cannot insert null into num_fld.
    What did I do wrong? Terminated by whitespace did not end when the line end? Or the first field needs to be 100 characters and ends with end of line?

    That means the structure of your data is now something like:
    line1|1|01/01/2001|02/01/2001
    line2|2|01/01/2002|02/01/2002If so, you can use the following control file
    LOAD DATA
    INFILE "fileA.txt"
    truncate
    INTO TABLE ps_vz_ppc_blng_aud
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
    ( text_fld        char
    , num_fld         integer external
    , begin_date      DATE "mm/dd/yyyy"
    , end_date        DATE "mm/dd/yyyy"
    , row_added_dttm  sysdate
    , row_added_oprid EXPRESSION "USER"
    )P.S. There is no automatic notification, just come back from time to time and check for new postings.

  • URGENT SQL question!

    Hi all,
    I've been struggling with this for quite some time now...
    Let us assume that I have a table "EMPLOYEE" consisting of the following columns and data ('DD/MM/YYYY'):
    EMP_NAME START_DATE END_DATE
    john 01/01/2003
    mark 02/02/2003
    peter 03/03/2003
    sue 04/04/2003
    The START_DATE for each employee has to be the END_DATE of the previous employee (except for the first record where the START_DATE will be that employee's corresponding END_DATE - 31.
    This is how I want the table to look after the update:
    EMP_NAME START_DATE END_DATE
    john 01/12/2002 01/01/2003
    mark 01/01/2003 02/02/2003
    peter 02/02/2003 03/03/2003
    sue 03/03/2003 04/04/2003
    I'm TOTALLY stumped! What should I use? rownum, rowid or what?
    Regards,
    Johann.

    Sorry, the first one is wrong!!!
    UPDATE employee
    SET start_date = (SELECT max(emp.end_date) FROM employee emp WHERE emp.end_date < employee.end_date);
    UPDATE employee
    SET start_date = end_date-31 where start_date is null;
    DC

Maybe you are looking for

  • Unable to log on with apple ID - error message "an unknown error has occurred"

    When I try and log on to apple website using my apple ID, I get an error message saying "an unknown error has occurred".  How can I fix this? I've changed my password several times and was able to successfully make a purchase from Itunes using new pa

  • Get the variant name of the job shceduled in the Background

    Hello All, I am shcduling printout of the Payment Document from F110 transaction code in background. My requirement is to get the variant name. F110 create background job for printing and when i debug it the value of sy-SLSET it is coming some junk v

  • Dynamic Filter Display in Report Designer

    Hi All, We have implemented a new BI reporting tool and are using Report Designer for the output format. The problem is that we cannot see any dynamic filters or navigational level when printing as RD takes it back to the original format. To overcome

  • Several MM document generated by a Shipment costs doc

    Hi gurus, I am trying to split a Shipment costs document into several MM document by carrier. I have a route with different stages. These stages/steps have associated different carriers (or partners). When the MM document is generated the system crea

  • Sending mail from Reader for iOS

    I fill out a PDF form in Adobe Reader for iOS and try to email it from within the app. Only two of my email accounts appear as options to mail "from" and neither are the secure email account I need.   Why do only a few of my email accounts appear? Or