query returns different results depends on the length of the day

Hello!

I have a query:

INSERT /*+ APPEND */ INTO pwa_process (
id,
id_session,
id_customer,
s2k_account,
service_seq_num,
msisdn,
id_tariff,
contract_end_date,
last_contract_date,
next_available_contract_date,
tariff_name,
description,
description_long,
imei_old,
activation_date,
id_customer_number,
arpu,
value0,
value1,
value2,
value3,
value4,
value5,
id_pricing_plan)
WITH msisdns AS (SELECT msisdn ms FROM customer_number cn
JOIN customer_s2kaccount cs ON cn.s2k_account = cs.s2k_account AND cs.id_customer = v_customerId)
SELECT
seq_pwa_process.NEXTVAL,
v_sessionId,
customer_s2kaccount.id_customer,
customer_s2kaccount.s2k_account,
customer_number.service_seq_num,
msisdn.msisdn,
tariff.id,
NVL(CASE WHEN date_contract_end IS NULL AND le_contract_end_date IS NOT NULL OR (date_contract_end < le_contract_end_date)
         THEN le_contract_end_date
         ELSE NVL(date_contract_end, ADD_MONTHS(customer_number.date_start, customer_number.ada_availability))
    END, TO_DATE('01.01.1970', 'DD.MM.YYYY')) contract_end_date,
CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation >      (CASE WHEN ada_priority = 1 THEN ada_date_pwa
        WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
        THEN exchange_date 
        ELSE date_pwa 
  END) 
     THEN customer_number.date_first_activation
     ELSE   (CASE WHEN ada_priority = 1 THEN ada_date_pwa
        WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
        THEN exchange_date 
        ELSE date_pwa 
  END) 
END last_contract_date,
ADD_MONTHS(CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation > NVL(  (CASE WHEN ada_priority = 1 THEN ada_date_pwa
        WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
        THEN exchange_date 
        ELSE date_pwa 
  END) ,
                                                                                                                       NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)))
                THEN customer_number.date_first_activation
                ELSE NVL(  (CASE WHEN ada_priority = 1 THEN ada_date_pwa
        WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
        THEN exchange_date 
        ELSE date_pwa 
  END) , NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)))
           END, customer_number.ada_availability - DECODE(NVL(customer_number.current_contract_type, 0), 2, DECODE(customer_number.reduced_contract_used, 0, NVL(customer_number.el_contract_calculated_reduc,0), 0), 0)) next_available_contract_date,
tariff.name_ada,
DECODE(msisdn_group.def_column, 0, msisdn.value0, 1, msisdn.value1, 2, msisdn.value2, 3, msisdn.value3, 4, msisdn.value4, 5, msisdn.value5, msisdn.value0),
msisdn.value0 || ';' || NVL(msisdn.value1, '') || ';' || NVL(msisdn.value2,'') || ';' || NVL(msisdn.value3,'') || ';' || NVL(msisdn.value4, '') || ';' || NVL(msisdn.value5, ''),
customer_number.imei,
NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)) date_start,
customer_number.id,
NVL(s2kaccount.arpu1,0),
msisdn.value0,
msisdn.value1,
msisdn.value2,
msisdn.value3,
msisdn.value4,
msisdn.value5,
customer_number.id_pricing_plan
FROM customer_s2kaccount
JOIN customer_number ON customer_number.s2k_account = customer_s2kaccount.s2k_account AND customer_number.service_state = 'AB'
JOIN msisdn ON msisdn.msisdn = customer_number.msisdn
JOIN TABLE(CAST(v_tmp_table AS ADA.NUMBER_TABLE)) ids ON ids.column_value = msisdn.id
JOIN msisdn_group ON msisdn_group.id = msisdn.id_msisdn_group
JOIN pricing_plan ON pricing_plan.id = customer_number.id_pricing_plan AND pricing_plan.is_for_pwa = 1
JOIN tariff ON tariff.name = pricing_plan.id
JOIN s2kaccount ON s2kaccount.s2k_account = customer_number.s2k_account
LEFT
JOIN (SELECT msisdn, exchange_date, ADD_MONTHS(exchange_date, MAX(prolongation)) le_contract_end_date
FROM loyalty_exchange a, msisdns
WHERE a.msisdn = msisdns.ms AND exchange_date >= ALL (SELECT exchange_date FROM loyalty_exchange b WHERE b.msisdn = a.msisdn)
GROUP BY msisdn, exchange_date) le ON le.msisdn = customer_number.msisdn
WHERE customer_s2kaccount.id_customer = v_customerId;
This query returns different results in the morning (09:00) and afternoon (16:00) on the same database for the same input data (I have prepared a script to test).
Oracle 9.2.0.6 @solaris
I checked the query plans, but they look the same in the morning and the afternoon. I don't know where to look for a problem/bug.
Please help me with suggestions. is in bug with join ansi? or a left outer join?

