Hiearchical Data Query with Row Column Level

Hi,
I need urgent help in framing the Query to get the date in Hiearchical format.
I tried but unable to:
The format is:
I have Table Test_A and the structure format is as
GroupNo orderheaderNumber customername orderLineNumber address1 address2 address3 city country
1001        101                       Arjun              12                        A1          A2          A3            C1     USA
1001        102                        Dam              13                        A11         A12         A13       C11     AUS
II have Table Test_B and the structure format is as
product OrderHeaderNumber Item Price Dept
SOAP     101                       1      32   10
paste      101                       2     80   20
shampoo 101                      3     100  30
SOAP     102                     1     32   10
paste      102                     2     80   20
shampoo 102                     3     100  30
I want to display data in Format as
GroupNo                    OrderHeaderNumber  customername      orderLineNumber      address1 address2 address3 city country
1001                          101                           Arjun                    12           A1           A2           A3           C1      USA
product                     OrderHeaderNumber Item Price Dept
SOAP                      101                          1      32      10
paste                        101                          2      80      20
shampoo                   101                          3      100   30 
1001                          102                           Dam                     13           A11          A12      A12           C11      AUS
SOAP                          102                          1      32      10
paste                           102                           2      80      20
shampoo                      102                           3      100    30 
Any help will be needful for

Hi,
921311 wrote:
Hi,
I need urgent help in framing the Query to get the date in Hiearchical format.
I tried but unable to:
The format is:
I have Table Test_A and the structure format is as
GroupNo orderheaderNumber customername orderLineNumber address1 address2 address3 city country
1001        101                       Arjun              12                        A1          A2          A3            C1     USA
1001        102                        Dam              13                        A11         A12         A13       C11     AUS
II have Table Test_B and the structure format is as
product OrderHeaderNumber Item Price Dept
SOAP     101                       1      32   10
paste      101                       2     80   20
shampoo 101                      3     100  30
SOAP     102                     1     32   10
paste      102                     2     80   20
shampoo 102                     3     100  30
I want to display data in Format as
GroupNo                    OrderHeaderNumber  customername      orderLineNumber      address1 address2 address3 city country
1001                          101                           Arjun                    12           A1           A2           A3           C1      USA
product                     OrderHeaderNumber Item Price Dept
SOAP                      101                          1      32      10
paste                        101                          2      80      20
shampoo                   101                          3      100   30
1001                          102                           Dam                     13           A11          A12      A12           C11      AUS
SOAP                          102                          1      32      10
paste                           102                           2      80      20
shampoo                      102                           3      100    30
Any help will be needful for
It's rude (and counterproductive) to say things like "urgent" in your message.
What you're asking for is called a Master-Detail Report: you want rows from a Master table (test_a in this case), followed immediately by all related rows from a Detail table (table_b).  Report writers often have tools that make that kind of thing easy; SQL (and PL/SQL) do not.  You can do what you want in SQL, but you'll have to do a lot of work that a report writer would otherwise do for you.
The simplest way to do this in SQL is to do a UNION of 2 queries:
(1) a query involving just the master table, and
(2) a query involving just the detail table
When you do a UNION of 2 queries, both must produce the same number of columns, and the datatypes of the columns must be consistent.  You can include NULL columns to make both queries have the same number of columns, and conversion functions, such as TO_CHAR, so that (for example) you can put a NUMBER like groupno in the same column as a VARCHAR2 like product.
Do you really want interior column headings, such as
product                     OrderHeaderNumber Item Price Dept
in the middle of the output?  You can do that in SQL, but it's more complicated.  You may need a 3rd branch of the UNION. to produce those rows.
If you have trouble doing this, post your best attempt, and a specific question.
Whenever you have any question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002

