Query modify

how to rewrite the below mentioned query could any one help me b'coz i am not familiar with query tuning please any body help me.
SELECT GP1.SUBGRPCODE PGRP,GP1.SUBGRPNAME PGRPNAME,GP1.SUBGRPID PGRPID, GP2.SUBGRPCODE SGRP,
GP2.SUBGRPNAME SGRPNAME,GP2.SUBGRPID SGRPID, B.SUBGRPCODE,B.SUBGRPNAME,B.SUBGRPID, B.ACCTCODE,
B.ACCTNAME, B.ACCTID, (NVL(A.DRSUM,0)+B.DROPENINGBAL) DEBIT,(NVL(A.CRSUM,0)+B.CROPENINGBAL) CREDIT
FROM (SELECT S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID, G.ACCTCODE, G.ACCTNAME,
     G.ACCTID,SUM(G.DEBITAMOUNT) DRSUM,SUM(G.CREDITAMOUNT) CRSUM
     FROM FS_AC_GENERALLEDGER G,FS_AC_ACCTSUBGRPMASTER S
     WHERE      VOUCHERDATE BETWEEN DECODE(SUBSTR(G.ACCTCODE,1,1),'L','16-SEP-2007','A','16-SEP-2007','16-SEP-2007')
                              AND '17-APR-2008'
          AND G.BOOKID = 735
          AND G.ACCTCODE LIKE S.SUBGRPCODE||'_______'           
          GROUP BY S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID, G.ACCTNAME, G.ACCTCODE, G.ACCTID) A,           
     (SELECT S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID,S.FAIND, M.ACCTCODE,M.ACCTNAME,M.ACCTID,O.DROPENINGBAL,O.CROPENINGBAL           
     FROM FS_AC_OPENINGBAL O,FS_AC_ACCTMASTER M,FS_AC_ACCTSUBGRPMASTER S           
     WHERE      O.BOOKID = 735
          AND M.TERMINALID = 'FSL'
          AND M.ACCTCODE = O.ACCTCODE           
          AND M.ACCTCODE LIKE S.SUBGRPCODE||'_______' ) B,           
     FS_AC_ACCTSUBGRPMASTER GP1,
     FS_AC_ACCTSUBGRPMASTER GP2
WHERE      A.ACCTCODE(+) = B.ACCTCODE
     AND (NVL(A.DRSUM,0)+B.DROPENINGBAL+NVL(A.CRSUM,0)+B.CROPENINGBAL) >= DECODE(B.FAIND,'P',0,0.00001)
     AND GP1.SUBGRPCODE = SUBSTR(B.SUBGRPCODE,1,3)
     AND GP2.SUBGRPCODE = SUBSTR(B.SUBGRPCODE,1,5)
     ORDER BY B.SUBGRPCODE,B.SUBGRPNAME,B.SUBGRPID, B.ACCTNAME, B.ACCTCODE, B.ACCTID ;
with regards,
vasu.

