Problem with a group of query

Hi all

My sql query tries to return the number of clients with their points total in some predefined intervals, so I created a table with the interval id and a threshold indicating the minimum threshold.
Customer table:
   client         Total points

client1        3
client2        15
Client 3       47
..


Table of interval:
   id     threshold      label
1      0                between 0 and 4 points
2      5                between 5 and 19 points
3      20              between 20 and 100 points
My sql query looks like this:
  SELECT  
  max(interval.id),
  count(*)
 
    FROM clients, intervals 
    WHERE Total points >= interval.threshold group by max 1
  
the problem is that this query returns the cumulative account, that is, all clients are considered in the interval from 0 (0-> 4points) and all those who have more than 5 points are in the range 2 and so on...

I do not know the DB with this select,
any help is appreciated

Thank you

Check out my post published on...

Tags: Database

Similar Questions

  • Problem with insertChildXML, deleteXML, XMLTable query

    Hello

    I'm working on a

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, Real Application Clusters, Automatic Storage Management, OLAP,.

    Options of Data Mining and Real Application Testing

    POWER SUPPLY 11.2.0.3.10

    I have a table with an XMLTYPE field.

    In this area, I insert an object XMLType in this way:

    INSERT INTO t_schedule_alert (id_schedule_alert, id_schedule, i_type_alarm_schedule, id_lang_type_alarm_schedule, id_user, x_alert_type, i_status_schedule_alert, id_lang_status_schedule_alert)

    VALUES (sq_id_schedule_alert.nextval, in_id_schedule, in_i_type_alarm_schedule, 1, id_user_, xml_, ln_schedule_st_alert_waiting, 1)

    RETURN id_schedule_alert INTO id_;

    Where xml_ = XMLtype ("< alert_types >" | ") alert_type_config_ | ("< / alert_types > ') and alert_type_config_ = ' < type > email < / Type > < sms type > < / type > ';

    The insert does not work correctly, infact him select query:

    SELECT MAX (s.id_schedule_alert) id_schedule_alert,
    s.id_schedule,
    s.id_user,
    s.i_type_alarm_schedule,
    Max (s.type_alarm_schedule) type_alarm_schedule,
    Max (s.i_status_schedule_alert) i_status_schedule_alert,
    Max (s.status_schedule_alert) status_schedule_alert,
    Max (s.id_data) id_data,
    Max (decode (his. TYPE_, 'sms', 1, 0)) sms,.
    Email Max (decode (his. TYPE_, 'email', 1, 0))
    Max (decode (his. TYPE_, 'event', 1, 0)) event.
    Expedition Max (decode (his. TYPE_, 'dispatch', 1, 0))
    OF v_schedule_alert s.
    XMLTable ('/ alert_types/type ')
    in passing s.x_alert_type
    path of varchar2 (10) columns type_ "text()".
    ) its
    WHERE s.id_schedule =: b1
    AND s.id_user =: b2
    GROUP OF s.id_schedule, s.id_user, s.i_type_alarm_schedule;

    Works very well in showing me the email = 1 sms = 1, event = 0, = 0 shipping.

    Then, using this function to manipulate the XML:

    -function update_alert

    FUNCTION update_alert)

    in_id_schedule in NUMBERS

    in_i_type_alarm_schedule in NUMBERS

    iv_alert_type IN VARCHAR2,

    in_id_user in NUMBERS

    in_action in NUMBERS

    ) RETURN NUMBER

    IS

    id_user_ NUMBER;

    alm_exists_ NUMBER;

    XMLType count_;

    BEGIN

    IF in_id_schedule IS NULL or in_i_type_alarm_schedule IS NULL or iv_alert_type IS NULL or in_action IS NULL THEN

    raise_application_error (pk_global.not_enough_param, pk_global.not_enough_param_text);

    END IF;

    id_user_: = in_id_user;

    IF id_user_ IS NULL THEN

    id_user_: = pk_security.who_am_i;

    END IF;

    -update of configuration for the user, add / or remove

    IF in_action = 0 THEN

    -delete if this is the last of them

    XMLQuery ('SELECT count($XML/alert_types/descendant::*)'

    by passing s.x_alert_type as 'XML' content of return)

    IN count_

    OF s t_schedule_alert

    WHERE s.id_schedule = in_id_schedule

    AND s.id_user = id_user_

    and i_type_alarm_schedule = in_i_type_alarm_schedule;

    IF to_number (count_.getstringval ()) > 1 THEN

    UPDATE t_schedule_alert

    SET x_alert_type = deleteXML)

    x_alert_type,

    ' / alert_types/type [text () =' ' | iv_alert_type |] » »] »

    )

    WHERE id_schedule = in_id_schedule

    AND i_type_alarm_schedule = in_i_type_alarm_schedule

    AND id_user = id_user_;

    END IF;

    ELSIF in_action = 1 THEN

    -Add if not exists

    SELECT CASE WHEN XMLExists (' $ alert_types/XML/type [text () = $ALM]' from x_alert_type as 'XML', iv_alert_type as 'ALM')

    THEN 1 ELSE 0 END exists_

    IN alm_exists_

    OF v_schedule_alert

    WHERE id_schedule = in_id_schedule

    AND id_user = id_user_

    AND i_type_alarm_schedule = in_i_type_alarm_schedule;

    IF alm_exists_ = 0 THEN

    UPDATE t_schedule_alert

    SET x_alert_type = insertChildXML)

    x_alert_type,

    ' / alert_types', 'type ',.

    "< type >" | iv_alert_type | ' < / type > '

    )

    WHERE id_schedule = in_id_schedule

    AND id_user = id_user_

    AND i_type_alarm_schedule = in_i_type_alarm_schedule;

    END IF;

    END IF;

    RETURN THE NUMBER OF ROWS SQL %;

    END;

    As soon as I delete the sms type:

    declare

    ID_ number;

    Start

    ID_: = pk_schedule_alert.update_alert (: b1,: b2, "sms",: b3, 0);

    end;

    The select above does not return anything and the simpler query:

    Select *.

    FROM xmltable ('/ alert_types/type ')

    from (select x_alert_type in the t_schedule_alert where id_schedule =: = b1 and i_type_alarm_schedule: b2)

    "path of columns type_ varchar2 (10) ' / text()".

    ) sa;

    0 records returned.

    Although the field of XMLtype:

    "< alert_types >".

    Email from < type > < / type >

    "< / alert_types >.

    If I add more once the type of sms:

    declare

    ID_ number;

    Start

    ID_: = pk_schedule_alert.update_alert (28.2, "sms", 12034, 1);

    end;

    The main query returns 1 for sms and 0 for the event by e-mail if the xml field contains:

    "< alert_types >".

    Email from < type > < / type >

    < type > text < / type >

    "< / alert_types >.

    and the query:

    Select *.

    FROM xmltable ('/ alert_types/type ')

    from (select x_alert_type in the t_schedule_alert where id_schedule =: = b1 and i_type_alarm_schedule: b2)

    "path of columns type_ varchar2 (10) ' / text()".

    ) sa;

    reutrns 1 record, sms

    It seems that the crux of e-mail will be damaged some how by the removal of the sms you.

    If I build the XML with sms, event and email node and delete the node of sms I have sms = 0, email = 0, event = 1 even if the xml field contains:

    "< alert_types >".

    Email from < type > < / type >

    event < type > < / type >

    "< / alert_types >.

    I can't find the cause.

    Hope to be clear enough and that you can help me.

    Thanks in advance,

    Samuel

    Thanks, now I can reproduce.

    XQuery Update has the problem too:

    SQL > select id, column_value

    t_temp_xml 2,

    3 xmltable ('/ alert_types/type ' from config)

    4 where id = 1;

    ID COLUMN_VALUE

    ---------- --------------------------------------------------------------------------------

    1 sms

    1 e-mail

    SQL >

    SQL > update t_temp_xml

    2 set config = (xmlquery

    3                'copy $d := . Edit)

    4 remove the node $d/alert_types/type[.="sms"])

    5 return $from

    6 passage config

    7 content of return

    8               )

    9 where id = 1;

    1 line update

    SQL >

    SQL > select id, column_value

    t_temp_xml 2,

    3 xmltable ('/ alert_types/type ' from config)

    4 where id = 1;

    ID COLUMN_VALUE

    ---------- --------------------------------------------------------------------------------

    Still another problem with the rewrite of XQuery I guess.

    This works if you use the NO_XML_DML_REWRITE flag:

    SQL > rollback;

    Complete restoration

    SQL >

    SQL > UPDATE / * + no_xml_dml_rewrite * / t_temp_xml

    2 SET config = deleteXML (config, ' / alert_types/type [. = "sms"]')

    3 WHERE id = 1;

    1 line update

    SQL >

    SQL > select id, column_value

    t_temp_xml 2,

    3 xmltable ('/ alert_types/type ' from config)

    4 where id = 1;

    ID COLUMN_VALUE

    ---------- --------------------------------------------------------------------------------

    1 e-mail

    This should be reported to Oracle's Support.

    Maybe it's already fixed in paragraph 12.1, can't check at the moment.

  • Problem with tab groups

    So I decided to try the groups to tabs, because I had never actually used the feature before. Now, every time I open Firefox the tab or tabs that belonged to the Group of open again. How can I stop this?

    Hello

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

    Thank you.

  • Problem with AP group.

    I got to set up the subnet via radio.

    We have 32 buildings - all buildings are in their own ip address range and subnet.

    I have read cisco ap group instructions...  I'm missing something... Maybe the concept of its operation.

    We have a SSID for University - Let's say SSID - College

    Under College - we would like to see the ip address range and subnet under each building.  32 buildings with various number of AP.

    Problem is that I'm even old address ip under Gallaudet even I already put in place the various dhcp scope...

    How to troubleshooot who?

    WCS and WLC are on the latest version

    -Allen-

    Hi Allen.

    Configuration of the AP groups.

    -Create all interfaces of controller/interfaces of each building.

    -Create the SSID; in your case 'college', the interface that you attached to this SSID initially is not relevant if you are using AP group. For example, use the interface to the building where is the WLC.

    -Create groups of AP; You must create a group for each building and map the College SSID to the interface to which belongs the building. Record.

    -Finally, fix the Ap´s which belongs to this building to each group of AP.

    The AP´s then reboot and only the ssid of the College will be published mapping their traffic to the interface you select AP-groups.

    If you move from one building to another, the IP address is maintained that even if you are in a different subnet (WLC this traffic tunnels) If you disconnected, then reconnect you wil acquire an IP address that belongs to the network of the building you are.

    You can see in the interface chart in the clients IP address, the trap associated with you and if your traffic is "tunnel" because you come from another subnet.

    Best regards.

  • Problem with logic groups combining data at the point of importation

    I really hope that you will be able to help me with a problem I've had for the last few days.

    The scenario I have requires a logical group be created as the source data must be mapped differently if its + ve or - ve even thought the source account is the same.

    I created a logical group complex and added the corresponding logical group account in the account mapping table. The group uses the definition of rule 001806 *.

    The accounts that would be affected by this rule are below the values:
    18060000 - 2093096.69
    18060000 2093096.69
    18060005 - 2474955.48
    18060005 2474955.48
    18060015 11319512.13
    18060015-8000000 (a PEAK partner)
    18060015 - 3319512.13 (a PEAK partner)

    The + ve values need to go to an asset account and the values of ve - to a liability account.

    At the stage of import, I have a zero value which seem to be the sum of the values of the first 4, substantive values 3 then appear on individual lines.

    Step validate the asset HFM account displays the 3 + values of ve (15.8 M) Although 2 of them apparently wide net to zero with the values of the first and the third - ve. However, the liability account shows the background raising 2 (11. 3 m) as its missing the other 2 values - ve. Assets and liabilities HFM values should be the same

    In the account mapping, I'm using the following script for the + ve (its been reformatted for this forum):
    ' If varValues (9) > '0' Result = "BSA401000" Else Result = "Ignore" End If

    The script - ve is:
    ' If varValues (9) < "0" Result = "BSL625600" Else Result = "Ignore" End If

    I later changed the logical group to be Simple, but I get a similar result, although what I am trying to reach seems to be detailed in the Administrator's Guide FDM under the heading create accounts within Simple logic groups

    I understand that it is a little lengthy so apologies if you need more information, then please let me know and I will happy to provide more

    Thank you, James

    You could even put in place two mapping rules and avoid the complexity of a logic rule, if you wish. The mapping will continue to the next line if it does not meet the criterion, and there is no result.

    Side assets would be with a name of rule vAsset (you can change this, but it must be unique to the next line)
    If varValues (9) > 0 then result = "BSA401000."

    and then you add a second line to your card with a name of vLiab rule and check the sign flip.

    If varValues (9)< 0="" then="" result="BSL6256002">

    In the past I have avoided the rules of logic to the extent possible, by adding removes the ability to drill holes in the source file.

    Concerning
    JOINT TASK FORCE

  • Someone had problems with the Group Me app?

    After you download this app and sync my contacts, I have an unknown person in my list of contacts that the person is in my address book.  I do not know this person and I couldn't get a response from the Group Me support app, and their page url does not exist.  Support people sent me a generic email and told me how to remove a member, but I have been unable to solve the problem of the way that they describe. Now, I can't get rid of that person.  I am afraid that they have access to all my contact information now.

    https://help.groupme.com/HC/en-us/community/topics is the community for the App... it doesn't seem that there's a lot of traffic

    I would normally ask here, but the number of post on the homepage is VERY low

    It belongs to the family of 'Skype' products owned ultimately by Microsoft

  • Enable ASA 9.1 problems with tunnel-group-list

    Hello!

    I try to get a working configuration where the Cisco VPN / DTLS phones VPN connect, while allowing access remotely via client AnyConnect of PCs.  I have two groups of tunnel and configured for this purpose of group policy and use Group-URL.

    Phones are connect very well, but I don't get the drop down menu to choose between the two groups of tunnel when connecting to a remote computer.

    An excerpt from the config.

    Moreover, I had the menu work previously when I used group instead of group-URL aliases.  However, the phones seem to require the URL group.  Now that I have those configured, the menu does not work.  If I get the full URL in the AnyConnect window, both URLs work, and I can connect.

    Thank you in advance for any suggestions you may have!

    Deb

    WebVPN

    allow outside

    AnyConnect image disk0:/anyconnect-win-2.5.2014-k9.pkg 1

    AnyConnect image disk0:/anyconnect-macosx-i386-2.5.2014-k9.pkg 2

    AnyConnect image disk0:/anyconnect-linux-2.5.2014-k9.pkg 3

    AnyConnect enable

    tunnel-group-list activate

    ABC Group-Policy internal

    ABC Group Policy attributes

    value of server WINS 10.10.16.17 10.10.16.12

    value of 10.10.16.17 DNS server 10.10.16.12

    VPN - connections 3

    SSL VPN-tunnel-Protocol l2tp ipsec client ssl clientless

    Split-tunnel-policy tunnelall

    field default value abc.com

    the address value AnyConnectPool pools

    WebVPN

    activate AnyConnect ssl dtls

    AnyConnect Dungeon-Installer installed

    time to generate a new key ssl AnyConnect 1440

    AnyConnect ssl generate a new method ssl key

    AnyConnect client of dpd-interval 5

    dpd-interval gateway AnyConnect 30

    AnyConnect ask none

    internal strategy of group ABC - STG

    ABC - STG group policy attributes

    value of server DNS 8.8.8.8

    VPN - connections 3

    SSL VPN-tunnel-Protocol l2tp ipsec client ssl clientless

    Split-tunnel-policy tunnelspecified

    Split-tunnel-network-list value Split-Tunnel-encrypt-ACL

    field default value abc.com

    the address value AnyConnectPool pools

    WebVPN

    activate AnyConnect ssl dtls

    AnyConnect Dungeon-Installer installed

    time to generate a new key ssl AnyConnect 1440

    AnyConnect ssl generate a new method ssl key

    AnyConnect client of dpd-interval 5

    dpd-interval gateway AnyConnect 30

    AnyConnect ask none

    type tunnel-group Split-Tunnel-Group remote access

    attributes global-tunnel-group Split-Tunnel-Group

    address pool AnyConnectPool

    Group Policy - by default-ABC-STG

    tunnel-group Split-Tunnel-Group webvpn-attributes

    allow group-url https://asa.abc.com/ABC-STG

    tunnel-group ABC - Tunnel - type remote access Group

    attributes global-tunnel-group ABC - Tunnel - Group

    address pool AnyConnectPool

    Group-ACTIVE DIRECTORY authentication server

    Group Policy - by default-ABC

    password-management

    ABC - Tunnel tunnel-group - webvpn-attributes Group

    allow group-url https://asa.abc.com/ABC

    Hello

    You can have group-alias and group-url at the same time in the configuration so that the phones can connnect with Group-url and users can click on the drop down menu to select the right connection profile.

    tunnel-group webvpn-attributes
    Group-alias enable
    Group-url help

    Ref:- http://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/98580-enable-group-dropdown.html

    Kind regards
    Dinesh Moudgil

    PS Please rate helpful messages.

  • Problem with the group items

    Hello world. Thank you for taking the time to look over my examples.

    I can't group items with XSL.

    Entry XML code:
    < country >
    < info enum = "CTRY" name = 'United States' States-total = "50" / >
    < enum info = 'ST' name = 'New York' population = "8 244 910" / >
    < enum info = 'ST' name = 'Chicago' population = "2 707 120" / >
    < info enum = "CTRY" name = 'Germany' States-total = "16" / >
    < enum info = 'ST' name = 'Berlin' population = "3 469 910" / >
    < enum info = 'ST' name = 'Brandenburg' population = "2 500 000" / >
    < / country >
    ------------------------------------------------------------------------------------------
    My XSL:
    < xsl: template match = "/" >
    < country >
    < xsl: for-each select = "Country/info" >
    "< xsl: if test="@enum='CTRY "" > "
    < CountryInfo >
    < name > country: < xsl: value-of select="@name"/ > < / name >
    "districts of <>< xsl: value-of select="@total-states "> < / xsl: value-of > < / districts >
    < xsl: for-each select = "info/country /" >
    "< xsl: if test="@enum='ST "" > "
    < State >
    < stateName > state name: < xsl: value-of select="@name"/ > < / stateName >
    < statePop > State Population: < xsl: value-of select="@population"/ > < / statePop >
    < / state >
    < / xsl: if >
    < / xsl: foreach >
    < / CountryInfo >
    < / xsl: if >
    < / xsl: foreach >
    < / country >
    < / xsl: template >

    My unwanted result:
    < country >
    < CountryInfo >
    < name > country: United States of America < / name >
    < > 50 districts < / districts >
    < State >
    < stateName > name of the State: New York < / stateName >
    < statePop > State Population: 8 244 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Chicago < / stateName >
    < statePop > State Population: 2 707 120 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Berlin < / stateName >
    < statePop > State Population: 3 469 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Brandenburg < / stateName >
    < statePop > State Population: 2 500 000 < / statePop >
    < / state >
    < / CountryInfo >
    < CountryInfo >
    < name > country: Germany < / name >
    < > 16 districts < / districts >
    < State >
    < stateName > name of the State: New York < / stateName >
    < statePop > State Population: 8 244 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Chicago < / stateName >
    < statePop > State Population: 2 707 120 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Berlin < / stateName >
    < statePop > State Population: 3 469 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Brandenburg < / stateName >
    < statePop > State Population: 2 500 000 < / statePop >
    < / state >
    < / CountryInfo >
    < / country >
    ---------------------------------------------------------------------------------------
    ++++++++++++++++++++++++++++++++++++++++++++
    My other XSL:
    < xsl: template match = "/" >
    "< xsl: for each group-select =" Country/info"group-by="@enum ">
    < xsl: for each group-select = "current - group ()" group-by="@name" >
    "< xsl: if test="@enum='CTRY "" > "
    < country >
    < CountryInfo >
    < name > country: < xsl: value-of select="@name"/ > < / name >
    "districts of <>< xsl: value-of select="@total-states "> < / xsl: value-of > < / districts >
    "< xsl: for each group-select =" info/country / "group-by="@enum ">
    "< xsl: if test="@enum='ST "" > "
    < State >
    < stateName > state name: < xsl: value-of select="@name"/ > < / stateName >
    < statePop > State Population: < xsl: value-of select="@population"/ > < / statePop >
    < / state >
    < / xsl: if >
    < / xsl: for each group->
    < / CountryInfo >
    < / country >
    < / xsl: if >
    < / xsl: for each group->
    < / xsl: for each group->
    < / xsl: template >

    Other undesirable results:
    < country >
    < CountryInfo >
    < name > country: United States of America < / name >
    < > 50 districts < / districts >
    < State >
    < stateName > name of the State: New York < / stateName >
    < statePop > State Population: 8 244 910 < / statePop >
    < / state >
    < / CountryInfo >
    < / country >
    < country >
    < CountryInfo >
    < name > country: Germany < / name >
    < > 16 districts < / districts >
    < State >
    < stateName > name of the State: New York < / stateName >
    < statePop > State Population: 8 244 910 < / statePop >
    < / state >
    < / CountryInfo >
    < / country >
    +++++++++++++++++++++++++++++++++++++++++

    Expected result:
    < country >
    < CountryInfo >
    < name > country: United States of America < / name >
    < > 50 districts < / districts >
    < State >
    < stateName > name of the State: New York < / stateName >
    < statePop > State Population: 8 244 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Chicago < / stateName >
    < statePop > State Population: 2 707 120 < / statePop >
    < / state >
    < / CountryInfo >
    < CountryInfo >
    < name > country: Germany < / name >
    < > 16 districts < / districts >
    < State >
    < stateName > name of the State: Berlin < / stateName >
    < statePop > State Population: 3 469 910 < / statePop >
    < / state >
    < State >
    < stateName > name of the State: Brandenburg < / stateName >
    < statePop > State Population: 2 500 000 < / statePop >
    < / state >
    < / CountryInfo >
    < / country >

    If possible, how can I produce my desired given result XML entry code?
  • Duplicate an application: problems with security groups

    Hello

    In order to fix a problem (listed here Re: Migration of LCM: Calc scripts not available ), we need to duplicate a request (recreate but changing the name of the type of plan and on the same server)

    The whole process of creating the application (distinct name) went well, but when I try to import security using LCM, I received a message on the groups, it does not find.

    Import failed. Total - 43, success - 0 error Details - Impossible to import the access - group (groupname) not found, error-(nom d'utilisateur non valide trouvé dans le fichier.) details Could not import the access authorization-

    (Fault to import - error details - impossible to import access permissions - group not found - error details-

    Export security settings went well. I changed the XML, so the new app name, but still had the same problem.

    No idea where it might be?

    Thanks in advance!

    Do you have service users for the new Shared Services application.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Problem with PL/SQL insert query

    Hello to all the genius... Vikram im, Im new in the world of the apex and pl/sql... I need everything that you guys help... This is my first application user (for example)

    name of the table - form
    name of the column - f_no number, name varchar2, number of salary.
    Apex page n - p1_f_no, p1_name, p1_sal

    Now my problem is the query that is below works in the workshop of sql (insertion of data in the table in shape) and can be seen using the select query... but when I implement this in the apex... It shows - in all areas:

    declare
    v_no number (3);
    v_Name varchar2 (20);
    v_sal number (10);
    Start
    Insert in the form values (: v_no,: v_name,: v_sal);
    end;

    IM using this query in the Process button,

    Thank you

    -Best regards,.
    Vikram

    Mahir M. Quluzade have already responded.

    Published by: Gokhan Atil on 03.May.2011 12:45

  • Problem with SELECT IN the query

    Why am I always 0 for returnvalue in the following query?

    create or replace
    PACKAGE BODY AS MyPKG

    SelectCount PROCEDURE
    (
    returnValue OUT INTEGER
    )
    AS
    BEGIN

    SELECT COUNT (*) from myTable in returnvalue;
    IF (SQL ROWCOUNT % > = 1).
    THEN
    returnValue: = 1;
    ON THE OTHER
    returnValue: = 0;
    END IF;

    dbms_output.put_line ('returnvalue: ' | returnvalue);
    END SelectCount;
    END MyPKG;

    Hello

    Sorry, I didn;' t notice you had clauses in the wrong order.  The INTO clause comes before the FROM clause, like this:

    SELECT COUNT (*)

    in returnvalue

    FROM MyTable;

  • BBM BBM groups - problem with lists and complete / incomplete

    Was wondering if anyone else has this problem with BBM group lists.
    The two 10.2.1.3175 OS running on a Z10 (MTS) and 10.2.1.3247 (Rogers)
    BBM version 10.3.33.18

    BES 10.2.0.33

    Create a new group and add a list to the group. Add a number of items and when you hit the audit to complete / incomplete, it often checks / unchecks a 2nd independent element.

    I tested on 3 different devices / users so don't think it's my BB ID.

    Can anyone else duplicate?

    This problem makes it absolutely useless lists for me now because I use mainly for shopping lists, and if I check the items that I acquired and the fact, I obviously Miss things on my list.

    (Note: I have an ID for test on an iPhone with BBM for iOS and it does not seem to meet this problem)

    Probably a bug in BBM. We cannot do that until they update nothing BBM. There are other bugs in there also we expect on patches for.

  • Problem with connecting to Essbase

    Hello

    We have recently updated to 11.1.2.4

    Since that time we see some questions intermittently while trying to connect.

    We use a user admin native directory connect you to MAXL to run scripts. This keeps failing in between and then if we're going to restart the job, it runs without any problems.

    We have checked through the SharedServices_Security_Client.log and found that, around the same time of the failure, there are a few mistakes here.

    Construction of the cache is for providers, has now begun to unify the cache. It is a status messages. No action required.

    Has failed to unify the Group cache. NULL. Refer to the log file security of the Shared Services for more details.


    Does anyone has any ideas on this.

    Do you think that the problem is related to the connection attempt to time to "unify the cache?

    I think that we have a framework to refresh Group cache every 60 minutes. is it a good idea to change that at one time in a day interval

    Thank you.

    Tom Thomas

    Usually it is not a problem with Aboriginal groups unless there is a huge amount, CSS JVM info is on https://blogs.oracle.com/pa/entry/epm_11_1_2_how1

  • problem with bind variables in the SQL query view object

    Hi all

    I use JDev 11.1.2.4.0.

    I have a problem with bind variables in the SQL query view object.

    This is my original SQL

    SELECT sum(t.TIME) , t.legertype_id
    FROM LEDGER t
    WHERE t.nctuser_id = '20022' 
          AND to_char(t.insertdate,'YYYYMMDD') in ('20130930','20130929')
    group by t.legertype_id
    

    In my view .xml object query tab, I am writing this

    SELECT sum(t.TIME) , t.legertype_id
    FROM LEDGER t
    WHERE   t.nctuser_id = '20022'
        AND to_char(t.insertdate,'YYYYMMDD') in :dddd
    group by t.legertype_id
    

    Davis here is a variable of Type liaison: String, updatable and necessary.

    I try to deal with Davis as ('20130930 ', ' 20130929') hoping the view object, run as my original SQL.

    But failed. The view object retrieves 0 line after that I run.

    Why?

    Thank you! ('2original SQL0130930', '20130929') ('20130930 ', ' 20130929')

    A variable binding cannot be used as this is why you must use years table. Check decompilation binary ADF: using oracle.jbo.domain.Array with ViewCriteria to see a solution.

    Timo

  • Need help in the optimization of the query with the Group and joins by clause

    I'm having the problem by running the following query... It takes a lot of time. To simplify, I added the two tables FILE_STATUS = stores the file load details and COMM table Board table job showing records treated successfully and which was communicated to the other system real. Records with status = T is trasnmitted to another system and traansactions with P is waiting.
    CREATE TABLE FILE_STATUS
    (FILE_ID VARCHAR2(14),
    FILE_NAME VARCHAR2(20),
    CARR_CD VARCHAR2(5),
    TOT_REC NUMBER,
    TOT_SUCC NUMBER);
    
    CREATE TABLE COMM
    (SRC_FILE_ID VARCHAR2(14),
    REC_ID NUMBER,
    STATUS CHAR(1));
    
    INSERT INTO FILE_STATUS VALUES ('12345678', 'CM_LIBM.TXT', 'LIBM', 5, 4);
    INSERT INTO FILE_STATUS VALUES ('12345679', 'CM_HIPNT.TXT', 'HIPNT', 4, 0);
    
    INSERT INTO COMM VALUES ('12345678', 1, 'T');
    INSERT INTO COMM VALUES ('12345678', 3, 'T');
    INSERT INTO COMM VALUES ('12345678', 4, 'P');
    INSERT INTO COMM VALUES ('12345678', 5, 'P');
    COMMIT;
    Here's the query I wrote to give me the details of the file that has been loaded into the system. He reads the table of State and the commission files to display the name of the file, total records loaded, total at the table of the commission and the number of records which has finally been passed successfully loaded (Status = T) with other systems.
    SELECT 
        FS.CARR_CD 
        ,FS.FILE_NAME 
        ,FS.FILE_ID
        ,FS.TOT_REC
        ,FS.TOT_SUCC
        ,NVL(C.TOT_TRANS, 0) TOT_TRANS
    FROM FILE_STATUS FS
    LEFT JOIN
    (
        SELECT SRC_FILE_ID, COUNT(*) TOT_TRANS
        FROM COMM
        WHERE STATUS = 'T'
        GROUP BY SRC_FILE_ID
    ) C ON C.SRC_FILE_ID = FS.FILE_ID
    WHERE FILE_ID = '12345678';
    In production, this request has several joins and takes a long time to deal with... the main culprit for me is the join on the COMM table to count the number of number of transactions sent. Please can you give me tips to optimize this query to get results faster? What I need to delete the Group and use the partition or something else. Help, please!

    Don't know if it will be faster based on the information provided, but analytical functions offer an alternative approach;

    select carr_cd, file_name, file_id, tot_rec, tot_succ, tot_trans
      from (select fs.carr_cd,
                   fs.file_name,
                   fs.file_id,
                   fs.tot_rec,
                   fs.tot_succ,
                   count(case
                            when c.status = 'T' then
                             1
                            else
                             null
                          end) over(partition by c.src_file_id) tot_trans,
                   row_number() over(partition by c.src_file_id order by null) rn
              from file_status fs
              left join comm c
                on c.src_file_id = fs.file_id
             where file_id = '12345678')
     where rn = 1;
    
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS
    ------- -------------------- -------------- ---------- ---------- ----------
    LIBM    CM_LIBM.TXT          12345678                5          4          2
    

Maybe you are looking for