Sql if statment query

How can i wrote this
if in_business ='1'
then busiess.usa_flag='Y'
elseif
in_business =2
then business.usa1.flag='Y'
else *All'
no filter by business
Thanks

scott@ORA92> SELECT * FROM business
  2  /
NAME                             USA_FLAG
ORACLE                                  1
OTHER                                   2
ANOTHER                                 3
scott@ORA92> VARIABLE in_division NUMBER
scott@ORA92> EXECUTE :in_division := 1
PL/SQL procedure successfully completed.
scott@ORA92> SELECT *
  2  FROM   business
  3  WHERE  usa_flag = DECODE (:in_division, 1, 1, usa_flag)
  4  /
NAME                             USA_FLAG
ORACLE                                  1
scott@ORA92> EXECUTE :in_division := 4
PL/SQL procedure successfully completed.
scott@ORA92> SELECT *
  2  FROM   business
  3  WHERE  usa_flag = DECODE (:in_division, 1, 1, usa_flag)
  4  /
NAME                             USA_FLAG
ORACLE                                  1
OTHER                                   2
ANOTHER                                 3
scott@ORA92>

Similar Messages

  • SSRS - SQL Server Spatial Query

    Hi, I was hoping someone could help me.
    I'm creating an SSRS report with Map and importing points via SQL Server Spatial query. I have a db table with 8,000 points bu the import only ever brings in the first 2,000 queried (no matter what the filter is). Is there a limitation in SSRS that can be
    changed via a configuration setting?
    Many thanks in advance for any help on this,
    Steve.

    Really appreciate you coming back so quick Olaf.
    No its a straightforward query (select AccountNum, Name, Address, Longitude, Lattitude, UrbanArea, County, MI_STYLE, MI_PRINX, SP_GEOMETRY from <table>)
    Just to give the whole picture. I had 8,000 points in MapInfo version 10. I imported them to SQL Server 2012 via MapInfo Easy Loader.
    The SQL Server spatial points import to SSRS and the Bing overlay map works great (so they import to correct space) but its only a subset of the points that import. I can pick any subset using the WHERE clause but I cannot get all 8,000 points.  
    I was hoping there was a configuration setting somewhere in SSRS that was causing the problem.

  • Conditional SQL in Report Query

    How can I code a conditional SQL in the Report query builder
    to include a WHERE clause parameter or not, depending on the value
    of a report parameter? Basically, what I want to do is:
    select field from table where x=1
    <cfif param.a eq 1>and a=1</cfif>
    Report builder does not like this, but I can't find any help
    on how to do this.

    I don't think CFML tags may be used like that in the SQL of
    report query. But then, I'm not very much into reports. If you're
    just out to get the result, then try
    select field from table
    where
    (x=1 and #param.a# <> 1) or (x=1 and #param.a#=1 and
    a=1)

  • Error [hyt00] [microsoft][odbc sql server driver] query timeout expired

    I have the below network setup:-
    1. Its a simple network at my father's office at a small town called Ichalkaranji (District - Kolhapur, Maharashtra).
    2. We are using private network range 192.168.1.xxx with two Windows Server 2003 Enterprise Edition with SP2 licensed copies and 15 local Windows 7 clients who are only using Server A.
    3. The network is having a TP-Link Braodband Router Connected to internet with the IP 192.168.1.1.
    4. Both there Windows Server 2003 Enterprise Edition with SP2 are running separate SQL Server 2005 Express with Advanced Services, you can treat them as Server A (Problematic Server with IP of 192.168.1.2) 
    and Server B (this is not having any issue with IP of 192.168.1.3).
    5. Server A is also being used by 6 Remote users from our Kolkata office using DDNS facility through the NO IP client software which installed separately on both the servers. Kolkata remote users
    do not use OR access the Server B.
    6. Server B is being used by only 2 Remote users from our Erode office (Under Salem District, Tamilnadu) using DDNS facility through the NO IP client software which installed separately on both
    the servers. Erode remote users do not use OR access the Server A.
    7. The front end application which running separately on both the servers have been developed in VB by a local vendor at Ichalkaranji (District - Kolhapur, Maharashtra).
    8. Both Servers are having the same database structure in terms of design and tables format. Only difference is that both the servers are being used separately.
    9. This error OR problem is only related to Server A, where on the clients we get the message "error [hyt00] [microsoft][odbc sql server driver] query timeout expired" every now and then.
    10. We have to frequently reboot the server whenever we get this message on the client machines. May be after rebooting every thing works perfectly for 2 hours / 5 Hours / may be one full day but
    the the error will come back for sure.
    11. Current Database back up size on Server A is around 35 GB and take around 1 hour 15 minutes daily to take the back up.
    12. Current Database back up size on Server B is around 3 GB and take around 5 to 10 minutes daily to take the back up.
    13. One thing I have noticed is that when ever we reboot Server A, for some time sqlsrvr.exe file will show memory usage of 200 to 300 MBs but it will start using slowly, what i understand is that
    this is the way SQL Server works.
    14. Both the Servers are also running Quick heal Antivirus Server Edition separate licensed copies also.
    15. Server B is also running Tally ERP 9 Licenses copy which is being used locally by 15 users of Ichalkaranji (District - Kolhapur, Maharashtra) same users
    Can any one help to resolve this issue. Any help will be highly appreciated.

    The error message "query timeout expired" occurs, because by default many APIs, including ODBC only waits for 30 seconds for SQL Server to send any output. If no data has been seen for this period of time, they tell SQL Server to cancel execution
    and return this error to the caller.
    This timeout could be seen as a token that the query is taking too long time to execute and this needs to be fixed. But it can also be a pain in the rear parts, if you are content with a report taking five minutes, because you only run it once a day.
    The simplest way to get rid of the error is to set the timeout to zero, which means "wait forever". This is something your vendor would have to do. This may, however, not resolve the problem, as the users may just find that the application is hanging.
    To wit, there are two reasons why the query takes more than 30 seconds to complete. One is that there is simply that much work to do. This can be reduced by adding indexes or by doing other tuning, if the execution time is not acceptable. The other possibility
    is blocking. That is, there is a process blocking this query from completing. This is much more likely to require attention.
    It is not clear to me, whether the vendor has developed the database part as well. In this case, you should probably call the vendor's support desk to have them to sort this out.
    Finally, I am little puzzled. You say that you are using Express Edition, but one of the databases is 35 GB in size. 35 GB is far above the limit for Express Edition.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • 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

  • Any SQL can be query out why AP invoice cannot be select in AR/AP Netting

    Dear All,
    as the subject, is there any SQL can be query out why AP invoice cannot be select in AR/AP Netting in R12?
    For example, invoice A, assume can be select during the AP/AR Netting Batch created. but failed, so i want to use a SQL to query out or diagnostic why this invoice cannot be selected.
    Regards
    Terry

    Dear All,
    as the subject, is there any SQL can be query out why AP invoice cannot be select in AR/AP Netting in R12?
    For example, invoice A, assume can be select during the AP/AR Netting Batch created. but failed, so i want to use a SQL to query out or diagnostic why this invoice cannot be selected.
    Regards
    Terry

  • Simple sql to mdx query using the max fn

    I'm using the MDX Max fn to get the max of a certain value but now I want get max for a certain pair of values and not all, how could i write this in mdx as a calculation?
    More details: For a certain pair of status and substatus (status=1, substatus=1) from a trans dimension table i want to get the max insertionid (attribute in trans measure table). How would you guys suggest I go about this?
    I'm new to mdx and I'm converting a whole sql statement to a measure not to include it as a named query for performance concerns!
    If needed this is the sql query im converting:
    SELECT TOP (1) InsertionDT
    FROM dbo.TransTasksFFMS_GVT AS TSI
    WHERE (TaskCode = T.TaskCode) AND (TaskStatus = 1) AND (TaskSubStatus = 1)
    ORDER BY InsertionDT) AS RegistrationTimeWithoutConversion
    Another way to think of this is how to apply a certain measure only on certain values and not all values in the browser.

    Hi Junior,
    According to your description, you want to get the max value by using MDX query, right? Since no know your cube detail information, we cannot convert this T-SQL to MDX query. Here is a sample MDX query for your reference. The query below returns the Sale
    Amount measure and the MaxValue calculated member.  The MaxValue calculated member takes the maximum value for members of the Fiscal Year level in the Fiscal hierarchy of the Date dimension.
    WITH
    MEMBER [Measures].[MaxValue] AS
    MAX([Date].[Fiscal].[Fiscal Year].Members, [Measures].[Sales Amount])
    SELECT
    {[Measures].[Sales Amount],[Measures].[MaxValue]} ON COLUMNS,
    {[Date].[Fiscal].[Fiscal Year].Members} ON ROWS
    FROM
    [Adventure Works]
    Reference:Max (MDX)
    Regards,
    Charlie Liao
    TechNet Community Support

  • SQL or Powershell query to get the SCOM management group id for SCOM 2007 R2 & 2012 / 2012 R2

    Hi All,
    Can any one provide me the SQL or Powershell query to get the SCOM management group id for SCOM 2007 R2 & 2012 / 2012 R2
    I had a SQL query which will query the data from data warehouse and give the management group id but i have lost it for all 3 above.
    Gautam.75801

    Hi Gautam,
    Hope it helps:
    http://blog.tyang.org/2013/03/13/data-aggregation-field-became-empty-in-opsmgr-2007-linked-performance-report/
    http://blog.tyang.org/2012/09/05/mp-authoring-targeting-rms-or-ms/
    Natalya
    ### If my post helped you, please take a moment to Vote as Helpful and\or Mark as an Answer

  • How to convert SQL Server hierarchical query (CTE) to Oracle?

    How to convert SQL Server hierarchical query (CTE) to Oracle?
    WITH cte (col1, col2) AS
    SELECT col1, col2
    FROM dbo.[tb1]
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo.[tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
    DELETE a
    FROM dbo.[tb1] AS a INNER JOIN cte AS b
    ON a.col1 = b.col1

    See: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2129904
    Ah, just spotted it's a delete statement - you won't be able to do it using subquery factoring in Oracle.
    I had a go at trying to convert for you, but notice that you reference the cte from inside the cte... I can only assume you have a table called cte too...
    DELETE FROM dbo.tb1
    WHERE col1 = 12
    OR col2 IN (SELECT col1 FROM cte)
    Edited by: Boneist on 22-Jun-2009 09:19

  • Need help in insert statment query

    Hi,
    I have a table T1 with values like
    col1
    1
    2
    3
    4
    I need to write insert statment for t2 as
    insert into t2(col1,col2) values ('AA',select col1 from t1);
    The output of T2 should be
    col1 col2
    AA 1
    AA 2
    AA 3
    AA 4
    Any help in modifying the query.
    Ashish

    What is wrong with this?
    INSERT INTO id_own_dw.id_t_dw_org_dq_tgt
           (cost_center_cod_vc_old,
            cost_center_cod_vc_new
         SELECT '3016052',<<<_-- this you can replace with your varibale in pl/sql block
                cost_center_cod_vc
           FROM id_own_dw.id_t_dw_msl_org_cctr2mkdiv
          WHERE busi_unit_cod_vc = '3016496'

  • SQL 2012 SP1 - How to determine a query that causes Error 8623 in SQL Log: The query processor ran out of internal resources and could not produce a query plan. This is a rare event...

    We are getting multiple 8623 Errors in SQL Log while running Vendor's software.
    How can you catch which Query causes the error?
    I tried to catch it using SQL Profiler Trace but it doesn't show which Query/Sp is the one causing an error. 
    I also tried to use Extended Event session to catch it, but it doesn't create any output either.
    Error:
    The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that
    reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
    Extended Event Session that I used;
    CREATE EVENT SESSION
        overly_complex_queries
    ON SERVER
    ADD EVENT sqlserver.error_reported
        ACTION (sqlserver.sql_text, sqlserver.tsql_stack, sqlserver.database_id, sqlserver.username)
        WHERE ([severity] = 16
    AND [error_number] = 8623)
    ADD TARGET package0.asynchronous_file_target
    (SET filename = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xel' ,
        metadatafile = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xem',
        max_file_size = 10,
        max_rollover_files = 5)
    WITH (MAX_DISPATCH_LATENCY = 5SECONDS)
    GO
    -- Start the session
    ALTER EVENT SESSION overly_complex_queries
        ON SERVER STATE = START
    GO
    It creates only .xel file, but not .xem
    Any help/advice is greatly appreciated

    Hi VK_DBA,
    According to your error message, about which query statement may fail with error message 8623, as other post, you can use trace flag 4102 & 4118 for overcoming this error. Another way is looking for queries with very long IN lists, a large number of
    UNIONs, or a large number of nested sub-queries. These are the most common causes of this particular error message.
    The error 8623 occurs when attempting to select records through a query with a large number of entries in the "IN" clause (> 10,000). For avoiding this error, I suggest that you could apply the latest Cumulative Updates media for SQL Server 2012 Service
    Pack 1, then simplify the query. You may try divide and conquer approach to get part of the query working (as temp table) and then add extra joins / conditions. Or You could try to run the query using the hint option (force order), option (hash join), option
    (merge join) with a plan guide.
    For more information about error 8623, you can review the following article.
    http://blogs.technet.com/b/mdegre/archive/2012/03/13/8623-the-query-processor-ran-out-of-internal-resources-and-could-not-produce-a-query-plan.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • SQL Error in Query Editor

    Hello All,
    I am new to the Sun Java Studio Creator and in the tutorial Linking Components to Data tutorial.
    I created my own datasource which is a MS Access database.
    I have a simple look up table and I dragged the table onto the dropdown list as instructed and nothing happened. The dialog box the tutorial said would appear didn't appear.
    So I right clicked on the rowset added on to the page to get in the Query Editor.
    When opening the Query Editor, I get an error:
    Error Connecting to Database:
    java.sql.SQLException:[Microsoft][ODBC Driver Manager] does not support this function
    The SQL reads in the editor is something like this:
    SELECT ALL tableName.Column 1 FROM tblName
    Why does it automatically put the "All". Is that standard SQL? I don't think so. But I guess I could be wrong.
    I have not seen this used in other SQL. I've used T-SQL, PL/SQL, ACCESS SQL and never had I seen the "ALL" preceding the columns of the table.
    Quite frustrating when something as simple as a simple SELECT statement does not work when you're trying to learn a new tool.
    When adding the datasource, the test connection is fine. The query editor sees all of my tables in the MS Access database and all of the added table's columns.
    Am I missing a driver, or update to a driver? Or is this Sun's way of saying "Screw Your Microsoft database use something that we want you to use!!"
    Which is not pretty cool.
    I'm a newbie with this tool, but I have been coding for a while using MICROSOFT products. And have not had the same problems as this. Or at least getting help through documentation.
    I'm just venting here. I want to learn this tool. And when simple processes doesn't work. And documentation in why it's now working is hard to find, it gets quite frustrating.
    Anyone's help would be greatly appreciated.
    I truly appreciate your time for reading through my frustration.

    Hi,
    Please check the driver and also take a look at the link for "Supported Database Servers and JDBC Drivers"
    http://www.sun.com/software/products/jscreator/sysreq.xml
    regards
    MJ

  • Pass parameter to sql statement in query manager

    Hai to all,
               I want to pass the percentage  as the parameter into the sql statemnet.i what to execute it in the query manager.
              If i execute that statement then cann't found the tablename error is coming.
             Other than the data in the table (general data)  pass to the parameter in the sql at runtime.
    for example:
    select [%0] *100
    how to pass 10 to that sql statement.
    Please help me...
    Regards,
    Raji.

    Hi Ramya,
    You can create a SP with parameters to accept and then execut this SP from SAP Business One Query Manager by passing the parameter (in your case 10). The result will be as desired.
    Ex:
    Create this Procedure in SQL Management Studio
    create proc Test(@a as int)
    as
    begin
    select (@a*100)
    end
    To Execute the Query use this Query and pass the desired values with parameters
    execute Test 10
    Regards,
    Reno

  • Dynamic SQL and Pivot Query in 11G

    Hello all,
    I am using APEX and 11G I am trying to create a report based on the results of a pivot query. Below is the code to build the query string. The :P4_EPSB_PERIOD_HOLD holds data like (SEP-08') for example.
    declare
    q varchar2(4000);
    begin
    q:=q ||' select * FROM';
    q:=q ||' ( ';
    q:=q ||' select segment2, ';
    q:=q ||' accounted_dr, ';
    q:=q ||' period_name ';
    q:=q ||' from gl_je_lines a, ';
    q:=q ||' gl_code_combinations b';
    q:=q ||' where b.code_combination_id = a.code_combination_id';
    q:=q ||' and segment2 >= :P4_EPSB_OBJECT_FROM';
    q:=q ||' and segment2 <= :P4_EPSB_OBJECT_TO';
    q:=q ||' and period_name IN :P4_EPSB_PERIOD_HOLD';
    q:=q ||' and segment4 >= :P4_EPSB_LOCATION_FROM';
    q:=q ||' and segment4 <= :P4_EPSB_LOCATION_TO';
    q:=q ||' )';
    q:=q ||' PIVOT';
    q:=q ||' (';
    q:=q ||' sum(accounted_dr)';
    q:=q ||' for period_name IN :P4_EPSB_PERIOD_HOLD';
    q:=q ||' )';
    return q;
    end;
    I get the missingfailed to parse SQL query:
    ORA-00906: missing left parenthesis
    If I print the sql statement that the query generates, I get the following code, which, if the varaibles are hard-coded, works fine.
    select * FROM ( select segment2, accounted_dr, period_name from gl_je_lines a, gl_code_combinations b where b.code_combination_id = a.code_combination_id and segment2 >= :P4_EPSB_OBJECT_FROM and segment2 <= :P4_EPSB_OBJECT_TO and period_name IN :P4_EPSB_PERIOD_HOLD and segment4 >= :P4_EPSB_LOCATION_FROM and segment4 <= :P4_EPSB_LOCATION_TO ) PIVOT ( sum(accounted_dr) for period_name IN :P4_EPSB_PERIOD_HOLD )
    Any advice as to how to tackle this would be most welecome and appreciated.
    Thanks

    P4_EPSB_PERIOD_HOLDcome with single quotes? like 'SEP-08' or SEP-08

  • Simulate select distinct count sql logic in query or data model

    hello experts,
    given prerequisites: DSO with flat table without any key figures - just characteristics (about 10)
    the requirement is to produce the table with all possible combinations of those characteristics with counting the hits
    - this flat table should be then loaded to another system
    exmple
    char error| char division| char time|char id xxx xxx xxx xxx xxx
    some counter should be implemented and all combinations of 10 characteristics counted
    example
    char error| char division| char time|char id xxxxx  1
    char error| empty field| empty field| |char id   5
    etc
    the output should be flat table with counts on the right - some fields will be empty depending on combinations to be counted
    what is the best way - query with RCF or some SQL statements in Transformation? how to implement the output desired
    thanks in advance

    That sounds very odd.
    Can you turn on debug tracing by adding
    -Djbo.debugoutput=console
    to the Java options of your project (Project Properties, Profiles, Development, Runner)?
    Then test the query that is output in the log in SQL*Plus and see if you get the same results.
    -SteveA (JDev Team)

Maybe you are looking for