SELECT GP1.SUBGRPCODE PGRP,GP1.SUBGRPNAME PGRPNAME,GP1.SUBGRPID PGRPID, GP2.SUBGRPCODE SGRP,
GP2.SUBGRPNAME SGRPNAME,GP2.SUBGRPID SGRPID, B.SUBGRPCODE,B.SUBGRPNAME,B.SUBGRPID, B.ACCTCODE,
B.ACCTNAME, B.ACCTID, (NVL(A.DRSUM,0)+B.DROPENINGBAL) DEBIT,(NVL(A.CRSUM,0)+B.CROPENINGBAL) CREDIT
FROM (SELECT S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID, G.ACCTCODE, G.ACCTNAME,
G.ACCTID,SUM(G.DEBITAMOUNT) DRSUM,SUM(G.CREDITAMOUNT) CRSUM
FROM FS_AC_GENERALLEDGER G,FS_AC_ACCTSUBGRPMASTER S
WHERE VOUCHERDATE BETWEEN DECODE(SUBSTR(G.ACCTCODE,1,1),'L','16-SEP-2007','A','16-SEP-2007','16-SEP-2007')
AND '17-APR-2008'
AND G.BOOKID = 735
AND G.ACCTCODE LIKE S.SUBGRPCODE||'_______'
GROUP BY S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID, G.ACCTNAME, G.ACCTCODE, G.ACCTID) A,
(SELECT S.SUBGRPCODE,S.SUBGRPNAME,S.SUBGRPID,S.FAIND, M.ACCTCODE,M.ACCTNAME,M.ACCTID,O.DROPENINGBAL,O.CROPENINGBAL
FROM FS_AC_OPENINGBAL O,FS_AC_ACCTMASTER M,FS_AC_ACCTSUBGRPMASTER S
WHERE O.BOOKID = 735
AND M.TERMINALID = 'FSL'
AND M.ACCTCODE = O.ACCTCODE
AND M.ACCTCODE LIKE S.SUBGRPCODE||'_______' ) B,
FS_AC_ACCTSUBGRPMASTER GP1,
FS_AC_ACCTSUBGRPMASTER GP2
WHERE A.ACCTCODE(+) = B.ACCTCODE
AND (NVL(A.DRSUM,0)+B.DROPENINGBAL+NVL(A.CRSUM,0)+B.CROPENINGBAL) >= DECODE(B.FAIND,'P',0,0.00001)
AND GP1.SUBGRPCODE = SUBSTR(B.SUBGRPCODE,1,3)
AND GP2.SUBGRPCODE = SUBSTR(B.SUBGRPCODE,1,5)
ORDER BY B.SUBGRPCODE,B.SUBGRPNAME,B.SUBGRPID, B.ACCTNAME, B.ACCTCODE, B.ACCTID ;
Execution Plan :-
SELECT STATEMENT, GOAL = ALL_ROWS               51     31     6789
SORT ORDER BY               51     31     6789
HASH JOIN               50     31     6789
HASH JOIN               48     31     5766
MERGE JOIN               47     31     4743
SORT JOIN               43     163     19234
HASH JOIN               42     163     19234
TABLE ACCESS BY INDEX ROWID     ETRANS24UAT     FS_AC_OPENINGBAL     20     156     3432
INDEX RANGE SCAN     ETRANS24UAT     IND_FS_AC_OPENINGBAL     1     156     
HASH JOIN RIGHT OUTER               21     156     14976
VIEW     ETRANS24UAT          18     4     164
SORT GROUP BY               18     4     512
NESTED LOOPS               17     4     512
VIEW     ETRANS24UAT     FS_AC_GENERALLEDGER     16     1     95
SORT ORDER BY               16     1     249
NESTED LOOPS               15     1     249
HASH JOIN               7     8     1000
NESTED LOOPS               3     8     592
INDEX RANGE SCAN     ETRANS24UAT     FS_AC_COMPANYINFO_IDX_015     1     1     12
INDEX RANGE SCAN     ETRANS24UAT     FS_AC_ACCTMASTER_IDX_013     2     8     496
INDEX RANGE SCAN     ETRANS24UAT     FS_AC_VOUCHERDTL_IDX_042     3     213     10863
TABLE ACCESS BY INDEX ROWID     ETRANS24UAT     FS_AC_VOUCHERMASTER     1     1     124
INDEX UNIQUE SCAN     ETRANS24UAT     PK_VT_VN_BK     0     1     
INDEX FULL SCAN     ETRANS24UAT     FS_AC_ACCTSUBGRP_IDX     1     4     132
INDEX RANGE SCAN     ETRANS24UAT     FS_AC_ACCTMASTER_IDX_013     3     156     8580
FILTER                         
SORT JOIN               4     76     2660
TABLE ACCESS FULL     ETRANS24UAT     FS_AC_ACCTSUBGRPMASTER     3     76     2660
INDEX FULL SCAN     ETRANS24UAT     FS_AC_ACCTSUBGRP_IDX     1     76     2508
INDEX FULL SCAN     ETRANS24UAT     FS_AC_ACCTSUBGRP_IDX     1     76     2508