Published by: batonoff on February 16, 2009 16:56

Published by: batonoff on February 16, 2009 16:58

Published by: batonoff on February 16, 2009 17:00

I recommend you post your declaration in the {} code tags (without the spaces) so that we can actually read.

You are absolutely positive that nothing has changed on the data between when you run in the morning and in the afternoon?

Tags: Database

Similar Questions

  • Calculations to return different results depending on the responsibility

    Hello

    We have a report that uses a PL/SQL function in a calculation.

    When a single responsibility runs the report, the calculation returns figures empty or incorrect.

    When another executes it, it works fine.

    When the function is created, are there grants that must be given to ensure that all responsibilities can use this?

    All the responsibilities have access to the data in the application.

    The service is owned by APPS and it was registered in the EUL.

    Also, there seems to be a difference in if this is executed from SSO launch Viewer or office.

    Kind regards

    Rachael

    Hello

    Your basic problem is that you have

    EXCEPTION
    while others then
    return sqlcode;

    at the end of your code. This means that if an error occurs when you run the function it will be completed successfully, but with some bad days.

    With this exception handling it is difficult to know what you encounter the error, but it could be a problem of access to the tables or type conversion problem.

    Rod West

  • SQL query return different result 11 GR 1 material and GR 11, 2

    Problem: SQL returns different results in 11 GR 1 material and GR 11, 2 games.

    Example script:

    create the table tab_main
    (
    SOS number (2) not null,
    contract number (2) null
    )
    /

    create the table tab_sub
    (
    number (2) of contract non-null,.
    SOS number (2) null
    )
    /

    insert into tab_main values (1, 10);
    insert into tab_main values (2, 20);
    insert into tab_main values (3, null);
    insert into tab_main values (4, null);

    insert into tab_sub values (1, 10);
    insert into tab_sub (20, 2) values;
    commit;

    The SQL code:

    SELECT *.
    OF tab_main.
    tab_sub
    WHERE tab_main.sos = tab_sub.sos (+) AND
    tab_main. Contract = tab_sub.contract (+) and
    tab_main. Contract not in (select 1 of the double);

    The above query gives more results
    -by 11.2.0.4
    1 10 10 1
    2 20 20 2

    -in 11.1.0.7
    1 10 10 1
    2 20 20 2
    4
    3


    Please tell us what could be the reason for the behaviour of offset lines thie.


    Thank you

    Piesset

    I think it is probably a bug in 11.1.0.7 (and possibly other versions), I get the same results as your 11.2.0.4 9.2.0.7, 10.2.0.3 and 11.2.0.3, and this is the result, I expect.

    Your not in the paragraph is equivalent to:

    SELECT *.

    OF tab_main, tab_sub

    WHERE tab_main.sos = tab_sub.sos (+) AND

    tab_main. Contract = tab_sub.contract (+) and

    tab_main. Contract <> 1;

    Since you have null values in tab_main.contract they are lost by the predicate since null = value is never true (or false).

    John

  • Initiation form of different workflows depending on the type of inquiry?

    I have difficulties to get a form to start different workflows depending on the type of investigation. I followed the instructions described here without success.

    I created two workflows: ID746065 and ID746066. Each workflow sends a notification e-mail to the various departments. I have the following code in my form:

    "< select name = WorkflowList" class = "cat_dropdown" >

    "< option value =" ">--please select--< / option >".

    < option value = "ID746065" > notify sales < / option >

    < option value = "ID746066" > notify Marketeing < / option >

    < / select >

    It does not work.

    In the Site Manager = > Web Forms = > Web form properties = > use the workflow, I 'not to use a workflow' selected. Is this correct? I want the form to select the workflow. If I change "Use Workflow" to one of my Workflows, it send an email, so I know the Workflows are correct. How can I get the form to dynamically select the workflow?

    I don't think you need to 'ID' before the workflow ID number.

  • Different results of exactly the same query

    Hello

    I wrote a function to calculate the days between 2 dates. If I am running in SQL Developer or directly on the oracle server, I get the results I expected. However, if I run on a client by using ODBC, or PHP connection via the OCI8 extension, I get an incorrect result.

    The function takes 2 parameters: 1st and 2nd date and should output the number of non-working days (weekends and holidays) between 2 dates. The coding is not very pretty, but it does not work very well as I said since the client SQL Developer.

    Here is the code:
    create or replace
    FUNCTION NON_WORKDAYS(fromdate IN DATE, todate IN DATE)
    --Function to calculate non working days between 2 given dates (Weekends & Bank Holidays)
    --Update: Added in a calendar for bank holidays. Bank holidays are listed to the end of 2013
    
    RETURN NUMBER IS
    BANK_HOLS NUMBER;
        ret NUMBER;
    BEGIN
        SELECT count(mydate) INTO ret FROM 
     (SELECT     TO_DATE (fromdate, 'dd-mon-yyyy hh24:mi:ss') + LEVEL - 1 mydate
                    FROM DUAL
               CONNECT BY LEVEL < =
                                TO_DATE (todate, 'dd-mon-yyyy hh24:mi:ss')
                              - TO_DATE (fromdate, 'dd-mon-yyyy hh24:mi:ss')
                              + 1)
         WHERE TO_CHAR (mydate, 'DY') IN ('SAT', 'SUN');
         
         
         select count(mydate) into BANK_HOLS from (
         SELECT     TO_DATE (fromdate, 'dd-mon-yyyy hh24:mi:ss') + LEVEL - 1 mydate
                    FROM DUAL
               CONNECT BY LEVEL < =
                                TO_DATE (todate, 'dd-mon-yyyy hh24:mi:ss')
                              - TO_DATE (fromdate, 'dd-mon-yyyy hh24:mi:ss')
                              + 1
         )
         WHERE TO_CHAR (mydate, 'DD-MM-YYYY') IN 
         ('03-01-2011', 
         '22-04-2011',
         '25-04-2011',
         '29-04-2011',
         '02-05-2011',
         '30-05-2011',
         '29-08-2011',
         '26-12-2011',
         '27-12-2011',
         '02-01-2012',
         '06-04-2012',
         '09-04-2012',
         '07-05-2012',
         '04-06-2012',
         '05-06-2012',
         '12-07-2012',
         '27-08-2012',
         '25-12-2012',
         '26-12-2012',
         '01-01-2013',
         '29-03-2013',
         '01-04-2013',
         '06-05-2013',
         '27-05-2013',
         '12-07-2013',
         '26-08-2013',
         '25-12-2013',
         '26-12-2013'
         );
         ret:= ret + BANK_HOLS;
         
        RETURN ret;
    end;
    The problem is only with certain dates. For example, if I use the date '17-SEP-2012' for the two input parameters, I'm waiting for a result draw. In the SQL Developer client, I get the expected result. However, using ODBC or PHP OCI8 (which I believe is using a direct connection to TNS in the DB), the result returned is '1', which is incorrect ("17-SEP-2012" has been a MONDAY ""). If I use the current date (20-SEP-2012), I get the expected (zero) result in both the SQL Developer client and ODBC/PHP client.

    I also tried to use variants of SYSDATE in place and place the date string, to see if I get different results (i.e. today is 20-SEP-2012, so I used SYSDATE-3 to 17-SEP-2012).

    To be clear, I call the function in a select statement: select (sysdate-3, sysdate-3) non_workdays of the double; or select non_workdays (TO_DATE('17-SEP-2012'), TO_DATE('17-SEP-2012')) of double;

    I have spent hours and hours of troubleshooting this, and it makes me crazy!

    I also checked the view V$ SQLAREA the Oracle DB to see what is actually passed to the ODBC client database engine. I was expecting the statement became corrupted somehow, that's why I get strange results, but this was not the case. The statement in the column SQL_FULLTEXT of V$ SQLAREA, showed exactly the statement I performed on the ODBC Client. I tried with the oracle instantclient and full client (10g).

    Can someone help save my sanity please? I am eternally grateful!

    Sorry for the massive post!

    Published by: user12199535 on 20-Sep-2012 12:20

    Your code is a mess. You convert DATE to DATE, e.g. TO_DATE (fromdate, 'dd-mon-yyyy hh24:mi:ss'). TO_DATE function first parameter is a string, while fromdate is the date. That's why Oracle implicitly converts fromdate to the string of default date format that is client dependent and therefore can produce different results on different customers boxes. In addition, your code is dependent on NLS. If the customer has other date language settings, for example German, Sun and SAT are false. And there is no need to separately calculate the weekends and holidays:

    create or replace
      FUNCTION NON_WORKDAYS(fromdate IN DATE, todate IN DATE)
      --Function to calculate non working days between 2 given dates (Weekends & Bank Holidays)
      --Update: Added in a calendar for bank holidays. Bank holidays are listed to the end of 2013
        RETURN NUMBER
        IS
            BANK_HOLS NUMBER;
            ret NUMBER;
        BEGIN
            SELECT  count(mydate)
              INTO  ret
              FROM  (
                     SELECT  trunc(fromdate) + LEVEL - 1 mydate
                       FROM  DUAL
                       CONNECT BY LEVEL < = trunc(todate) - trunc(fromdate) + 1
                    )
              WHERE TO_CHAR(mydate,'DY','NLS_DATE_LANGUAGE = ENGLISH') IN ('SAT','SUN')
                 OR mydate IN (
                               DATE '2011-01-03',
                               DATE '2011-04-22',
                               DATE '2011-04-25',
                               DATE '2011-04-29',
                               DATE '2011-05-02',
                               DATE '2011-05-30',
                               DATE '2011-08-29',
                               DATE '2011-12-26',
                               DATE '2011-12-27',
                               DATE '2012-01-02',
                               DATE '2012-04-06',
                               DATE '2012-04-09',
                               DATE '2012-05-07',
                               DATE '2012-06-04',
                               DATE '2012-06-05',
                               DATE '2012-07-12',
                               DATE '2012-08-27',
                               DATE '2012-12-25',
                               DATE '2012-12-26',
                               DATE '2013-01-01',
                               DATE '2013-03-29',
                               DATE '2013-04-01',
                               DATE '2013-05-06',
                               DATE '2013-05-27',
                               DATE '2013-07-12',
                               DATE '2013-08-26',
                               DATE '2013-12-25',
                               DATE '2013-12-26'
                              );
            RETURN ret;
    end;
    /
    

    SY.
    P.S. I think that I converted your vacation to literals correctly, but still double check date.

  • Smart collection returns different results to the library filter?

    This is such a stupid thing, and I barely noticed. I have smart collections simply gather all the images with a particular star of note, very very simple! I have a 1 star, a Star 2 and one for the 3 stars and more. So far so good, use these for centuries-, but I noticed that if I go to Catalog/All photos and place a filter of the same library (this is the filter at the top of the library grid view) I get different results. Actually if I place a filter attribute that says '= 2 stars' images only I can watch the tape that works at the bottom of the screen (sorry I have no idea what it's called) and he said that "all photos / 1056 1647 photos» If I can clear this filter and scroll down to my smart collection that applies the filter even to the entire catalog (and I triple checked this, no difference at all, I don't have lower or higher than the here is the self same "=" only!) and it says "1066"! Thus, the smart collection search 10 images more than other, identical filters working on the entire catalog - I am confused? Anyone had this problem, I missed something? If it wasn't for the number of images concerned I'd them and try to find the additional files by hand!

    Popular indices, and LR3 passing on Mac.

    Tim.

    You can check if the images are stacked differently (and thus not counted) in both points of view.

  • OBIEE logical column has same SQL but returns different results

    I have a SQL query with a case statement that returns the correct results by operating in Oracle SQL Developer. I've created several logical columns in OBIEE, one for each case in the original query. However, the results returned by each logical column OBIEE are radically different from the original SQL query results, even if the SQL code is virtually identical.

    For example, a column logical OBIEE that returns incorrect results contains the following SQL code:

    SUM (CASE when

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '% a %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%B %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%c %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%G %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like"hour %") or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like"%%J") or

    ("Registration - College". "" Effective colleges F. ("' Postal code ' like '%R %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%s %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%T %') or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or

    ("Registration - College". "" Effective colleges F. ("" Postal code "like '%x %') or

    ("Registration - College". "" Effective colleges F. ("' Postal code ' like '%Y %')

    THEN 0 OTHERWISE 1 END)

    The case statement in the original SQL query, which returns the correct results, is as follows:

    CASE

    WHEN (postal_zip_code_permanent like "%%K") or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%m %') or (postal_zip_code_permanent like '%n %') or (postal_zip_code_permanent like "%p %") THEN "Ontario".

    WHEN (postal_zip_code_permanent like '% a %') or (postal_zip_code_permanent like '%B %') or (postal_zip_code_permanent like '%c %') or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%G %') or (postal_zip_code_permanent like "%hour") or (postal_zip_code_permanent like "%%J") or (postal_zip_code_permanent like "%%R") or (postal_zip_code_permanent like '%s %') or (postal_zip_code_permanent like '%t %') or (postal_zip_code_permanent like '% %') or (postal_zip_ code_permanent like '%x %') or (postal_zip_code_permanent like "%%Y") THEN "Canada, other than Ontario.

    WHEN (substr(postal_zip_code_permanent,1,1) IN ('1 ', '2', '3', '4', '5', '6' ', 7',' 8 ', ' 9',' 0') or (postal_zip_code_permanent like '%d %') or (postal_zip_code_permanent like '%f %') or (postal_zip_code_permanent like ' % I %') or (postal_zip_code_permanent like "% O") or (postal_zip_code_permanent like "%%Q") or (postal_zip_code_permanent like "%%U") or (postal_zip_code_permanent like ' % W ') or (postal_zip_code_permanent like "%%Z")) THEN 'other')

    WHEN (postal_zip_code_permanent like '% + %') or (postal_zip_code_permanent like '%. %') or (postal_zip_code_permanent like ' %? %') or (postal_zip_code_permanent like '% %') or postal_zip_code_permanent IN ('+ ','.', '?)) (',',') And THEN "Invalid."

    WHEN postal_zip_code_permanent is null THEN 'Blank '.

    Of OTHER postal_zip_code_permanent

    END

    Now I see what the problem was. In the original SQL query, each condition is exclusive, for each record will only be categorized in one of the scenarios WHEN. But in OBIEE, each logical column is autonomous, so some records were classified into more than logical column, even if each logical column was supposed to be exclusive.

  • Database query returns no results

    Hello

    I timesten arrangement with Oracle as backend, the passthroughlevel is set to 1, which means that if the table is not found in timesten then go to Oracle, but I am facing a problem when querying for what anyone using ttIsql, there is no return line, although when I run the same query in Oracle directely I get the desired result.

    Here is the operation made by me:

    Command > connect myOraCache
    Successful login: DSN = myOraCache; UID = EIT; DataStore = / usr/ptyagi/timesten/datastore/ietds; DatabaseCharacterSet = WE8ISO8859P1; ConnectionCharacterSet=US7ASCII;DurableCommits=1;DRIVER=/usr/iris/timesten/TimesTen/tt70/lib/libtten.so;OracleId=iet
    ; Authenticate = 0; PermSize = 400; PassThrough = 1; TypeMode = 0;
    (Default AutoCommit = 1).
    Command > select * from category WHERE = iris_codes "side."
    0 rows found.

    Pramod salvation,

    There is no space or time here for a full tutorial on TimesTen Cache Connect; You should study the documentation TimesTen Cache to better understand how it works.

    Briefly...

    A cache group TimesTen is an SQL object that defines one or more tables that will be cached to Oracle, as well as the relationship of foreign key between them. Foreign key relationships defined in Oracle generally will also be defined in TimesTen if there may be exceptions to this rule.

    Cache group definitions can be created in TimesTen via SQL (usually by taking a copy of the schema creation script Oracle and editiing it) or through the interface of Administration of Cache TimesTen.

    However, the first step is to decide which tables you want to cache and why. The goal of caching is to improve performance for the application key functions. Although it is sometimes possible to cache all tables in Oracle, it is often not practical and not desirable (for example, it may need too much memory for TimesTen).

    I would say that yiu address the issue as follows:

    1 study the documentation for cache TimesTen understand how TimesTen caching works, the different types of cache groups and their functionality (and limitations)

    2. If looks help TimesTen as a cache may be feasible for you, perform some simple tests for key areas see what level of performance improvement you get by doing TimesTen. This can be very variable, a well-written application that is well suited to caching can see huge improvements while an application that is not well suited to caching or which is poorly implemented may see little or no improvement.

    3. If after these two steps, it is clear TimesTen will provide you a significant bnefist then you will be in a good position to decide how best to implement TimesTen for your application.

    It is important to understand that TimesTen is almost never just a kind of "Plug and performance is much better" solution. Detailed thought and planning must be done from the outset in order to achieve the best of TimesTen.

    Chris

  • CONNECT BY QUERY returns different number of Clotilde in 10g or 11g databases

    People,

    I put just a problem of bellows in our databases.

    1.) 10 g database:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> select * from global_name;
    
    SQL> SELECT ROWNUM 
      2    FROM   dual
      3  CONNECT BY ROWNUM <= 2;
    
        ROWNUM
    ----------
             1
             2
             3
    
    SQL> 
    2 Database 11 g
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select * from global_name;
    
    
    SQL> SELECT ROWNUM 
      2    FROM   dual
      3    CONNECT BY ROWNUM <= 2;
    
        ROWNUM
    ----------
             1
             2
    
    SQL> 
    As you can see in 10g above query returns 3 records in 11 g only 2.
    Why is it like that? It's sort of adjustable, to produce the same result?

    Thank you very much
    Tomas

    Hello

    If you have access to metalink, see no bug no 6031397.
    It is fixed in version 10.2

  • Fill in the select list with two different queries depending on the user's group

    Hello

    I finished my first production application using apex. I have a Select list that takes its values from a sql query. Now, I want this different query for each user based on the group. Basically each user sees only the projects they are responsible - that works fine. But I want all the people of the admin group to see all the projects - how can I do this?

    Thank you very much!!!
    Henrik

    Hello

    Try this

    SELECT s.caption || ' - ' || s.sapnr display_value
          ,s.sharedservice_id return_value
    FROM   sharedservices s, sharedservicelead l
    WHERE  (   s.sharedservicelead_id = l.sharedservicelead_id
            OR s.ssldeputy_id = l.sharedservicelead_id
           )
    AND    l.username = :app_user
    UNION
    SELECT s.caption || ' - ' || s.sapnr display_value
          ,s.sharedservice_id return_value
    FROM   sharedservices s
    WHERE  HTMLDB_UTIL.get_groups_user_belongs_to(:APP_USER) = 'capacitymanagement'
    

    See you soon

    Ben

  • Query regarding different refreshing data from the grid when returned from a workflow

    Hi Experts,

    JDEV version is: 11.1.1.5

    Our application uses dynamic tabs the user interface shell.

    Whenever the user connects, it is taken in A TAB.

    Since the TAB A, the user navigates to TAB B.

    TAB B has a GRID B(table with a few records).

    Column A on TAB B has a hyperlink which, once clicked on will open a stream of different tasks in a different tab.

    Click on the column of hyperlink for the different lines will open different tf (under certain conditions).

    By clicking on the hyperlink, that the method _launchActivity(String title, String taskflowId, boolean newTab) is used, which the TF open in a new tab.

    The user works on the TF (in a new tab) which opened on click of a hyperlink in the column is and click on SAVE.

    Click to save some operation and removeCurrentTab method is called which will close the current tab, and control passes to the first tab (TAB A).

    The problem:

    Once the user tries to click or to return to the TAB B the WHAT GRID B is never updated that we cannot get the descriptor to refresh the data in the grid.

    Any suggestions would be much appreciated.

    Thank you

    Jean Claude

    huh, I thought it was another library in question.

    In all cases, you can use contextual event (when you close the current tab).

    The second option is to navigate to the method executeQuery by code call activities:

    https://blogs.Oracle.com/jdevotnharvest/entry/how-to_navigate_in_bounded_task_flows

  • Select from another table, when the query returns no result

    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    Thank you.

    user10407139 wrote:
    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    I think you need to explain more clearly if

    -you only have a couple of "billing" columns which is empty and in this case, you want to use the columns from the table 'accounts '.

    - or you have a join with another table that doesn't return data, for example a foreign key "address_id" "billing" is zero and therefore the join to other tables 'address' will return all the data

    In the first case, you have already been provided with some examples here, how to use NVL or similar functions to achieve, even if the first post first evaluates the information of 'accounts' and if it is white using information from "billing". According to your description you need the other way around. The second post a subquery recursive useless in my opinion.

    In the latter case, you should probably use an "outer" join so that the data in your table "bills" are returned, even if the join to another table is not at all the lines.

    SELECT
    NVL(AD1.ADDRESS_ATTR1, AD2.ADDRESS_ATTR1) as ADDRESS_ATTR1,
    NVL(AD1.ADDRESS_ATTR2, AD2.ADDRESS_ATTR2) as ADDRESS_ATTR2,
    NVL(AD1.ADDRESS_STREET, AD2.ADDRESS_STREET) as ADDRESS_STREET,
    ...
    FROM accounts a
    INNER JOIN billings b
    ON a.accountid = b.accountid
    LEFT OUTER JOIN address ad1
    ON b.address_id = ad1.address_id
    INNER JOIN address ad2
    ON a.address_id = ad2.address_id;
    

    In this way you pick up the address stored in the "invoices" table, if it existed, otherwise you pick up the address assigned to the "accounts" table I used an inner for the second address join join because you said that the account always has an assigned address.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • Parameter query returns no results

    Hello

    I need a parameter query to return all customers for the locality.

    The name of the locality is given as a parameter.

    The problem with me is that the query is not even a single line when it should return at least fifty!. Locality is not unique, and there are a lot of consumers with the same value for the LOCALITY. The query I use is given below:

    SELECT ROWID, of GEOM FROM NOT_MY_CONSUMERS WHERE'= a ' and LOCALITY =: var1;

    When I try to use an ObjectID as parameter the result is returned property. ObjectID is unique for each line and thus a single row is returned
    in the result.

    Is it not possible to use the parameter query for non-unique settings?

    Help, please!
    I'm stuck with my project.

    Thank you very much!!

    Neha

    Published by: Neha39 on March 16, 2012 04:53

    Published by: Neha39 on March 16, 2012 05:15

    As your column data type, please use this one:

    SELECT ROWID, of GEOM FROM NOT_MY_CONSUMERS WHERE'= a ' and trim (TOWN) =: var1;

  • dbms_sqlhash and online md5 calculator return different results

    Does anyone know how dbms_sqlhash.gethash () works?
    I get the same result for string 123456.
    Md5 (http://md5-hash-online.waraxe.us/) online calculator returns e10adc3949ba59abbe56e057f20f883e.
    DBMS_SQLHASH. GETHASH() returns 7E8FEB2276322ECDDD4423B649DFD4D9.
    --the second parameter value 2 means MD5 hash.
    select DBMS_SQLHASH.GETHASH('select 123456 from dual',2) from dual;

    Hello
    >
    I get the same result for string 123456.
    Md5 (http://md5-hash-online.waraxe.us/) online calculator returns e10adc3949ba59abbe56e057f20f883e.
    DBMS_SQLHASH. GETHASH() returns 7E8FEB2276322ECDDD4423B649DFD4D9.

    --the second parameter value 2 means MD5 hash.
    select DBMS_SQLHASH.GETHASH('select 123456 from dual',2) from dual;
    

    DBMS_SQLHASH. GETHASH returns the hash of the SQL statement in the first parameter Select 123456 of double, not 123456

    To get the MD5 hash of the 123456 you should use DBMS_OBFUSCATION_TOOLKIT or DBMS_CRYPTO packages. The latest is preferable and more recent.

    Kind regards

  • query return different values

    Hi all


    We have EBS 11.5.10.2 installed on solaris

    The Apps schema owns all objects and public synonyms created for all objects in the apps schema.

    now when I run the query of applications such as:

    Select * from PA_REP_UTIL_ORG_GE_V;

    get the error:

    ERROR on line 1:
    ORA-00600: internal error code, arguments: [kksfbc-analysis-infinite-loop],.
    [[0xFFFFFFFF7C7432B8], [] [] [], [], [],]



    Whereas, where sys is the same mark. She gives the value...

    also raised a SR with oracle and they said to apply a patch... but the question remains...


    Please notify

    Kai

    The request that we have in the crontab is given below. We reel to a sql and run the sql.

    Select 'Edit'. object_type | » '|| owner: '. ' || object_name |' compile;' of
    DBA_OBJECTS where object_name in (d_name select do.name)
    of sys.obj$, sys.dependency$, sys.obj$ po
    where P_OBJ #= po.obj #(+)
    and D_OBJ #= do.obj #.
    and do.status = 1
    and po.status = 1
    (and po.stime! = p_timestamp);

    HTH,
    http://borndba.com

Maybe you are looking for