Invalid SQL generated for count query.

A SQL statement was generated with the table name information missing when
a count SQL query was issued (e.g. SELECT COUNT(*) FROM WHERE <SOME
EXPRESSION>). The same query worked fine before switching to vertical
class mapping.
Basically no queries work with the result set to "count(this)". The
temporary work-around was to retrieve the collection and get the size. I
would rather not have to do this.
Any ideas?

Brendan,
What version of Kodo is this happening with? Can you send a test case
demonstrating this to [email protected]?
-Patrick
Brendan Brothers wrote:
A SQL statement was generated with the table name information missing when
a count SQL query was issued (e.g. SELECT COUNT(*) FROM WHERE <SOME
EXPRESSION>). The same query worked fine before switching to vertical
class mapping.
Basically no queries work with the result set to "count(this)". The
temporary work-around was to retrieve the collection and get the size. I
would rather not have to do this.
Any ideas?

Similar Messages

  • Java.sql.SQLException: Invalid SQL type for column

    Hi guys!
    We are migrating from TOMCAT to WebLogic and we are getting the following error:
    java.sql.SQLException: Invalid SQL type for column
         at javax.sql.rowset.RowSetMetaDataImpl.checkColType(RowSetMetaDataImpl.java:94)
         at javax.sql.rowset.RowSetMetaDataImpl.setColumnType(RowSetMetaDataImpl.java:439)
         at      .initMetaData(CachedRowSetImpl.java:743)
         at com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:621)
    In TOMCAT environment rowset.jar is in common/endorsed directory. Need I to put rowset.jar at any specific location?
    Thanks.
    Best regards

    Hi!
    We are using WebLogic 11g (10.3.2). We know about datasource configuration, but for now we are justing migrating from Tomcat to WebLogic without change the application source code.
    Is there any option to solve this problem?
    Thanks a lot!
    Best Regards

  • Need help on Sql command for count

    Hi,
    I have the following table.
    Temp_Set Table
    ID Names Action
    1 John Delete
    2 John Add
    3 Mary Update
    4 Sim Add
    5 Sim Update
    How do I do a SELECT sql command for count(names) > 1 ?
    Please kindly advise me. Thank you very much.

    It doesnt work when I do this
    SELECT * FROM Temp_Set
    HAVING Count(names) > 1
    It prompts me the following error:
    ORA-00937: not a single-group group function
    00937.00000 - "not a single-group group function"
    *Cause:
    *Action:
    Error at Line:16 Column:7i am not sure but you can try this:
    SELECT B.* FROM
    (SELECT NAMES, COUNT(1) CNT FROM TEMP_SET GROUP BY NAMES) A, TEMP_SET B
    WHERE A.NAMES = B.NAME
    AND CNT > 1

  • SQL Joins for Order Query

    If someone could help me figure out what joins I need to do to handle the following, I would be greatly appreciative.
    Our Oracle Order Order Header has flex fields that are used to track a special address by it's code which is stored in Attribute 13 on OE_ORDER_HEADERS_ALL table. We use a site usage code called ADMIN_BY to set up a site in the customers table so we can place the address we are linking here. So for instance, if the order had AB-XXXXXX in it's attribute 13 field, I want to look for this same code in the customer site usage table and find the address in HZ_LOCATIONS table or null if attribute 13 does not have data. My only problem is taking care of the NULL case for all previous orders that did not contain this information.
    This is my sql query whcih works if we have a valid entry in attribute 13. This is also set up for a specific order number for testing only.
    SELECT DISTINCT
    ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER, AR.HZ_LOCATIONS.LOCATION_ID, AR.HZ_PARTY_SITES.LOCATION_ID AS LOC_ID,
    AR.HZ_PARTY_SITES.PARTY_SITE_ID, AR.HZ_PARTY_SITES.PARTY_ID, ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID,
    ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE13, ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE14, AR.HZ_LOCATIONS.ADDRESS1,
    AR.HZ_CUST_ACCT_SITES_ALL.PARTY_SITE_ID AS P_SITE_ID, AR.HZ_CUST_ACCT_SITES_ALL.CUST_ACCT_SITE_ID,
    AR.HZ_CUST_SITE_USES_ALL.CUST_ACCT_SITE_ID AS CUST_ACCT_S_ID, AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE
    FROM AR.HZ_PARTY_SITES, AR.HZ_LOCATIONS, ONT.OE_ORDER_HEADERS_ALL, AR.HZ_CUST_ACCT_SITES_ALL, AR.HZ_CUST_SITE_USES_ALL
    WHERE AR.HZ_PARTY_SITES.LOCATION_ID = AR.HZ_LOCATIONS.LOCATION_ID AND
    AR.HZ_PARTY_SITES.PARTY_ID = ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID AND
    AR.HZ_PARTY_SITES.PARTY_SITE_ID = AR.HZ_CUST_ACCT_SITES_ALL.PARTY_SITE_ID AND
    AR.HZ_CUST_ACCT_SITES_ALL.CUST_ACCT_SITE_ID = AR.HZ_CUST_SITE_USES_ALL.CUST_ACCT_SITE_ID AND
    ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE13 = AR.HZ_CUST_SITE_USES_ALL.LOCATION AND
    (ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER = TO_NUMBER('5074920')) AND (AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE = 'ADMIN_BY')
    I tried this code to no avail.
    SELECT DISTINCT
    ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER, AR.HZ_LOCATIONS.LOCATION_ID, AR.HZ_PARTY_SITES.LOCATION_ID AS LOC_ID,
    AR.HZ_PARTY_SITES.PARTY_SITE_ID, AR.HZ_PARTY_SITES.PARTY_ID, ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID,
    ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE13, ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE14, AR.HZ_LOCATIONS.ADDRESS1,
    AR.HZ_CUST_ACCT_SITES_ALL.PARTY_SITE_ID AS P_SITE_ID, AR.HZ_CUST_ACCT_SITES_ALL.CUST_ACCT_SITE_ID,
    AR.HZ_CUST_SITE_USES_ALL.CUST_ACCT_SITE_ID AS CUST_ACCT_S_ID, AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE
    FROM AR.HZ_PARTY_SITES, AR.HZ_LOCATIONS, AR.HZ_CUST_ACCT_SITES_ALL, ONT.OE_ORDER_HEADERS_ALL, AR.HZ_CUST_SITE_USES_ALL,
    ONT.OE_ORDER_HEADERS_ALL OE_ORDER_HEADERS_ALL_1
    WHERE AR.HZ_PARTY_SITES.LOCATION_ID = AR.HZ_LOCATIONS.LOCATION_ID AND
    AR.HZ_PARTY_SITES.PARTY_SITE_ID = AR.HZ_CUST_ACCT_SITES_ALL.PARTY_SITE_ID AND
    AR.HZ_PARTY_SITES.PARTY_ID = ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID AND
    AR.HZ_CUST_ACCT_SITES_ALL.CUST_ACCT_SITE_ID = AR.HZ_CUST_SITE_USES_ALL.CUST_ACCT_SITE_ID AND
    AR.HZ_CUST_SITE_USES_ALL.LOCATION (+) = OE_ORDER_HEADERS_ALL_1.ATTRIBUTE13 AND
    (ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER = TO_NUMBER('5074920')) AND
    (AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE (+) = 'ADMIN_BY')
    Any assistance would be greatly appreciated.

    Thanks for the reply Rob.
    Your input did help me return values for my query but I got 5 returned rows where I'm trying to return a single line. I modified my sql query with your recommendations.
    SELECT DISTINCT
    ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER, ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID,
    ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE13, ONT.OE_ORDER_HEADERS_ALL.ATTRIBUTE14, AR.HZ_LOCATIONS.ADDRESS1,
    AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE
    FROM AR.HZ_PARTY_SITES, AR.HZ_LOCATIONS, AR.HZ_CUST_ACCT_SITES_ALL, ONT.OE_ORDER_HEADERS_ALL, AR.HZ_CUST_SITE_USES_ALL,
    ONT.OE_ORDER_HEADERS_ALL OE_ORDER_HEADERS_ALL_1
    WHERE AR.HZ_PARTY_SITES.LOCATION_ID = AR.HZ_LOCATIONS.LOCATION_ID (+) AND
    AR.HZ_PARTY_SITES.PARTY_SITE_ID (+) = AR.HZ_CUST_ACCT_SITES_ALL.PARTY_SITE_ID AND
    AR.HZ_PARTY_SITES.PARTY_ID = ONT.OE_ORDER_HEADERS_ALL.SOLD_TO_ORG_ID (+) AND
    AR.HZ_CUST_ACCT_SITES_ALL.CUST_ACCT_SITE_ID (+) = AR.HZ_CUST_SITE_USES_ALL.CUST_ACCT_SITE_ID AND
    AR.HZ_CUST_SITE_USES_ALL.LOCATION (+) = OE_ORDER_HEADERS_ALL_1.ATTRIBUTE13 AND
    (ONT.OE_ORDER_HEADERS_ALL.ORDER_NUMBER (+) = TO_NUMBER('5074417')) AND
    (AR.HZ_CUST_SITE_USES_ALL.SITE_USE_CODE (+) = 'ADMIN_BY')
    Here is the results for 2 different Order Numbers
    For the first order which has a null value in attribute 13, here is the results
    NULL     NULL     NULL     NULL     1042nd AVIATION CO.     ADMIN_BY
    NULL     NULL     NULL     NULL     437 APS OUTBOUND FREIGHT     ADMIN_BY
    NULL     NULL     NULL     NULL     DCMC DETROIT - GRAND RAPIDS     ADMIN_BY
    NULL     NULL     NULL     NULL     FB5621     ADMIN_BY
    NULL     NULL     NULL     NULL     NULL     NULL
    For the next order which does have a value in attribute 13,
    5075315     3069     AB-S2303B     IB-S2303B     437 APS OUTBOUND FREIGHT     ADMIN_BY
    5075315     3069     AB-S2303B     IB-S2303B     DCMC DETROIT - GRAND RAPIDS     ADMIN_BY
    5075315     3069     AB-S2303B     IB-S2303B     FB5621     ADMIN_BY
    NULL     NULL     NULL     NULL     1042nd AVIATION CO.     ADMIN_BY
    NULL     NULL     NULL     NULL     NULL     NULL
    What I need is for them both to return a single line. The second order should have read...
    5075315     3069     DCMC DETROIT - GRAND RAPIDS     ADMIN_BY     AB-S2303B     IB-S2303B
    while the first order didn't even list the Order number.
    Any thoughts?

  • SQL tuning for a query

    Hello Gurus,
    I have 2 tables. One with a million records and the other with 50,000 records.
    Both have an account id column. The first table contains all the customer accounts and the second table has all the bad debt accounts.
    My problem is I need to update the status column in the first table for all the bad debt records from the second table.
    As I’m still a beginner in SQL tuning, can someone please help me write this query effi ciently considering the table sizes.
    tables description:
    SQL> desc customer
    Name Null? Type
    ACNTNO NUMBER(8)
    STATUS VARCHAR2(6)
    SQL> desc badcustomer
    Name Null? Type
    ACNTNO NUMBER(8)
    The sql I could come up with is:
    update customer outer
    set status='closed'
    where acntno exists (select 'X'
    from badcustomer
    where acntno=outer.acntno);
    Thanks for taking time to read this post.

    To post formatted code, put the {noformat} {noformat}- tag before and after your examples.
    When you post:
    {noformat} select *
    from dual;
    {noformat}
    it will appear as: select *
    from dual;
    on the forum.
    The FAQ will tell you more: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • TR not generating for modifiying query

    Hi all,
             I have design query and imported to BW quality. Now we have some modification in that. In BW development system query
    displaying in display mode not possible to change. Kindly give yr suggestion how to change and add one more filter option for that
    and also have to generate TR for that modification.
    thanks

    HI raj,
    As the query is already in Quality and been transported to QA system you can't edit the query directly in developemnt for changes.
    For this create a BEX request and asign the TR to your package in the BEX request. then you will be able to make changes to the query which is already transported to QA.
    Steps to create a BEx Request
    Goto Transaction RSA1 --> select "Transport connection" --> on the top right hand side you will find an option BEX transport(truck symbol). --> click on it IT will pop up a screen where you have the options "BEx transport Requests for single requests" --> there you can see the packages --> click on the request/task beside your package it will ask for the Transport request. create you own Reauest and asign that request to you package and save it.
    Now go to query designer and try to change the query it will allow you now.
    Regards
    KP

  • How to write SQL hints for this query?

    The query is like:
    select * from foo, t
    where foo.name in
    (select name from bar
    where id in (
    select id from car
    where date < sysdate
    and foo.a = t.b;
    I want the innermostsubquery 'select id from car ...' to be executed first, and the subquery 'select name from bar ...' to be execute second, and the outermost query 'select * from foo,t ...' to be executed the last. How can I write the Oracle sql hints to force the order?
    Thanks.

    user553560
    You might be able to create a large set of hints to force the access path you want - but unless you really know what you are doing with hints, you may find that your solution is very unstable (it might be luck rather than correctness that let's it work to start with).
    The difficulty in this query is the double layer of IN subqueries, so if you can rewrite the query, you might try manually unnesting as follows:
    select
         t1.*. t.*
    from
              select     
                   distinct t2.name
              from     t2
              where     t2.id in (
                        select     t3.id
                             from     t3
                        where     t3.dated < sysdate
         )     v,
         t1,
         t
    where
         t1.name = v.name
    and     t1.a = t.bDepending on your indexing and statistics, you may find that a simple /*+ unnest */ hint in the first subquery will be sufficient to do this for your. Again depending on the statistics you may find that you have to put extra hints into the above to make Oracle use the join method and indexes you think appropriate.
    N.B. The first step (as others have noted) is to check that your statistics are good before you start manipulating the code or using hints.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • SQL -generated for migration

    I want to know where do I find the SQL statements generated by
    the migration utility for Oracle 8.1.5 from Access.
    Also where does the errors get logged?
    Thanks in advance.
    null

    hi donal,
    in my case even the same thing is happening Oracle workbench is having stored procedures in omwb_emulation like cdate, int_ , time_,time_1 (which i think are system functions provided by sql server, i don't understand why they are being migrated and stored under omwb_emulation?) also two packages with the name of globalpkg and utilities are created under omwb_emulation schema.
    Which i have seen is being referenced a lot of times in converted PL/SQL Stored procedures like everytime a select statement in a SQL Server procedure is converted to some code which references omwb_emulation.globalpkg. I am not able to comprehend what's the reason behind this. can somebody through light on this and let me know is it really required?

  • Powershell - SQL statement for WMI query

    Need to input / update sql database, two main tables: server and diskDrive
    The Primary key for server table is server_id which is also a foreign key in diskDrive table.
    There is no primary key set in the diskDrive table.
    I am able to insert all of the basic data in the server table no problem. 
    What I need help creating/understanding is how to account for the servers with multiple drives.
    Here is my command for accounting for all drive information:
    $diskDrive = gwmi -query "select * from Win32_Volume where DriveType='3' AND DriveLetter IS NOT NULL" | Select @{Name="Device";Expression={$_.DriveLetter}},`
    @{Name="Capacity";Expression={[math]::round(($($_.Capacity)/1GB),2)}},`
    @{Name="FreeSpace";Expression={[math]::round(($($_.FreeSpace)/1GB),2)}},`
    @{Name="UsedSpace";Expression={[math]::round((($_.Capacity - $_.FreeSpace)/1GB),2)}},`
    @{Name="PercentFree";Expression={[math]::round(($($_.FreeSpace)/$($_.Capacity)*100),2)}}
    My thought is to create an exist statement to determine if I need to insert or update the Database:
    $ServerExist = "Select server_id from server where server_name = '$ServerInfo.csname'"
    if ($ServerExist) {
    update statement
    } else {
    #Create SQL Insert Statement with your values
    $insert_stmt = "INSERT INTO Server(server_name, domain_name, Manufacturer, Model, Memory)
    VALUES ('$($Output.Name)','$($Output.Domain)','$($Output.Manufacturer)','$($Output.Model)','$($Output.TotalPhysicalMemory)')" -replace "\s+"," "
    $cmd.CommandText = $insert_stmt
    ## Invoke the Insert statement
    $cmd.ExecuteNonQuery()
    I have tested the insert statement and that works fine.  However I have not implemented the $diskDrive aspect of the insert. 
    Although there will be a slight difference between the insert and update statement for the diskDrive table, still need to work out the iteration aspect for sql statement.
    Items that will need to be inserted/updated per drive:
    Server_id
    DriverLetter
    Capacity
    FreeSpace
    UsedSpace
    PercentFree
    Given my $diskDrive query, I think there needs to be While($diskDrive) statement that will iterate through the drive info and then insert/update until While is finished. 
    However I’m not sure how that is accomplished and hoping to get some help.
    Please let me know if any other information is needed.
    Thanks,
    Jr. Admin

    Hello jrv,
    The problem is my limited experience in powershell and how to iterate through the $diskDrive variable and pull the specific drive information including the server_id and inserting or updating the diskDrive table accordingly. 
    I was able to figure out how to do the insert for one specific wmi entry but in regards to the disk drive, i'm not sure how to work the scripting to run through each drive, insert/update and continue until all drives have been accounted for.
    Please let me know if you need any other information.  I will consider posting later on SQL forum.
    Thanks,
    Jr. Admin

  • Can I change sql statement for some query runtime?

    Hi All!
    The problem that I have to implement report with query like this: select * from a where b in (?,?,?). The number of parameters depends on user choice. On the client side it will be a list of check boxes. Is there any way to implement such report? I can see just one way so far - to modify sql statement runtime.
    Thanks!

    hello,
    create a user-parameter myListe or myWhere (wee examples below) and change your query to
    select ... from ... where b in (&<myList>)
    or even better
    select ... from ... &<myWhere>
    now you can pass in the constructed list or where clause. you can also construct the values in the afterParameterform-Trigger
    regards,
    philipp

  • [NQQuery log]: Physical SQL generated agaisnt 2 Database in OBIEE 11g

    Hi Experts,
    I have a problem regarding the physical SQL generated by Query log.
    So this is the setup.
    SCENARIO 1:
    Oracle Data Warehouse DB
    - col1
    - col2
    - col3
    OLAP_OBIEE
    - col4
    When I run these columns together in Analysis. It seems like the physical SQL generated in the Query log is partitioned with each other and I cant get the exact SQL so I can make comparison with the total record count in Analysis UI and the SQL developer.
    select col1, col2, col3 from Oracle Data Warehouse tables
    select col4 from OLAP_OBIEE tables
    ================================================================
    SCENARIO 2:
    Oracle Data Warehouse DB
    - col1
    - col2
    - col3
    - col4
    Running these columns together in Analysis. I am wondering why the physical SQL is somewhat also partitioned just like in SCENARIO 1.
    select col1, col2, col3 from Oracle Data Warehouse tables
    select col4 from Oracle Data Warehouse tables
    Hope that you get what am I trying to say. :(
    Thanks,
    Edited by: OBIEE/BIP Forumer on Oct 29, 2012 1:27 AM
    Edited by: OBIEE/BIP Forumer on Oct 29, 2012 1:27 AM

    Hi Maqsoon,
    Sorry for the confusion, in my Analysis report, I have a report where it generates 2 physical SQL in one Database, also I have a report where it uses 2 Database which also generates 2 physical SQL.
    Below is the SQl generated in my Analysis report using 1 Database
    select count(distinct case when T68197.OPTY_WID > 0 then concat(T67058.INTEGRATION_ID, cast(T67058.DATASOURCE_NUM_ID as CHARACTER ( 30 ) )) end ) as c1,
    T67058.OPTY_O_REVN as c2,
    T67365.CUST_VALUE_NAME as c3,
    T157680.NAME as c4,
    T157680.INTEGRATION_ID as c5
    from
    W_OPTY_D T67058 /* Dim_W_OPTY_D */ ,
    W_REVN_F T68197 /* Fact_W_REVN_F */ ,
    W_PARTY_D T157680,
    W_PARTY_ORG_D T67365
    where ( T67058.ROW_WID = T68197.OPTY_WID and T67365.ROW_WID = T157680.PARTY_ORG_WID and T68197.PR_CUSTOMER_WID = T157680.ROW_WID )
    group by T67058.OPTY_O_REVN, T67365.CUST_VALUE_NAME, T157680.NAME, T157680.INTEGRATION_ID
    order by c5, c2
    [2012-10-30T11:44:39.000+00:00] [OracleBIServerComponent] [TRACE:2] [USER-18] [] [ecid: 352c537d7893ee94:-5718ddd6:13aaccb7670:-8000-0000000000005c50] [tid: f650d700] [requestid: 45ca0005] [sessionid: 45ca0000] [username: joshua.l.manego.iii] -------------------- Sending query to database named Oracle Data Warehouse (id: <<1201371>>), connection pool named Oracle Data Warehouse Connection Pool, logical request hash edb0c7c0, physical request hash 87553d2a: [[
    select sum(D1.c1) over (partition by D1.c4, D1.c2) as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    sum(D1.c5) over (partition by D1.c6, D1.c4, D1.c2) as c5,
    D1.c6 as c6
    from
    (select count(T84444.ORDER_WID) as c1,
    T67365.CUST_VALUE_NAME as c2,
    T157680.NAME as c3,
    T157680.INTEGRATION_ID as c4,
    sum(T84444.ORDER_NRC) as c5,
    T67058.OPTY_O_REVN as c6
    from
    W_OPTY_D T67058 /* Dim_W_OPTY_D */ ,
    W_PARTY_ORG_D T67365,
    W_ORDER_F T84444 /* Fact_W_ORDER_F */ ,
    W_PARTY_D T157680
    where ( T67058.ROW_WID = T84444.OPTY_WID and T67365.ROW_WID = T157680.PARTY_ORG_WID and T84444.CUSTOMER_WID = T157680.ROW_WID )
    group by T67058.OPTY_O_REVN, T67365.CUST_VALUE_NAME, T157680.NAME, T157680.INTEGRATION_ID
    ) D1
    order by c4, c6
    Below is the physical SQL that uses 2 Database
    select T68071.QUOTE_NUM as c1,
    T116081.CURRENT_BASE_POSTN as c2,
    T66755.PER_NAME_MONTH as c3,
    T68071.STATUS_I as c4,
    T68071.QUOTE_TYPE_I as c5,
    T68071.SUB_TYPE_I as c6,
    T84523.ROW_WID as c7
    from
    W_POSITION_D T74722 /* Dim_W_POSITION_D */ ,
    W_QUOTE_D T68071 /* Dim_W_QUOTE_D */ ,
    W_QUOTE_F T84523 /* Fact_W_QUOTE_F */ ,
    W_DAY_D T66755 /* Dim_W_DAY_D_Common */ ,
    W_POSITION_DH T116081 /* Dim_W_POSITION_DH_Position_Hierarchy */
    where ( T66755.ROW_WID = T84523.OPEN_DT_WID and T68071.ROW_WID = T84523.QUOTE_WID and T74722.ROW_WID = T84523.PR_EMP_POS_WID and T74722.ROW_WID = T116081.POSITION_WID and T84523.PR_EMP_POSTN_DH_WID = T116081.ROW_WID )
    order by c7
    [2012-10-30T11:51:42.000+00:00] [OracleBIServerComponent] [TRACE:2] [USER-18] [] [ecid: 352c537d7893ee94:-5718ddd6:13aaccb7670:-8000-0000000000005cb8] [tid: f61fc700] [requestid: 45ca0007] [sessionid: 45ca0000] [username: joshua.l.manego.iii] -------------------- Sending query to database named OLAP_OBIEE (id: <<1204144>>), connection pool named Connection Pool, logical request hash c180fd3b, physical request hash a2e8b0d6: [[
    select T315910.NIVEL_APPROVACAO as c1,
    T315910.ALCADA_DESCONTO as c2,
    T315910.ROW_WID as c3
    from
    W_QUOTEITEM_F T315910
    order by c3
    Based on what you said, so it is impossible to merge the physical SQL if we use 2 Database right?
    Your effort in answering to my question is much appreciated, Thank you.

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Container generating invalid SQL for mysql

    Apparently sunone's container is putting double quotes around the table names and field names in the SQL in generates for CMP entities beans. MySQL is not happy about this. Is there someway to deal with this? Has anyone else who is using MySQL run across this yet ?

    You can configure S1AS 7.0 to support Transparent Persistence with MySQL by doing the following:
    1. Create a file named .tpersistence.properties, residing in the current working directory of the S1AS instance. This will allow you to override the default Persistence Manager settings for the MySQL database.
    For example, create the file $AS_INSTALL/domains/domain1/server1/config/.tpersistence.properties containing the following:
    database.mysql.QUOTE_CHAR_END=\
    database.mysql.QUOTE_CHAR_START=\
    database.mysql.RTRIM=
    database.mysql.RTRIM_POST=
    2. Restart the Sun ONE AS 7.0 instance.
    Regards,
    Chris Drake

  • Query for counts of all_objects

    Oracle 11.2.0.1
    I have to generate the count of all types of objects in below style.
    USERNAME     TABLES          INDEXES          MVS          PROCEDURES     FUNCTIONS     CLUSTER     
    USER1              10                   5            1                  20             5
    USER2                                2
    USER3                                                                 10
    TOTAL               10                5           3                     20               5           10Here count of all_objects should match with sum of total column i.e. 10+5+3+20+5+10.      
    Kindly help me, how do I generate above output.
    Thank you.

    SET        FEEDBACK        OFF
    SET        PAGESIZE        0
    spool c:\dynamic_pivot_subscript.sql
    SELECT     DISTINCT
       ',      COUNT (CASE WHEN object_type = '''
    || object_type
    || ''' '   AS txt1
    ,  'THEN 1 END)    AS "'
    || object_type
    || '_CNT"'  AS txt2
    FROM all_objects
    ORDER BY   txt1;
    SPOOL OFF;
    I opened c:\dynamic_pivot_subscript.sql and removed first and last lines.
    break on report
    select 'compute sum of "' || object_type || '_CNT" on report'
    from all_objects
    group by object_type
    I just executed above lines which I got as query output.
    SET LINE 1000;
    compute sum of "TOTAL" on report
    COLUMN OWNER FOR A20;
    SET        FEEDBACK        ON
    SET        PAGESIZE        50
    spool c:\dynamic_pivot.lst
    SELECT OWNER
    @@c:\dynamic_pivot_subscript.sql
    ,COUNT(*) "TOTAL"
    FROM ALL_OBJECTS
    GROUP BY OWNER
    ORDER BY OWNER
    /Source:Frank's dynamic pivot @ Re: Report count and sum from many rows into many columns
    Regards
    Girish Sharma

  • Invalid SQL Query with DBMS_JOB.SUBMIT inside

    Probably a simple thing, but I can't seem to find the problem in here. I get an error that INVALID SQL STATEMENT. I guess I'm messing something up with the lots of ' chars. If anyone could point out where did I failed I'd be really grateful.
    create or replace
    trigger TR_REFRESH_SCHEMAS
      after create or alter
      on schema
    declare
      tableName         user_tables.table_name%TYPE;
      table_count       number(2);
    begin
      select ora_dict_obj_name
      into tableName
      from dual;
      select  count(table_name)
      into    table_count
      from    user_tables
      where   table_name = tableName;
      if (table_count != 0) then
        execute immediate
          'BEGIN'                     ||
            'DBMS_JOB.SUBMIT'         ||
            '('                       ||
              'job        => '        || table_count      || ','        ||
              'what       => '        || 'INSERT_SCHEMA(' ||  tableName || ');,' ||
              'next_date  => '        || sysdate          || ','        ||
              'interval   => '        || null             ||
            ');'                      ||
          'END;'                      ||
          'COMMIT;'
      end if;
      exception
        when no_data_found then
          raise_application_error(-20020, 'Table ' || tableName || ' not found!');
        when others then
          raise_application_error(-20002, 'Error (' || SQLCODE || '): ' || SQLERRM);
    end;

    I've tried all your recommendations without any success.
    For the dbms_output.put_line:
    - I've found there was a problem with the interval => null. In the final statement it looked like: DBMS_JOB.SUBMIT(1, INSERT_SCHEMA(TEST), 2012-08-31...., ); obviously wrong. Since the default value of interval is NULL I've taken out that parameter.
    For the formatting:
    - Thanks for pointing that out! It was surely a problem with that part, as I've seen when printing the statement.
    execute immediate
          'BEGIN '                    ||
            'DBMS_JOB.SUBMIT'         ||
            '('                       ||
              'job        => '        || table_count        || ','        ||
              'what       => '        || 'INSERT_SCHEMA(''' ||  tableName || ''');,' ||
              'next_date  => '        || sysdate            ||
            ');'                      ||
          'END;'
        );With the qnotation:
    - I get an immediate syntactical error when inserting your code right at the second 'q{' part. On the other hand the first parameter: job is a number type so to_char is meaningless in my opinion.
    The result so far for a CREATE TABLE statement:
    Error starting at line 1 in command:
    create table TESTING
      id varchar2(20) not null,
      text number(8),
      dat blob,
      creat_e date
    Error at Command Line:1 Column:0
    Error report:
    SQL Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-20002: Error (-6550): ORA-06550: line 1, column 77:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
       . ( ) , * % & = - + < / > at in is mod remainder not rem
       <an exponent (**)> <> or != or ~= >= <= <> and or like like2
       like4 likec between || multiset member submultiset
    The symbol ";" was ignored.
    ORA-06550: line 1, column 102:
    PLS-00103: Encountered the symbol "-" when expecting one of the following:
       <an identifier> <a double-quoted delimited-identifier>
       current delete exists prior
    Th
    ORA-06512: at line 32
    00604. 00000 -  "error occurred at recursive SQL level %s"
    *Cause:    An error occurred while processing a recursive SQL statement
               (a statement applying to internal dictionary tables).
    *Action:   If the situation described in the next error on the stack
               can be corrected, do so; otherwise contact Oracle Support.

Maybe you are looking for

  • SQL query statement  for stored procedure / function listing ...

    Hi everyone, Is there a SQL query to list all the stored procedures and functions of an user in an Oracle 8 database? I have this idea: select * from USER_SOURCE where TYPE = 'PROCEDURE' or TYPE = 'FUNCTION' but I am not too sure whether this is corr

  • Jagged edges on rotated picture boxes

    It seems as though it's a bug. As I rotate imported images the outer edge and hard edges in the actual images are noticably jagged. As in the example. Any suggestions?

  • Including hidden items in File Export?

    Gday, It seems not that I have my export button working I am having issues with exporting hidden columns? I have the PLSQL Expression set to apex_application.g_excel_format = TRUE but the columns still aren't showing up in the export? The odd thing i

  • Illustrator cs6 64bits and bridge 64 bits can't start since last update on windows 8

    Hi, I have windows 8 64bits on a clean install, I've installed Creative cloud (clean install) and works fine, until last Creative Cloud update. Now Illustrator and bridge 64 bits cant't start. I see a message just says "Illustrator stop working" whil

  • User Contributed Tips in the AirPort AirPort Express Forum

    *The following User Contributed Tips are located in the AirPort > AirPort Express Forum:* adsfushi72 - Can an AirPort Express work with my 3rd-party wireless router? http://discussions.apple.com/thread.jspa?threadID=2629540 Publish date: October 28,