Similar Messages

  • Custom Query modified/Altered By BO

    Hi All,
        I am facing a strange behavior in Info view of WEB XI 3.1. I have 4 cross tabs in my report & has written a custom query using full outer join for the fourth cross tab with Year, Month & URL as Filter. I ran the queries & it gave me accurate results. I refreshed my report at least 7 times & i did not face any issue but when i refreshed the report by changing the URL for which i need to see the data i get some different results. 1st 3 cross tabs give me accurate result but the 4th gives me inaccurate result. When i clicked on edit query to check the SQL of the 4th Cross tab my custom query no longer remained custom query it was turned to a BO generated query. I don't understand why this strange behavior happened.
         Can any one please let me know as to why this happens.
    Thank You

    Mohd,
    by changing the URL for which i need to see the data i get some different results.
    Did you perform this activity back in Edit Query? 
    my custom query no longer remained custom query it was turned to a BO generated query
    If you modify your query on the Edit Query screen (either by removing or adding objects to Results Object panel or adding/deleting objects in the Filters) you will cause the app to revert back to the default query (e.g. lose your custom code).
    Thanks,
    John

  • Pre-Query - Modifying the default_where

    Hi,
    I'm trying to get the value of the default_where clause to modify it (with set_block_property) after the user has entered the ENTER QUERY MODE and decides to RUN QUERY. I'm creating a Pre-Query event for the module component where the search criteria are entered, but it doesn't seem to work; the where_clause (l_old_where) I retrieve is always empty. My code to retrieve the default_where is:
    BEGIN
    DECLARE
    l_block VARCHAR2(32) := name_in('system.trigger_block');
    l_old_where VARCHAR2(2000);
    BEGIN
    l_old_where := get_block_property(l_block, default_where);
    message('l_old_where =' || l_old_where); --unfortunately this message always returns an empty value
    EXCEPTION
    WHEN VALUE_ERROR THEN
    qms$forms_errors.push(QMS$FORMS_ERRORS.MSGGETTEXT(33, 'Query criteria too complex - simplify and re-query'), 'E', 'OFG', 33);
    qms$forms_errors.raise_failure;
    END;
    END;
    Does anybody know what I am doing wrong? Do you have a better way to retrieve the default_where value?
    Thanks,
    Denis.

    Denis,
    The DEFAULT_WHERE is part of all queries. It is set either in the property palette at design time, or programatically at runtime. If a user does an enter query and specifies some criteria, that criteria is appended to the DEFAULT_WHERE. Thus, interrogating the DEFAULT_WHERE won't help you in this case.
    There is no "nice" way to do this. You have about three triggers you can choose from, that get fired after the users has entered their criteria, but before the query is executed. One is PRE-QUERY, and I forget the other two. One of them is SET-QUERY or something like that.
    What you do is interrogate the fields themselves. For example, if you have two fields: NAME and SALARY, and the user entered the criteria "A%" and ">5000", then it's up to you to examine those fields to see what the user typed. Then you can do with them what you will.
    So you don't get the SQL that Forms generates, but you do get the same info that Forms uses to generate the SQL.
    There is also a gotcha to look out for. When referring to fields in a block that are active during enter-query mode, use the NAME_IN builtin. For example, the SALARY field is of type number, but the criteria is ">5000". That ">" is not acceptable (normally) to a NUMBER field, so you will get errors if you do something like "message('Salary criteria: '||:block.salary);"
    I hope this helps.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Validation Query: Modify Resource Name

    I have a validation check on one of my attributes in a entity object. When the error message is thrown it includes the attribute name at the front of the message error. Is there any way to modify that? I don't want the user seeing the name of the attribute. Alternatively I would like it to default to "Error" and then the message included in the validation check.
    Example:
    Name: This name already exists.
    to
    Error: This name already exists.
    Thanks,
    Tim

    hi Tim
    Have you looked at the error reporting customizations in "SRDemoSampleADFBC" in the oracle.srdemo.view.frameworkExt.SRDemoPageLifecycle class?
    Maybe that code could help you find the answers to your error reporting questions?
    success
    Jan Vervecken

  • Modify statment is not working.

    Hi Experts,
    I have a small query, modify statment is not working properly, Maybe my syntax wrong. Kindly suggest me.
          DESCRIBE TABLE it_marc1 LINES count.
          IF count = 1.
            LOOP AT it_marc INTO wa_marc where sernp ne space.
              READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_marc-matnr.
              IF sy-subrc = 0.
                wa_stpo-potx2 = c_primary.
                MODIFY table it_stpo FROM wa_stpo TRANSPORTING potx2.
              ENDIF.
            ENDLOOP.
          ENDIF.
    Mohana

    Hello,
    Add the index addition and check
    DESCRIBE TABLE it_marc1 LINES count.
          IF count = 1.
            LOOP AT it_marc INTO wa_marc where sernp ne space.
              READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_marc-matnr.
              IF sy-subrc = 0.
                wa_stpo-potx2 = c_primary.
                MODIFY table it_stpo FROM wa_stpo TRANSPORTING potx2 INDEX sy-index.  " here
              ENDIF.
            ENDLOOP.
          ENDIF.
    Vikranth

  • Query for aggregates for each date in a date range

    Hi,
    I want to generate a Trend report with a T-SQL proc, which needs following logic. 
    Input -
    Date Range say '10/10/12' to '20/10/12'  (Say to check the trend of Size of account in 20 days of Trend report)
    Account balance is captured randomly, (i mean not every day) 
    Table with date looks like this..
    --Account Balance Table
    CREATE TABLE AccBanalce (
    BranchId SMALLINT
    NOT NULL,
    AccId CHAR(9)
    NOT NULL,
    Amount DECIMAL(9,3)
    NOT NULL,
    SnapShotDate DATETIME
    NOT NULL 
    CONSTRAINT PK_AccBanalce PRIMARY KEY NONCLUSTERED (AccId, SnapShotDate) )
    GO
    Create CLUSTERED INDEX CIx_AccBanalce ON AccBanalce (SnapShotDate)
    GO
    --Date Range table
    CREATE TABLE DateRange ( StartDate DATETIME, EndDate DATETIME)
    GO
    --Date for the Account Balance Table
    INSERT INTO AccBanalce (BranchId, AccId, Amount, SnapShotDate)
    VALUES (1, 'C1-100',  10.4, '10/11/2010' ),
    (1, 'G1-110',  20.5, '10/11/2010' ),
    (2, 'GC-120',  23.7, '10/11/2010' ),
    (2, 'Gk-130',  78.9, '10/13/2010' ),
    (3, 'GH-150',  23.5, '10/14/2010'),
    (1, 'C1-100',  31.8, '10/16/2010' ),
    (1, 'G1-110',  54.8, '10/16/2010' ),
    (2, 'GC-120',  99.0, '10/16/2010' ),
    (3, 'Gk-130',  110.0, '10/16/2010' ),
    (3, 'G5-140',  102.8, '10/16/2010' ),
    (2, 'GC-120',  105,  '10/18/2010' ),
    (2, 'Gk-130',  56.7, '10/18/2010' ),
    (1, 'C1-100',  84.3, '10/18/2010' ),
    (1, 'G1-110',  75.2, '10/19/2010' ),
    (2, 'GC-120',  64.9, '10/20/2010' ),
    (3, 'GH-150',  84.0, '10/20/2010' ),
    (1, 'C1-100',  78.0, '10/20/2010' ),
    (1, 'G1-110',  89.5, '10/20/2010' )
    GO
    --Date for DateRange Table
    INSERT INTO DateRange (StartDate, EndDate) VALUES
    ('2010-10-11 00:00:00.000', '2010-10-11 23:59:59.997'),
    ('2010-10-12 00:00:00.000', '2010-10-12 23:59:59.997'),
    ('2010-10-13 00:00:00.000', '2010-10-13 23:59:59.997'),
    ('2010-10-14 00:00:00.000', '2010-10-14 23:59:59.997'),
    ('2010-10-15 00:00:00.000', '2010-10-15 23:59:59.997'),
    ('2010-10-16 00:00:00.000', '2010-10-16 23:59:59.997'),
    ('2010-10-17 00:00:00.000', '2010-10-17 23:59:59.997'),
    ('2010-10-18 00:00:00.000', '2010-10-18 23:59:59.997'),
    ('2010-10-19 00:00:00.000', '2010-10-19 23:59:59.997'),
    ('2010-10-20 00:00:00.000', '2010-10-20 23:59:59.997')
    GO
    Question - 
    I want TOTAL Balance of all Accounts in a Branch per each day between 10/11/2010 to 10/20/2010
    If the Snapshotdate (date) on which the account was not made an entery to AccBalance table, last available  balance to be considered for that account.
    like for account [C1-100] on 10/15/2010 the balance should be [10.4]
    --Group By Branch
    --Last valid Account balance to be considered.
    I know, this is long solution, but any one who is expert in T-SQL can help me in this solution.
    Thanks,
    Krishna

    Thanks Himanshu You almost solved my issue...but can you provide the final output as following...
    Actually you are aggregating the Amount, which is not required, as it is the total available in that account.
    But the missing pint is I need the SUM of all the accounts for each DAY in a BRANCH.
    The 3rd Result Query modified to get DAILY balances for each account as following...
    --*RESULT*
    SELECT a.AccId, a.StartDate, 
                        (SELECT TOP 1 b.Amount
                        FROM #InterimOutput b
                        WHERE b.AccId = a.AccId and b.Amount > 0
                        AND B.StartDate<=A.StartDate  ORDER BY B.StartDate DESC) as ToDateBal
    FROM   #InterimOutput a
    ORDER BY a.AccId
    go
    Now I need SUM of all Account Balances AT each BRANCH on DAILY basics. Can you help on that?
    Thanks again
    Krishna

  • Query execute() API goes for inifinite wait (Hang)

    Hi
    I am using BDB XML 2.4 in Fedora core-4. when I execute xquery update operation followed by FLWOR get query, the execute() API goes for infinite wait. We have tried setting NOWAIT flags to see if it waits for lock, but the program is in INFINITE wait (hang) state.
    Below is the sample code and query I have used.
    #include <dbxml/DbXml.hpp>
    using namespace DbXml;
    int
    main(int argc, char **argv)
         std::string containerName = "myContainer.dbxml";
         std::string docFilename = "./NECB1.xml"; // the filename
         std::string queryString1 = "declare namespace SWI='SWI'; <getBulkResult> { let $i :=collection()//SWI:wmanIfBsOfdmaDownlinkChannelTable return ($i)} </getBulkResult>";
    std::string queryString = "replace node collection()//SWI:wmanIfBsOfdmaDownlinkChannelTable/SWI:wmanIfBsOfdmaDownlinkChannelEntry[@ifIndex='2']/SWI:wmanIfBsOfdmaDownlinkCenterFreq with <SWI:wmanIfBsOfdmaDownlinkCenterFreq>3</SWI:wmanIfBsOfdmaDownlinkCenterFreq>";
         try {
              u_int32_t env_flags=DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_AUTO_COMMIT|DB_RECOVER|DB_INIT_TXN;
              DbEnv *clEnv = new DbEnv(0);
    clEnv->open("/tmp",env_flags,0);
              XmlManager mgr;
              if (mgr.existsContainer(containerName))
                   mgr.removeContainer(containerName);
              // Now it is safe to create the container
              XmlContainer cont = mgr.createContainer(containerName);
              u_int32_t cf =1000; //time out value in micro seconds
              clEnv->set_timeout(cf,DB_SET_LOCK_TIMEOUT);
              // All Container modification operations need XmlUpdateContext
              XmlUpdateContext uc = mgr.createUpdateContext();
              // Create the file input stream
    XmlInputStream *myStream = mgr.createLocalFileInputStream(docFilename);
    // Put the document in the container
    cont.putDocument(docFilename, myStream, uc, 0); //TODO try without last parm(0)
              std::cout << "File loaded" << std::endl;
              // Querying requires an XmlQueryContext
              XmlQueryContext qc = mgr.createQueryContext();
              qc.setDefaultCollection(containerName);
              qc.setNamespace("SWI","SWI");
              std::cout << "update query " << std::endl;     
              XmlQueryExpression expr = mgr.prepare(queryString, qc);
              XmlResults res = expr.execute(qc);     //modify
              std::cout << "get query " << std::endl;     
              XmlQueryExpression expr1 = mgr.prepare(queryString1, qc);
    XmlResults res1 = expr1.execute(qc);     //getbulk
              std::cout << "The query modify, '" << expr.getQuery() << "' returned " <<
              res.size() << " result(s)" << std::endl;
              XmlValue value;
              std::cout << "Result 1: " << std::endl;
              while (res.next(value)) {
                   std::cout << "\t" << value.asString() << std::endl;
              std::cout << "The query 2 bulk , '" << expr1.getQuery() << "' returned " <<
    res1.size() << " result(s)" << std::endl;
              XmlValue value1;
    std::cout << "Result 2: " << std::endl;
    while (res1.next(value1)) {
    std::cout << "\t" << value1.asString() << std::endl;
         } catch (XmlException &xe) {
              std::cout << "XmlException: " << xe.what() << std::endl;
         return 0;
    Sample output:
    ===========
    [root@localhost santhosh]# ./query
    File loaded
    update query
    get query
    ^C
    Please let me know what could be the issue. Do I need to set any transaction related flags? I hope it should through exception if any setting/query is wrong.
    Thanks,
    Santhosh

    Hi Santhosh,
    Because you aren't using explicit transactions, your update query is being auto-transacted, and the read-only query is running without a transaction. This is very bad, and is giving you a self-deadlock situation. You should use an explicit transaction for your queries.
    John

  • Enter Query mode to Normal Mode

    In my form i have a modify button. After clicking the modify mode, the mode will be enter-query. I have a number field. After entering the number i will be prompting the user to select yes or no from an alert. If he is selecting yes i will execute query modify save.. no problem.
    If he is select no.. i am populating the values from a procedure.. i want to insert a new record.. but now i want to change the enter query mode.. how do that...
    If i am using Exit_form; the populated details are getting cleared..
    please help me..

    Hi,
    Try using Abort_query. Hope it will help you.
    Regards
    Gaurav Thakur

  • OBIEE - Null Value in Joins

    Hi All,
    In OBIEE, How will I handle the null value in join conditions?
    I have 2 tables inner joined together in the RPD level. They are User_Profiles table and Parties table.
    I am creating a database prompt for a report and in dropdown sql results Iam giving the below query.
    SELECT distinct CASE WHEN USER_PROFILES.PAR_ID IS NULL THEN PARTIES.PAR_ID ELSE
    USER_PROFILES.PAR_ID END FROM user_profiles,parties WHERE USER_PROFILES.USER_ID='12345' AND parties.par_type = 'ABC' and parties.status = 'N'
    Here the PAR_ID is not fetched in the dropdown from PARTIES table . The reason behind this is, when the USER_PROFILES is having PAR_ID as null, it is not able to join with PARTIES table and the dropdown is not populating. It works fine when it fetch from user_profiles table. I believe the issue occurs because of the user_profiles table having null values and not able to fetch from parties table.
    Please advice..

    Hi All,
    I managed to write the query modified like below to handle the null value.
    select nvl2(user_profiles.par_id,user_profiles.par_id,parties.par_id) from WFMT_SAINT_PR where user_profiles.user_id= {User()}
    and ((user_profiles.par_id is not null and parties.par_id = user_profiles.par_id) OR (user_profiles.par_id is null and parties.par_type = 'MFR' and parties.status='C'))
    But when i put this is dashboard prompt sql results for PAR_ID field i get the following error.
    Error Generating Drop Down Values
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: select nvl2(user_profiles.par_id,user_profiles.par_id,parties.par_id) from WFMT_SAINT_PR where user_profiles.user_id= {User()} and ((user_profiles.par_id is not null and parties.par_id = user_profiles.par_id) OR (user_profiles.par_id is null and parties.par_type = 'MFR' and parties.status='C'))
    Can you please advice what is wrong here..

  • Interactive Report Download CSV file Issue (output includes separator BR)

    Hi,
    I have a Interactive Report and displaying the column values (multiple values in same ROW) as mentioned below.
    SQL Query
      select deptno,
           function1(empno) empno
      from emp
    IR Output
    Dept       Employee No
    10         AAA,BBB,CCC, ...    // -  Row 1
    20         XXX,YYY,ZZZ, ...    // -  Row 2 Now I want to display each employee in a new Line, so modified the SQL Query
    Modified SQL Query
      select deptno,
           REPLACE(function1(empno),',','<br>') empno
      from emp
    New IR Output
    Dept       Employee No
    10         AAA
               BBB
               CCC
               ...    // -  Row 1
    20         XXX
               YYY
               ZZZ
                ...    // -  Row 2 SO, Interactive Report Out put looks fine and that's the way we want.
    But the problem is when I download the Report in CSV or in PDF using the Action Menu -> Download..
    I am getting break line B R in the output, and also I have two different output in CSV for two different column. [Logic is same for both the columns.]
    CSV output1
    Employee No
      AAA<br>BBB<br>CCC
      XXX<br>YYY<br>ZZZI have other columns also with multiple values...for that column, I am getting the following CSV output
    CSV output2
    City List
      1111<br>
      2222<br>
      3333<br>So, in CSV for one column, I am getting all the values in same line with the seperator B R (Output1)
    for other column, I am getting values in new line with the separator B R. (Output2)
    Is there a way to FIX this CSV or PDF output for Interactive Report.
    I DON'T WANT THE SEPARATOR BR in CSV and also the values should always be in New Line.
    I want to have the following Output in CSV
    Employee No
      AAA
      BBB
      CCCThanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 11:45 AM
    Edited by: Deepak_J on Feb 24, 2010 11:46 AM
    Edited by: Deepak_J on Feb 24, 2010 11:48 AM

    Thanks.. Jari.. for the quick response.
    I updated my SQL query with Chr(10) and added the code in Page HTML header.
    Now the CSV & PDF output are fine..getting each individual value in seperate line (no BR tag)
    BUT in the Interactive Report Output, I am now getting first 2 values in 1 line, then next value in next line, and so on..
    IR Output
    Employee
      AAA BBB
      CCCCCCC
      DDDDDI have few more issues with CSV & PDF output
    1. In PDF is there a way to increase the column width, as for some of the columns, the values are getting truncated.
    2. For some of the columns in IR Report, I have user BR tag in Column Heading and this also come in CSV output (column heading with BR tag), is there a way to fix this. In PDF Column headings are fine (no BR tag)
    and by the way..what exactly this does.
    <style type="text/css">
    .apexir_WORKSHEET_DATA td{white-space:pre;word-wrap: break-word}
    </style>Thanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 12:20 PM
    Edited by: Deepak_J on Feb 24, 2010 12:21 PM

  • How to get column value in grid View

    Hello My first Language is German so bear with my English
    FIRST vIEW THE SCREEN SHOT PLEASE
    I am new to asp.net  i am making small application to generate reports in which user give criteria just liek we do in sql server  i have two grid view in accordion section then there is button  so Both GridView has headers that  Name
    , Output and Filter
    Name shows the Column of database fields, output column has check box if user check box it will only display those columns and filter is text box in which we filter our results
    basically i am just trying to do this like sql server in which user check columns to display and also provide filter criteria and then sql query modified according to the grid values.
    i have attached the screen shot of grid view kindly view it please You will have idea what i am tyring to say 
    now i want some help in filter criteria 
    suppose user check ref Code, School,Program, Name in the grid view and press show button
    it generates query
    select RefCode,School,Program,Name from Applicant.
    now i want to apply where clause if user write something in filter text box which i can not do kindly help me out and view the screen shot my desire outcome is if user check column and also write some value in RefCode filter textbox let suppose '0565-01'
    and in School Text user write SBE
    it should generate  sql
    select RefCode,School,Program,Name from Applicant where (RefCode='0565-01')and (School='SBE');
    my code for show button which generate simple select statement without where clause is below.
    protected void Button2_Click(object sender, EventArgs e)
    String output = "";
    String filter = "";
    foreach (GridViewRow row in gvExperience.Rows)
    CheckBox cb = (CheckBox)row.FindControl("CheckBox1");
    if (cb.Checked == true)
    output += row.Cells[0].Text.ToString() + ','; // get the Name of columns and concate in output variable }
    output = output.Remove(output.LastIndexOf(","), 1)
    string sql = "select " + output + " from Applicant"; // display the query
    bindoutput(sql); // pass this query and bind the new gridview which contain generated sql
    Azeem

    Hi Azeem,
    >>I am new to asp.net  
    Please ask on this forum instead:
    http://forums.asp.net/24.aspx/1?Web+Forms+Data+Controls
    ASP.NET issue is not related to WinForm forum.
    Regards,
    Barry Wang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Authorization in SAP BI

    Hi everyone,
    i am new to this Authorization Concept. I need to create a few Roles for End Users and Developers. Can anyone please guide me through.
    We have a Report A.
    Now ,
    1) I need to provide authorizations for creating a query, modifying an existing query , Executing and Displaying the Query result .This is for the Key User
    2) I need to Provide authorizations only to execute the Query and display the Query Result. This is for normal End User.
    3) I need to provide a Development Role to the IT Manager who is at the client place. He should be able to design the BI Development as well, Like Creating Cubes etc.
    Please provide some valuable inputs.There are no Object level authorizations. Its only Reporting Level Authorizations.

    Rajiv,
    You can create roles via T.Code PFCG.
    There you need to give 4 Authorization objects:
    S_RFC
    S_RS_AUTH
    S_RS_COMP
    S_RS_COMP1
    In Auth Objects S_RS_COMP & S_RS_COMP1 You can define following autorizations for query in activity tab:
    02  Change
    03  Display
    06  delete
    16  Execute
    22  Enter, Include, Assign
    Create different roles Normal user, Key user & BI developer.
    Provide T.code Rsa1 to developer & related autorisation in PFCG
    Regards,
    Shilpi Gupta

  • Report to pull multiple Product Categories/Organizational Units per project

    Hi Experts,
    We are facing the following issue.
    We have created a Project and have associated multiple Product Category & Organization to this project, many to One relationship. This we have achieved through customization. When we are pulling report for this project through Reports-> Project Summary Extract. Itu2019s giving us only one Product Category & one Org Unit per Project. The business wants us to pull all the Org Units & the Product categories associated with the Project, when we are displaying the report. This org units & product categories will be shown in Org Unit & Product category columns respectively separated by commas.
    Looking forward for your help.
    Thanks,
    Ritik

    Hi Vikram,
    We have not created any custom fields neither for the Product Categories nor for the Org Unit/Business Unit(T1.BUSINESS_UNIT_OBJECT_NAME). These two fields are already there in the Result fields for the report Project Summary Extract . I am just looking for some way to pull all the Product categories & Business Units associated with the project  in the Product Categories column & in Business Unit column respectively separated by comma or show it as in example 2 given below(in multi rows).
    e.g. 1:
    Project:     Product Categories:
    PROJ1   ->  PC1,PC2,PC3
    Or
    e.g. 2:
    Project:      Product Categories:
    PROJ1        ->                           PC1
    PROJ1     ->                    PC2
    PROJ1     ->                             PC3
    I have already copied the existing query & modified it to achieve the above, but still this is not working. Currently i am querying FCI_MAS_INTERNAL_CAT for Product Categories & FCI_PRO_PROJECTS for projects.
    Can you please provide me any sample query to achieve this functionality. Any help on this is greatly appreciated.
    Thanks,
    Ritik

  • Formatting a date in cfselect

    Assuming a query "meetingdate" that grabs a unique value of
    the 'meetingdate' field (a date/time field). In a form, that query
    is used to populate a cfselect command.
    The dropdown boxes now contain "yyyy-mm-dd hh:mm:ss" value
    (as in "2006-06-12 12:23").
    How do I format the drop-down values into 'mm/dd/yy", as in
    "06/12/06" ? Using the formatdate in the 'display' argument of the
    cfselect command returns an error.
    Or, should the query command contain some sort of formatdate
    function (and what would that be)?
    Thanks....Rick...

    Use appropriate SQL functions to format the field in the
    query, would
    depend on the DBMS system you are using (MSSql, MYSql,
    Access, Oracle, etc).
    OR
    Use <select> instead of <cfselect> where you can
    use a basic loop to
    populate the <option> tags and format the date in the
    loop.
    OR
    Use a Query of Query or manually build a query out of the
    original query
    modifying the format of the date string and use this new
    query in the
    <cfselect> tag.
    rhellewell wrote:
    > Assuming a query "meetingdate" that grabs a unique value
    of the 'meetingdate'
    > field (a date/time field). In a form, that query is used
    to populate a cfselect
    > command.
    >
    > The dropdown boxes now contain "yyyy-mm-dd hh:mm:ss"
    value (as in "2006-06-12
    > 12:23").
    >
    > How do I format the drop-down values into 'mm/dd/yy", as
    in "06/12/06" ? Using
    > the formatdate in the 'display' argument of the cfselect
    command returns an
    > error.
    >
    > Or, should the query command contain some sort of
    formatdate function (and
    > what would that be)?
    >
    > Thanks....Rick...
    >

  • Get categories sequence order

    Hi,
    I manage to display some categories on a page. Some how I like to display the categories in a specific order. To be exact, I like to have the same order as we can define in the pagegroup properties > configure tab > Types and Classification > Categories section, when adding new categories.
    Portal stores that sequence order somewhere because when we return to pagegroup properties we have the same order as defined previously. I looked the Portal's tables and package trying get the table or view where sequence order is stored, but I can't get it.
    Anybody knows where I should get this sequence order? (table or view). I'm new to Portal and so I know little about it.

    Found
    portal.wwv_topics
    PORTAL.WWSBR_ALL_CATEGORIES allows you to query/modify your categories.

Maybe you are looking for