Query--Problems in Column representation

Hello gurus,
Thanks for the previous solution.
Right now i am facing severe problem in which i did following thing
In report i have to do the display as
Jan Feb March ....December
Quantity sold
I brought key figure in Columns and then Brought Calendar year month
Did restriction for Calendar year/month iin Filter.
Created Interval range variable and restricted Calendar Year/Month
But the output i received was
April Jan Feb December .... and so on
When i drilled it down, i analysed the the month which has maximum quantity sold is firs
so if i see
April Jan Feb December ....
then the quantity of product sold for different months is
April > Jan > Feb > Dece>..........
What type of error i might have done?
I tried bringing the Calendar month on Top and Key figure in bottom and Vice versa.
Still same issue.
Please advise

Thanks Roberto,
I am not missing any column.
But i am getting columns of months in weird arrangement
for e.g. for range of 4 months from jan to april
i am getting
april feb jan march
april has largest amount of quantity sold
february has second largest largest amount of quantity sold
jan has third largest amount of quantity sold
march has fourth largest amount of quantity sold
How to rectify this.

Similar Messages

  • Query Based Taxonomy - Dynamic Creation of a Query Problem

    Hi,
    I'm trying to create new category nodes in a taxonomy and to assing them queries. I know how to do this, but I encountered a strange behavior. Here is the situation:
    I have a string property DocumentType. When manualy creating a query, it looks like:
    DocumentType CONTAINS "Some string"
    But when I do the same using code I get:
    DocumentType IS "Some string"
    And as a result of this, the taxanomy is not working properly.
    Here is the code:
         indexService =
         (IIndexService) ResourceFactory
         .getInstance()
         .getServiceFactory()
         .getService(
         IServiceTypesConst.INDEX_SERVICE);
         //        This kind of classification index offers functionality working with query based taxonomies
         qbcIndex = (IQBClassificationIndex) indexService.getIndex(indexId);
         //        Get a query folder - a query folder is a representation of a query based taxonomies category
         queryFolder = qbcIndex.getQueryFolder(RID.getRID(folder));
         //        List of IQueryEntry objects for the query folder
         queryEntryList = queryFolder.getQuery(context);
         //        Cast the IQBClassificationIndex into a ISearchIndex object
         searchIndex = (ISearchIndex) qbcIndex;
         queryEntry = searchIndex.getNewQueryEntry();
         queryEntry.setRowType(IQueryEntry.ROW_TYPE_ATTRIBUTE);
         queryEntry.setPropertyName(propertyName);
         queryEntry.setPropertyOperator(IQueryEntry.PROPERTY_OPERATOR_EQUAL);
         queryEntry.setValue(propertyValue);
         queryEntry.setTermAction(IQueryEntry.TERM_ACTION_EXACT);
         queryEntryList.add(queryEntry);
         //        Set the query for the query folder
         queryFolder.setQuery(queryEntryList, context);
         qbcIndex.updateCategoryContents("Document_Types", false, context);
    Can somebody tell me what am I doing wrong please. Isn't it because of IQueryEntry.PROPERTY_OPERATOR_EQUAL? Is there any substring operator?
    Thanks a lot.

    Hi, Robert
      In this moment, I have a problem with Query Based Taxonomy, maybe could you help me. I insert the query in to the taxonomy from code, but when i use the method
      qbcIndex.updateCategoryContents("/taxonomies/borrame5/Prueba2", false, context);
      I got the next exception:
    #1.5#0014C210F3D1002A000001200000565B000431CC93AD5979#1180654627543#System.err#sap.com/irj#System.err#dummy01#10241#####SAPEngine_Application_Thread[impl:3]_17##0#0#Error##Plain###     at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)#
    #1.5#0014C210F3D100310000012B0000565B000431CCC47166AB#1180655445698#System.err#sap.com/irj#System.err#dummy01#10241#####SAPEngine_Application_Thread[impl:3]_18##0#0#Error##Plain###com.sapportals.wcm.service.indexmanagement.IndexNotReadyException: Some documents are not included in this update because indexing has not been finished yet.#
    #1.5#0014C210F3D100310000012C0000565B000431CCC4717417#1180655445701#System.err#sap.com/irj#System.err#dummy01#10241#####SAPEngine_Application_Thread[impl:3]_18##0#0#Error##Plain###     at com.sapportals.wcm.service.indexmanagement.retrieval.trex.AbstractTrexIndex.updateCategoryContents(AbstractTrexIndex.java:2493)#
      I have doubt what parameters i need to pass to the method updateCategoryContents,
      Let me give some information:
    taxonomy:
       /taxonomies/borrame5/Prueba2
    repository:
       /documents/Portal_KOF/KM/Pruebas1/Pruebas Versionamiento
    classification and search index:
       borrame5
       I can't classify automatically, when i insert the query from code. When I manually insert the query from the portal, automatic classification run perfectly.
    Thanks
    Greetings
    JARO.

  • SQL xml query problems

    Hello,
    I am trying to query a database column containing xml. How my problem is when I display my query on the page the data is not being shown properly.
    The data in the database is like this:
    <P><tag1>2003/05/22 11:01:34</tag1><tag2>2003/05/22</tag2><tag3>11:01:34</tag3><tag4></tag4>.......
    However all that is returned is on the jsp page
    2003/05/22 11:01:34<tag2>2003/05/22<tag3>11:01:34..............
    i.e closing tags missing and empty pairs not shown at all.
    My query is a simple
    String sqlQuery="select * from table;
    rs = stmt.executeQuery (sqlQuery);
    rs.next();
    out.print(rs.getString(1));
    Can anyone suggest why the data stored in the column is being truncated and how I can prevent this.
    Many thanks in advance
    Les,

    Surely this is because the browser is interpretting the tags as HTML tags? Do a "view source" on the page and it should be right.
    Otherwise, you will have to store the query in the DB with escapt characters before the <'s

  • SQL Query Problems

    Hello,
    I am trying to query a database column containing xml. How my problem is when I display my query on the page the data is not being shown properly.
    The data in the database is like this:
    <P><tag1>2003/05/22 11:01:34</tag1><tag2>2003/05/22</tag2><tag3>11:01:34</tag3><tag4></tag4>.......
    However all that is returned is on the jsp page
    2003/05/22 11:01:34<tag2>2003/05/22<tag3>11:01:34..............
    i.e closing tags missing and empty pairs not shown at all.
    My query is a simple
    String sqlQuery="select * from table;
    rs = stmt.executeQuery (sqlQuery);
    rs.next();
    out.print(rs.getString(1));
    Can anyone suggest why the data stored in the column is being truncated and how I can prevent this.
    Many thanks in advance
    Les,

    Hi,
    For your problem, the solutions i thought is put your output between <pre></pre> tags in HTML
    means
    out.print("<pre>" + rs.getString("") + "</pre>")
    hope this willl work.
    have fun!!!

  • SQL+-MULTI TABLE QUERY PROBLEM

    HAI ALL,
    ANY SUGGESTION PLEASE?
    SUB: SQL+-MULTI TABLE QUERY PROBLEM
    SQL+ QUERY GIVEN:
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
    = &PATIENT_NUM;
    RESULT GOT:
    &PATIENT_NUM =1
    no rows selected
    &PATIENT_NUM=2
    no rows selected
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    ACTUAL WILL BE:
    &PATIENT_NUM=1
    PATIENT_NUM 1
    PATIENT_NAME BBBB
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 5
    HMTLY_RBC_NORMAL 4.6-6.0
    &PATIENT_NUM=2
    PATIENT_NUM 2
    PATIENT_NAME GGGG
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     42
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
    PATIENT.
    TABLE1:PATIENTS_MASTER1
    COLUMNS:PATIENT_NUM, PATIENT_NAME,
    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BBBB
    GGGG
    KKKK
    PPPP
    TABLE2:TESTS_MASTER1
    COLUMNS:TEST_NUM, TEST_NAME
    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HAEMATOLOGY
    DIFFERENTIAL LEUCOCYTE COUNT
    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE     
    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HAEMATOLOGY
    HAEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6-6.0
    4.6-6.0
    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
    NORMAL_VALUE,
    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUCOCYTE COUNT
    DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    THANKS
    RCS
    E-MAIL:[email protected]
    --------

    I think you want an OUTER JOIN
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
    outer join marks became stupid emoticons or something. attempting to fix

  • Cannot query conditionals on column in view

    We are upgrading our oracle database from 9i to 11g. The upgrade is complete but we are running into one issue regarding a view. We are able to query the view without any problems, but when querying a specific column for a specific value, we are not getting a results back although we are able to when performing the same query on the 9i database. The view that is not working is:
    Select count(*) from v_test where statuscode like '%active%';
    The view has been dropped and recreated. If I do select * from v_test it works fine.
    Any help/suggestion is appreciated.

    CREATE OR REPLACE FORCE VIEW "JIFFY"."V_TEST" ("V_PROJECTID", "JIFFY", "TFIMS", "CSSR", "CFSR", "DD254", "DTICEXEMPT", "STATUSCODE", "LASTNONZEROMONTH", "BURNRATE", "LASTLMRDATE", "LASTLMRID", "TECHSTATUSDOCDATE", "TECHSTATUSDOCID", "REPORTFREQ", "FIRSTTECHRPTDUEDATE", "FACEVALUE", "RECEIVED", "TOTOBLIGATED", "CFYOBLIGATED", "TOTACCRUED", "FUNDSEXHAUSTIONDATE", "CONTTECHPOCID", "CONTTECHPOCNAME", "GOVTTECHPOCID", "GOVTTECHPOCNAME", "CONTRACTTYPE") AS
    SELECT      r."V_PROJECTID",r."JIFFY",r."TFIMS",r."CSSR",r."CFSR",r."DD254",r."DTICEXEMPT",
              s.statuscode,
              projectinfo.getLastNonZeroMonth(r.v_projectid) lastNonZeroMonth,
              projectinfo.getBurnRate(r.v_projectid) burnRate,
              projectinfo.getRecentLMRDate(r.v_projectid) lastLMRdate,
              projectinfo.getRecentLMRID(r.v_projectid) lastlmrid,
              projectinfo.getDCFTechStatusDocDate(r.v_projectid) techStatusDocDate,
              projectinfo.getDCFTechStatusDocID(r.v_projectid) techStatusDocID,
              projectinfo.getDueDateFreqRpt(r.v_projectid) reportFreq,
              projectinfo.getFirstTechRptDueDate(r.v_projectid) FirstTechRptDueDate,
              projectinfo.getFaceValue(r.v_projectid) FaceValue,
              projectinfo.getActualAllocationTot(r.v_projectid) received,
              projectinfo.getTotObligated(r.v_projectid) TotObligated,
              projectinfo.getCFYObligated(r.v_projectid) CFYObligated,
              projectinfo.getTotAccrued(r.v_projectid) TotAccrued,
              projectinfo.getFundsExhaustionDate(r.v_projectid) FundsExhaustionDate,
              projectinfo.getContTechPocId(r.v_projectid) ContTechPocId,
              SUBSTR(projectinfo.getContTechPocName (projectinfo.getContTechPocId(r.v_projectid)),1,50) ContTechPocName,
              projectinfo.getGovtTechPocId(r.v_projectid) GovtTechPocId,
              SUBSTR(projectinfo.getGovtTechPocName (projectinfo.getGovtTechPocId(r.v_projectid)),1,50) GovtTechPocName,
              SUBSTR(projectinfo.getContractType(r.v_projectid),1,50) ContractType
    FROM     v_projectspecialreqs r, v_projectstatus s
    WHERE     r.v_projectid = s.projectid (+);
    Since this view is a join of two other views, I thought I would provide the source for them as well...
    CREATE OR REPLACE FORCE VIEW "JIFFY"."V_PROJECTSPECIALREQS" ("V_PROJECTID", "JIFFY", "TFIMS", "CSSR", "CFSR", "DD254", "DTICEXEMPT") AS
    SELECT p.projectid v_projectid,
    DECODE(a.jiffy,'JIFFY','Y','N') jiffy,
    DECODE(b.tfims,'TFIMS','Y','N') tfims,
    DECODE(c.cssr, 'CSSR','Y','N') cssr,
    DECODE(d.cfsr, 'CFSR','Y','N') cfsr,
    DECODE(e.dd254,'DD254','Y','N') dd254,
    DECODE(f.dticx,'DTICX','Y','N') dticexempt
    FROM Project p,
    (SELECT tp.projectid, t.taxcode jiffy
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('JIFFY')
    ) a,
    (SELECT tp.projectid, t.taxcode tfims
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('TFIMS')
    ) b,
    (SELECT tp.projectid, t.taxcode cssr
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('CSSR')
    ) c,
    (SELECT tp.projectid, t.taxcode cfsr
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('CFSR')
    ) d,
    (SELECT tp.projectid, t.taxcode dd254
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('DD254')
    ) e,
    (SELECT tp.projectid, t.taxcode dticx
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('DTICX')
    ) f
    WHERE p.projectid = a.projectid (+)
    AND p.projectid = b.projectid (+)
    AND p.projectid = c.projectid (+)
    AND p.projectid = d.projectid (+)
    AND p.projectid = e.projectid (+)
    AND p.projectid = f.projectid (+);
    CREATE OR REPLACE FORCE VIEW "JIFFY"."V_PROJECTSTATUS" ("PROJECTID", "STATUSCODE") AS
    SELECT tp.projectid projectid, t.taxcode
    statuscode
    FROM tax_projects tp, taxonomy t
    WHERE tp.taxid = t.taxid
    AND t.taxcode in ('ACTV', 'INACTV', 'CMPLT', 'CNCL');

  • 2 Query Problems....

    Hi there,
    i've got two Major Problems. I'm a relativly newbie to SAP BW and the Query Designer.
    First Problem:
    My Query looks Like this
    Year-----Sales--Change
    2003---1000 u20AC-0%
    2004---2000 u20AC-100%
    2005---3000 u20AC-50%
    Now i wanna have a third Column in witch the Change of the Sales is displayed in correlation to the year before.
    l will try to eyplain it a litte bit. When my Sales were 1000 u20AC in year 2003 then i wanna calculate the increase in percent in correlation to the year before. Is this posiible???
    An now the second problem ):
    I got another Query in wich i just wanna to show the overall result in a Diagramm. When i calculate the Overall Result, every result is shown and actually is also shown in the diagram.
    I try to explain this a bit more:
    Year--Header1---Header2
    2003--data--
    data
    2004--data--
    data
    2006--data--
    data
    O.Result---result1--result 2
    So i Just want to show result1 and result2 in a diagram. How do i do this?
    Thanks in advance for some answers .

    Hi,
    For you first problem, In column, in your structure, create a selection with the current year for example and another selection with previous year and in the third column create a formula to calculate the progression.
    For your second problem, hide year from your query an you will have only global result.
    Regards
    Romain.

  • Full text query across multiple columns

    In the SQL Server, when you do the full text query, you can specify multiple columns, e.g.
    FREETEXT ( { column_name | [b](column_list) | * } , 'freetext_string' [ , LANGUAGE language_term ] )
    CONTAINS ( { column_name | [b](column_list) | * } , '< contains_search_condition>' [ , LANGUAGE language_term ])
    Where,
    column_list Indicates that several columns, separated by a comma, can be specified...
    * Specifies that all columns in the table registered for full-text searching should be used to search for the given contains search condition. The columns in the CONTAINS clause must come from a single table...
    That makes full text query cross multiple columns very convenient. Are there any mechnisms in Oracle to do the same thing?
    Thanks in advance.

    Thanks for your reply.
    I knew that you could build full text index for the multiple columns using Oracle Text. But that does not solve my problem, which is how to build the query to search multiple columns at once. Say, I have columns firstname, lastname, address, and email in the table customers. I want to get the results that ANY column contains 'bob'. In SQL Server, I can do
    select * from customers where contains(*, 'bob')
    that is. But for Oracle, I have to do
    select * from customers where contains('firstname', 'bob') or contains('lastname', 'bob') or contains('address', 'bob') or contains('email', 'bob')
    Can you imagine if I have many columns in many tables and I have to do the query against all columns in all tables? I have to dynamically get all the columns and then build the query string.
    So, any better solutions?

  • Problem with columns in the middle of my book

    I am writing my second book with Pages 2.02 and have run into a problem with columns. I want to add a long list of items as a list with check boxes for readers to check off. If I paste in enough text for three or four pages of two columns it gets messed up in various ways - the text flows into the following text if I don't use section breaks at the end instead of layout breaks, if I use section breaks it solves that one, but if I add anything to the list it changes all the columns across the pages so that one or several of the pages has way less in the right column than in the left. So far the left column fills the entire page all the time, but the right column has lots of spaces. If I switch back and forth from one column to two, it fixes it. If I add text before the list section it messes everything up again and because there is a section break I end up with a little bit of text on the last page and a huge gap before the single column part that follows.
    Does anyone know how to get reliable results that will not mess me up when adding content before the list or in the list itself?
    PowerBook G4   Mac OS X (10.4.8)  

    Hi Cymru,
    Thank you for thinking about my problems. I guess I s half asleep when I posted and it didn't make sense.
    I have so far 77 pages of the book divided into several chapters via section breaks. Inside the 5th section there is almost two pages of paragraphs. Those paragraphs could become 3.75 pages or who knows how long before the list of items. The list of items is 226 items separated by carriage returns and go from one word with 5 characters to 7 words and 34 characters. It needs to be a list with check boxes before them so that the user can check off the items that apply. It is a workbook about turning bipolar into an advantage and is currently 8.5 x 11 and printed on my laser printer for now, but when completed will be more like 8 x 10, so it needs to resize without major hassles.
    I have tried every combination of breaks to get the list to flow in two columns, but perhaps have not done the correct combination. I show invisibles and layout. At the end of my paragraphs I do a paragraph return. I then do either a section break or a layout break, followed by a paragraph return and another layout or section break. I then put my curser before the paragraph break, but after the first section/paragraph break, and set columns to 2, evenly divided by default with 3.2026" columns and .3375" gutter, but I want them to change with page size in the future.
    Once set up, I copy the text out of BBEdit and paste into the left column. It takes up several pages because it is formatted to do double spaces, so I use one of my styles to make it bold and single spaces. I then apply list style with image bullets and one of the default box images that came with Pages. There are 5 items in each column on the first page because it is close to the bottom, but flows into the next two pages. (with text edits it might end up 20 items in each column on the first page) The second page has 39 items in each column and the last page has 8 items in the left column only, but if with section breaks take up the whole page and the next paragraphs start on the next page. If I then add items to the list, every page gets messed up and the second page ends up with 39 on the left column and less items in the right column for each added item.
    If I use layout breaks instead of section breaks, the paragraphs following my lists (now with only one column) end up under the list. What that means is I can see my bold items, but beneath them are my paragraphs that belong after the list. I can see the layout break at the end of the list, but the columns that are shown as part of the 'view layout' are visible right over the single column text also for the rest of the page. The only way to solve that is to go with section breaks and put up with the gap from the end of the list to the following paragraphs.
    I hope this makes more sense.
    Tom
    PowerBook G4   Mac OS X (10.4.8)  

  • Query on database column not working

    Hi
    i have a block which has around 40 columns.the block is based on a table which has more than 20000 records.When i try 2 make query on a Database column in Enter-Query mode its not working.It fetching all the records instead of the respective records
    THe block property is said to yes
    i have even set the query allowed,only propery of the column to YEs
    Can any one help me out of this??? do i need to set any other property???

    Thanks a lot for james and THomas and to all. The error is that i have missed the bracket for OR in my where condition ...Now im able to query all the columns.
    Thanks very much...
    I have one more doubt .i have a requirement in which when the user goes to the child block and makes a query is it possible to bring the associates parent records..wht code or trigger we need to rite ?
    normally we do for parent block when we query we populate the child. is this can be done?

  • Result of an SQL query as a Column name of another query

    Hi Friends,
    Can we use a result of a SQL Query as a column name of another table to retrieve data. If so please help me.
    For eg :
    I have a table where is store numbers;
    select col1 from table1 where col1='5';
    and i have another table where .. this value of col is a column name..
    select ( select col1 from table1 where col1='5') from table2;
    Thanks in advance.

    Hi,
    ORAFLEX wrote:
    Hi Friends,
    Can we use a result of a SQL Query as a column name of another table to retrieve data. If so please help me.
    For eg :
    I have a table where is store numbers;
    select col1 from table1 where col1='5';
    and i have another table where .. this value of col is a column name..
    select ( select col1 from table1 where col1='5') from table2;
    Thanks in advance.Do you really mean that?
    select col1 from table1 where col1='5';That query will always return either '5' or nothing. Whatever you're trying to accomplish with that, you can do with an EXISTS query.
    Perhaps you meant to reference two different columns in that query:
    select col1 from table1 where col2='5';In that case, sorry, no, you can't do that without resorting to dynamic SQL.
    If the same column is used throughout the query (but could change every time you run the query), then the dynamic SQL might be pretty easy. In SQL*Plus, for example, you could use substitution variables, defined in another query at run-time.
    If there are only a few possible values that the sub-query could possibly return, and you know what they all are, then you can fake a dynamic query like this:
    SELECT     CASE     ( SELECT  col1
                FROM       table1
                WHERE       col2     = '5'
              WHEN  'BONUS'     THEN  bonus
              WHEN  'COMM'     THEN  comm
              WHEN  'SAL'     THEN  sal
         END     AS col1
    FROM     table2
    ;Sorry to give such a vague answer, but it's the best I can do with the information I have.
    It would help if you posted a little sample data (CREATE TABLE and INSERT statments for both tables), and the results you want to get from that data. If you want to pass a parameter to the query, give the results you want for a couple of different parameters.

  • 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

  • About Query Data Source Columns property

    Hello everyone,
    I'm new to Oracle Forms version 10.1.0.2.
    When I create a data block based on a table using Data Block Wizard, the block's Query Data Source Columns property is automatically populated with column definition entries corresponding to the columns of the base table.
    I tried making changes to these entries, for example by changing the data types to wrong data types or even deleting them, and I found that those changes had no effect on the block at all. The form was still working as I wanted.
    Please explain what is exactly the role of the block's Query Data Source Columns property.
    Thank you very much.
    p.s: The F1 key help says "The Query Data Source Columns property is valid only when the Query Data Source Type property is set to Table, Sub-query, or Procedure". So, please explain in each context of Query Data Source Type.

    p.s: The F1 key help says "The Query Data Source Columns property is valid only when the Query Data Source Type property is set to Table, Sub-query, or Procedure". So, please explain in each context of Query Data Source Type.
    IMHO those properties are very self-explaining: It is the data source of the block, or in other terms: how it is populated.
    Table means the data block is based on a table and subsequently will be populated by
    select col1, col2, col3 from your_table
    With sub-query the block will be populated with your subquery; forms will issue
    select col1, col2, col3 from (
      -- this is your subquery
      select col1, col2, col3 from tab1, tab2 where [....]
    With Procedure in short you'd have a stored procedure which returns a ref cursor and the block will be populated by the ref cursor.
    As for your question about the name: this actually should matter; the default is NULL which means that there needs to be a column which has the exact name as the item so in the above sample with table the item associated with your_table.col1 should be named col1. If it isn't the property should be named like the column. If this property also doesn't reflect the name this shouldn't work IMO.
    cheers

  • 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.

Maybe you are looking for

  • Java.lang.NullPointerException in 11.1.1.6.0

    I am getting errors all over in 11.1.1.6.0 this is the second time I installed. I am creating new projects. Not migrating. Anyone getting these. Performing action New...[ from oracle.ide.navigator.ProjectNavigatorWindow ] oracle.ide.ExtensionRegistry

  • 8mb broadband now won't go above 2mb

    This has been ongoing for five weeks now - I used to get regular speeds of well over 6mbps, now I only get 2mbps.  Time of day/night does not make any difference. I've exchanged emails with customer services and the response has been useless - I ques

  • SAP_COLLECTOR_FOR_PERFMONITOR

    Hi All, In our BW PRD server job SAP_COLLECTOR_FOR_PERFMONITOR is scheduled on hourly basis, all the jobs finish sucessfully , but it has been observed that in the morning 7:30 & evening 22:30 , same jobs are cancelling daily and giving dump as ABAP/

  • Time machine destinations

    Hello, as my MacBook Pro is backed up with the help of Time Machine to Time Capsule I have a question about my external hard drives. Time Capsule for my MBP is 1Tb and my macbook has as well 1Tb of combined space for data. As I am a photo-/videograph

  • SAP Netweaver 7.00 - JSPM hangs during deployment

    Hello community, we have an environment with SAP Netweaver 7.00 Java stack only We are trying to apply Support package stack SP20, starting from SP14, but JSPM remains hang after the start of the deploy. JSPM window becomes blank and we are not able