Similar Messages

  • Creating Query with dynamic columns to show results

    Hi experts,
    I need to know how to create a query with dynamic columns. Meaning, I don't want to create a query with fixed columns representing the 12 periods of the fiscal year to show me actuals as the fiscal year proceeds.
    For example, if I am currently in the middle of period 3 (March) of a fiscal year, when I execute the query, I need it to automatically only show me the 'Actuals' for periods 1 and 2, without seeing the columns from periods 3 to 12 showing blank.
    Then when I am in the middle period 5 (May) the query should ONLY show me the columns for periods 1 to 4 'Actuals', no results should be shown for periods 5 to 12 yet, and I don't want to even see blank columns for period 6 to 12.
    How do I define my columns, to achieve this.
    Maximum points will be awarded.
    Thanks Everyone.

    Hi Josh,
    I'm having a little difficuluty understanding what should be included in my restricted key figures.
    The time characteristics that I have available to use are:
    0FISCPER3 (posting period)
    0FISCYEAR (fiscal year), currently using SAP EXIT to default current fiscal year.
    0FISCVARNT (fiscal year variant).
    In addition, I have the following characteristics available to be used in the columns:
    Value type (10)
    version (currently I'm using variable for it)
    Currency type (020)
    Currency (USD).
    Can you explain what my restricted key figure should be based on and how it should look.
    I tried to create a restircted key figure using 0AMOUNT, and 0FISCPER3. For 0FISCPER3  I created a range from 1 to previous period (using SAP EXIT that supplied previous period).I also had value type, version, currency type, and currency included in that restricted key figure.Then when I tried to drag 0FISCPER3 under the restricted key figure once again, it wouldn't let me, probably because I've already used 0FISCPER3 in the restricted key figure.
    Please let me know if my explanation is not clear.
    Your step by step help would be great.
    Thanks
    Edited by: Ehab Mansour on Sep 23, 2008 2:40 PM

  • ADF BC : "Attributes selected in query with no column type found! ..."

    hi
    Using JDeveloper 10.1.3.3.0, I have this "Selected in Query" attribute, "Never" updatable, in my Entity Object.
    The Entity Object is based on the SCOTT.EMP table and the attribute, called "BonusInfo", is defined using the expression " '[bonus info ' || (SAL * 2) || ']' ".
    see http://verveja.footsteps.be/~verveja/files/oracle/NoColumnTypeFoundApp-v0.01.zip
    While creating this Entity Object, I got a "Business Components" dialog that says:
    "Column type is not specified for this attribute. Specifying column-type and precision results in better query performance at runtime. Do you wish to set column type to VARCHAR2(255)?"
    I clicked "Yes".
    I also created two View Objects based on this Entity Object.
    In the "Create View Object" wizard "Step 4 of 7: Attribute Settings" I got a "Business Components" diaglog that says:
    "Attributes selected in query with no column type found! Specifying column-type and precision results in better query performance at runtime. Do you wish to set default column type for these attributes?"
    I clicked "Yes".
    Testing the query in "Step 5 of 7: SQL Statement" showed "Query is valid.".
    question:
    Why do I keep getting the message ...
    "Attributes selected in query with no column type found! Specifying column-type and precision results in better query performance at runtime. Do you wish to set default column type for these attributes?"
    ... in the View Object Editor if I click on different attributes?
    (I don't get such a message the first time I click on an attribute after opening the View Object Editor, but after that it keeps popping up each time I click on a different attribute, no matter what I answer "Yes", "No" or "Cancel".)
    many thanks
    Jan Vervecken

    Jan,
    BC needs the column type and precision so that we can allocate the correct JDBC buffer size; otherwise we would just allocate 2k per string.
    Blaise

  • Attributes selected in query with no column type found! (solved)

    Dear JHeadstart Team,
    In the view object Editor I have two entity based attributes attrib1 and attrib2
    both with type Number. Both have aliases with type number(9,0)
    If attrib1 is null I want to have the value of attrib2.
    In the expression box I put: nvl(attrib1,attrib2)
    When I press the ok button I get the next error message.
    "Attributes selected in query with no column type found!
    Specifying column-type and precision results in better query performance at runtime.
    Do you wish to set default column type for these attributes? "
    When I say ok I get the next message:
    "An error occurred. Unable to apply all the wizard changes.
    Column type cannot be changed for Entity based attribute.
    Exception: oracle.jbo.dt.objects.JboExeption."
    The details button serves no extra information.
    Since both the attributes have the same type I thought the nvl commando should work.
    But what does the "no column type found" sentence mean?
    regards,
    Marcel.
    Message was edited by:
    user571204

    Thanks Jan,
    You've put me on the right track.
    I found out that this is only possible in the entity object class.
    So I have to check my limited java skills.

  • Unicode : cannot filter query with NVARCHAR2 column

    Hi,
    this is not a POL/SQL-Developer specific problem - but help would be appreciated.
    Configuration Server :
    NLS_CHARACTERSET WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET AL16UTF16
    Client :
    NLS_LANG GERMAN_GERMANY.WE8MSWIN1252
    Column definition :
    LEGALNAME NVARCHAR2 (255);
    If i store for example a kyrillic name with the application i am able to finde the row searching the for the most current modification date and with correct kyrillic coded name.
    but if i want to query by the Legalname - a)/b) does not work;
    A) SELECT * FROM COMPANY WHERE LEGALNAME LIKE 'View, системой%';
    B) SELECT * FROM COMPANY WHERE LEGALNAME LIKE N'View, системой%';
    Do you have some hints???
    kind regards
    Karl
    Edited by: [email protected] on 10-Mar-2009 07:05
    Edited by: [email protected] on 10-Mar-2009 07:10
    Edited by: Spinthma on 12-Mar-2009 03:23

    Hello Sergiusz,
    first thanks a lot for your taking time!!
    it did not work for PL/SQL-Developer (applied both registry - all oracle homes and in environment)
    but it worked for Oracle SQL-Developer according your last posting;
    [m-1951097]
    bq. {color:#808080}By default, SQL Developer uses the JDBC Thin driver. This driver does not recognize the ORA_NCHAR_LITERAL_REPLACE, but the oracle.jdbc.convertNcharLiterals property. Try to add this property to the <SQLDEV_HOME>\sqldeveloper\bin\sqldeveloper.conf file: \\ AddVMOption -Doracle.jdbc.convertNcharLiterals=true \\ Let us know if it helps. I have no time to test myself. \\ {color} \\ {color:#808080} \\ Sergiusz{color}
    {color:#000000}Karl{color}
    bq. {color:#808080} \\ {color}

  • Spry:repeat display data in multiple rows/columns

    I know how to use spry:repeat to display data in table rows,
    one item per row.
    Is there a way to tell spry to display data in a grid of x
    rows by y columns?
    I'm trying to maximize the page's real estate. Here is the
    page
    http://www.jannah.com/mp3/browse.html
    Click on "Artist/Scholar" in "STEP1" section. "STEP2" section
    gets filled with a list. I'm trying to display that list in 3
    columns and as many rows as needed. How do I do that?
    While I'm at it, I also can't figure out why the spry:select
    is not working for "STEP2" section; I need to click twice on the
    same item to get it highlighted. the other spry selects on the page
    work ok. Can someone take a look.
    Greatly appreciated.

    You can't use Spry with tables to do this, but if you're up
    to using a div based layout/presentation, it is possible. Check out
    the Zuggest sample:
    http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html
    It uses floated divs to get the same effect. The nice thing
    about using divs, is that more columns dynamically appear as the
    horizontal real-estate is expanded.
    --== Kin ==--

  • Issue with row/column text lengths in report painter

    Hi Gurus,
    I have created a report painter report with formatting of the row/column length text as medium, but for one FS item/GL Account the report when executed still picks up only the short text length. I am not sure how this can be resolved.
    Any ideas is appreciated.
    Regards
    Satish

    Applied OSS Note 360096 and it worked. Thanks for all your help.

  • Web Service to Query with 21 Columns and up to 1000 Rows

    Hi Experts,
    I have a web service to a query that returns a table of 21 Columns and up to 1000 Rows.
    I would like to display this data in an UI element such List view / Spreadsheet table.
    When I am doing so, I have the following issues:
    1. With the Spreadsheet table I can't set the header of the columns to the name of the column in the query.
    2. with both elements I would like to have a paging capability which I am not sure if is even possible.
    3. With both elements I am not able to set the width of each column as I need, and also not able to define the correct formating (date / string....)
    Is it possible to have what I am looking for with these elements? Or there are other UI elements for it?
    Thanks in advanced,
    DoronS

    Hi Charles,
    Actually, I am using Xcelsius as you said, and wanted to use it also as I mentioned since in the Web Intelligence I could not find the way to have a good filtering mechanism.
    Meaning, there is an option to add filters based on the fields that are in the query. But you can only choose one value per filter filed. If I want filter the data with more than one value it is impossible. Furthermore, there is no way to use free text filtering.
    Do you know in what BO Tool I will be able to provide such filtering capabilities?
    DoronS

  • NullReferenceException on GetSchemaTable() for query with cursor column

    Hi,
    I'm using Oracle.DataAccess.dll v 2.111.6.20 to run queries and read data using OracleDataReader directly. When I execute a query that returns cursors in one of its columns, e.g.
    select cursor(select 1 from dual) from dual
    and then call OracleDataReader.GetSchemaTable(), I get this:
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Oracle.DataAccess.Client.OracleDataReader.GetOraDbType(Int32 i)
    at Oracle.DataAccess.Client.OracleDataReader.GetSchemaTable()
    at ...
    Any idea how to fix it or work around it? The app I'm working on has to handle aribitrary SQL queries, so I can't just rewrite the query to something that doesn't return cursors.
    Thanks,
    Maciek

    Did you run the query itself in the sql-plus?(select cursor(select 1 from dual) from dual)
    from this query the result is 1 in my database.How can it show the column schema of this result set?
    I guess you should send the whole code. GetSchemaTable() does not work with cursor structure.
    The GetSchemaTable method returns a DataTable property that contains the column schema for a DataReader. The DataTable contains one row for each field in the resultset. Each column maps to a property of the field in the resultset. The ColumnName property of the DataTable column is the name of the field's property, such as the ColumnName, DataType, ColumnSize, IsKeyColumn, or IsAutoIncrement property. The value of the DataTable column is the value of the field's property, such as the FirstName value for the ColumnName property.
    Edited by: sek.NET on Dec 19, 2008 2:01 PM
    Edited by: sek.NET on Dec 19, 2008 2:03 PM
    Edited by: sek.NET on Dec 19, 2008 2:16 PM

  • Duplication in SELECT query with XML column

    Oracle 11gR1 RHEL 5
    Hi all,
    I am having a small problem. I am selecting some rows from an XML column with the following query and for each row I get a new set of columns that are displayed.
    select extractvalue(old_row,'/xml/WORK_ITEM_RID') WORK_ITEM_RID,
    extractvalue(old_row,'/xml/PARENT_RID') PARENT_RID,
    extractvalue(old_row,'/xml/ASSIGNED_TO') ASSIGNED_TO
    from audit_trail
    where audit_trail_rid = 177147;
    So instead of getting this:
    WORK_ITEM_RID PARENT_RID ASSIGNED_TO
    4045 4044 2930
    I get:
    WORK_ITEM_RID PARENT_RID ASSIGNED_TO
    4045
    WORK_ITEM_RID PARENT_RID ASSIGNED_TO
    4044
    WORK_ITEM_RID PARENT_RID ASSIGNED_TO
    2930
    How can I get rid of this?
    Thanks.
    Edited by: JrOraDBA on Feb 12, 2010 10:14 AM

    Here is what I got so far...but it keeps telling me that I am missing right parenthesis (ORA-00907) at the assigned_date TO_CHAR(....
    insert into iswrnew.WORK_ITEM (WORK_ITEM_RID, PARENT_RID, ASSIGNED_TO, WORK_ITEM_TYPE_RID, FPRC_APPLICATION_RID, REQUEST_RID, ASSIGNED_DATE, EST_START_DATE, EST_COMPLETION_DATE, SHORT_DESCRIPTION, ASSIGNED_BY, COMPLETED, COMPLETION_DATE, LONG_DESCRIPTION)
    SELECT t1.work_item_rid, t1.parent_rid, t1.assigned_to, t1.work_item_type_rid, t1.fprc_application_rid, t1.request_rid, t1.assigned_date, t1.est_start_date, t1.est_completion_date, t1.short_description, t1.assigned_by, t1.completed, t1.completion_date, t1.long_description
      FROM fprchr.audit_trail,
           XMLTable('/xml'
                    PASSING fprchr.audit_trail.old_row
                    COLUMNS
                    work_item_rid                  NUMBER PATH 'WORK_ITEM_RID',
                    parent_rid                     NUMBER PATH 'PARENT_RID',
                    assigned_to                 NUMBER PATH 'ASSIGNED_TO',
                    work_item_type_rid            NUMBER PATH 'WORK_ITEM_TYPE_RID',
                    fprc_application_rid        NUMBER PATH 'FPRC_APPLICATION_RID',
                    request_rid                    NUMBER PATH    'REQUEST_RID',
                    *assigned_date                TO_CHAR(assigned_date,'YYYY-MM-DD HH24:MI:SS') PATH    'ASSIGNED_DATE',*
                    est_start_date                TO_CHAR(est_start_date,'YYYY-MM-DD HH24:MI:SS') PATH    'EST_START_DATE',
                    est_completion_date          TO_CHAR(est_completion_date,'YYYY-MM-DD HH24:MI:SS') PATH    'EST_COMPLETION_DATE',
                    short_description            VARCHAR2(50) PATH 'SHORT_DESCRIPTION',
                    assigned_by                    NUMBER PATH    'ASSIGNED_BY',
                    completed                    VARCHAR2(1) PATH 'COMPLETED',
                    completion_date                TO_CHAR(completion_date,'YYYY-MM-DD HH24:MI:SS') PATH 'COMPLETION_DATE',
                    long_description            VARCHAR2(4000) PATH 'LONG_DESCRIPTION') t1
    WHERE audit_trail_rid = 177147;I think I'm missing something obvious but I just cannot see it. I need a fresh pair of eyes to look at this :)
    Thanks for all your help

  • Data table with fixed column with

    I have a data table bound to a row set , and I would like the table to have fixed column widths to avoid unpleasant display shifts when paging through it.
    The column component does not have too many properties I can work with (maybe this can be fixed in a future release??). Therefore I tried setting the style property of the output text object inside the column. The result looks good in the IDE, but reverts to variable column widths in the browser. I even tried setting the style property at runtime, with no luck.
    Unfortunately I can't pad the column header with spaces, because output text has the annoying habit of converting any group of more than one blank space character to one char only (by the way, any remedy to that?). Trying to drop a grid or group panel in place of the column header and pad the column title with invisible (i.e. color: white) output texts did not work either...
    Any ideas??
    Thanks,
    Luca

    I took a look at the html encoder for data table and here's a trick you can use:
    Go to your stylesheet (by default resources/stylesheet.css: open the Resources node in the project navigator and double click on stylesheet.css).
    Let's say you want three columns - so add something like the following to the stylesheet:
    .colwidth1 { width: 200px }
    .colwidth2 { width: 400px }
    .colwidth3 { width: 300px }
    Save the stylesheet (ctrl-S).
    Now, back in the designer, right click and select "Refresh" to ensure that the new stylesheet edits are discovered.
    Then go to the designer surface, and select the data table (make sure it's selected, not one of its children like columns or output texts - if so hit Escape to pop to parent, or just click on it directly in the app outline.)
    Go to the "columnClasses" property in the property sheet - and enter "colwidth1, colwidth2, colwidth3". Note - no dots here. If you have more than 3 columns you would obviously add additional columns here.
    The table should now use the desired column widths - including the browser.

  • Advanced query with dynamic columns

    Hi All,
    I have a table with structure shown below. I need to pull data out of this table and the output should be in a format indicated by the select statement below. I have the following questions and I appreciate if someone could help.
    1. I need to extract 3 years(current year + 2 historical years) worth of data out of this table dynamically(I can't hardcode year). How can I modify the code below so that the select statement returns 3 years worth of data dynamically?
    2. Should I instead calculate each quarter in the select statement using "CASE"? Would this be a good idea and i wouldn't have to deal with the PIVOT function?
    3. The reason I am asking about #2 is because our application requires the out field names to be as CYQ1, CYQ2, CYQ3, CYQ4, LYQ1, LYQ2, LYQ3, LYQ4 etc.(LY = last year). I am not sure if this is possible to do in Pivot table. Could the method outlines
    in #2 be the best practice in my situation?
    Thanks in advance for your thoughts.
    DECLARE @Trans_Summary TABLE(
    [Account_ID] [int] NULL,
    [End_Date] DATE NULL,
    [Amount] [float] NULL,
    [Customer_ID] [int] NULL)
    INSERT @Trans_Summary VALUES(1, '03/31/2013', 100, 123)
    INSERT @Trans_Summary VALUES( 1, '01/31/2013', 200, 123)
    INSERT @Trans_Summary VALUES( 1, '06/30/2013', 100, 123)
    INSERT @Trans_Summary VALUES( 1, '09/30/2013', 100, 123)
    INSERT @Trans_Summary VALUES( 1, '12/31/2013', 100, 123)
    SELECT *
    FROM @Trans_Summary
    PIVOT(SUM([Amount])FOR End_Date IN ([2013-01-31], [2013-03-31], [2013-06-30], [2013-09-30], [2013-12-31])) AS TT

    Yes, you should always use CASE for pivots and never use the PIVOT keyword. The latter gives you somewhat shorter query text, for very little gain.
    As I understand what you are asking for, you can easily do it with CASE without dynamic SQL:
    DECLARE @year char(4) = '2013',
            @q1 = char(4) = '0331',
            @q2 = char(4) = '0630',
            @q3 = char(4) = '0930',
            @q4 = char(4) = '1231'
    SELECT Account_ID,
           SUM(CASE WHEN End_Date = @year + @q1 THEN Amount END) AS CYQ1,
           SUM(CASE WHEN End_Date = dateadd(YEAR, -1, @year + @q1) THEN Amount END) AS LYQ1,
    FROM   tbl
    GROUP  BY Account_ID
    Well, maybe that can be done with PIVOT as well, but I have never learnt how to use the keyword. It just looks difficult to me. And useless.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Date Query With Restricted Dates

    Sorry not really an easy thing to explain:
    I have specified in a Query that i Only want values with a date BETWEEN:
    01JAN2002 08:00 AND 01SEP2003 08:00
    Now in the same query, what is the simplest way to restrict that only the following dates are examined and not all the dates within the above time window:
    Say 06/01 - 07/01
    The following dates i am looking to analyze will thus be
    01JUN2002 08:00 - 01JUL2002 08:00
    01JUN2003 08:00 - 01JUL2003 08:00
    Thanks

    Had a little bit more time to test, today. So in case you couldn't find the complete soultion yourself, here you go. The records with flag='Y' are the ones that fit within your selection criteria (between any 7-OKT 8:00AM and 8-OKT 8:00AM).
    drop table testDate;
    create table testDate(id number,flag char,yourDate date);
    insert into testDate values (1,'Y',to_date('7-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (2,'Y',to_date('8-OKT-2003 7:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (3,'N',to_date('7-OKT-2003 3:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (4,'N',to_date('8-OKT-2003 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'Y',to_date('7-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('6-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    insert into testDate values (5,'N',to_date('9-OKT-2002 11:00:00','DD-MON-YYYY HH:MI:SS'));
    commit;
    select id,flag,to_char(yourDate,'DD-MON-YYYY HH:MI:SS') from testDate
    where trunc(yourDate,'HH')-trunc(yourDate,'YYYY')
    between to_date('7-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    and to_date('8-OKT-2003 08:00:00','DD-MON-YYYY HH:MI:SS')-to_date('01-JAN-2003')
    /

  • A query with row and colum numbers?

    Hello,
    i have my java code divided into if conditions and in each if clause i need to select a certain field from a table. Is it somehow possible to select a table field which for example is in the third row and fifth column? So basically, how to select a certain matrix element?
    Thank you:)
    Edited by: user10956166 on Apr 5, 2009 6:09 AM

    Hi,
    Assuming you have a table called Distance:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> DESCRIBE DISTANCE;
    Name    Type         Nullable Default Comments
    LINN    VARCHAR2(30) Y                        
    TALLINN NUMBER       Y                        
    TARTU   NUMBER       Y                        
    P2RNU   NUMBER       Y                        
    SQL> select * from distance;
    LINN                              TALLINN      TARTU      P2RNU
    TALLINN                                 0        186        128
    TARTU                                 186          0        174
    P2RNU                                 128        174          0
    SQL>
    SQL> SET SERVEROUTPUT ON
    SQL> DECLARE
      2     v_sql         VARCHAR2(4000);
      3     v_column_name VARCHAR2(30):= 'TARTU';
      4     v_to          VARCHAR2(30):= 'P2RNU';
      5     v_distance    NUMBER;
      6  BEGIN
      7     v_sql := 'SELECT ' || v_column_name || ' FROM DISTANCE d WHERE d.LINN = ''' || v_to || '''';
      8     EXECUTE IMMEDIATE v_sql
      9        INTO v_distance;
    10 
    11     dbms_output.put_line(v_distance);
    12 
    13  EXCEPTION
    14     WHEN OTHERS THEN
    15        dbms_output.put_line(SQLERRM);
    16  END;
    17  /
    174
    PL/SQL procedure successfully completed
    SQL> Regards,

  • Importing data file with multiple columns of data

    Hi folks,
    Sorry if this is covered elsewhere in the forum, but I have searched pretty thoroughly and can't find an answer!
    I have a data file that I need to load into my BPC application. It has all 12 periods of 2008 across the top, correctly labelled as 2008.Jan, 2008.Feb, etc and account numbers down the side in column A.
    In my transformation file, my Time dimension is mapped like so:
    time=*myval(2:14) - remember the first column contains the account numbers
    My question is, how do I map the AMOUNT to my data area in the file? I have looked through the online help (which is pretty rubbish) and have searched the forums to no avail, but I'm sure this is do-able easily.
    Any help you could offer is greatly appreciated.
    Many thanks.
    All the best,
    Jason

    I have moved this thread to the BPC MS forum.  Notice the sticky [note|Please do not post BPC, SSM or FI/CO questions here!; at the top of the FPM - General (PCM, FC, Other) Forum whereby we announced new dedicated forums for BPC which are the proper place to post your questions regarding BPC in the future.
    [Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
    SAP BusinessObjects
    Enterprise Performance Management
    Regional Implementation Group

Maybe you are looking for