same query gives a different result under 2 different schema.

Hello
I have a query that shows two different results under 2 different schema.
Here's the code.

SELECT ssbsect_term_code, ssbsect_crn, ssbsect_seq_numb,
SUBSTR (f_active_section_ind (ssbsect_ssts_code), 1, 1),
SUBSTR (f_active_course_ind (a.scbcrse_csta_code), 1, 1),
SUBSTR (f_check_for_course_coreqs, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
),
1,
1
),
SUBSTR (f_check_for_course_prereqs, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
''
),
1,
1
),
SUBSTR (f_check_for_section_coreqs (ssbsect_term_code, ssbsect_crn),
1,
1
),
SUBSTR (f_check_for_section_prereqs, (ssbsect_term_code,
ssbsect_crn,
''
),
1,
1
),
a.scbcrse_eff_term, a.scbcrse_coll_code, a.scbcrse_dept_code,
SUBSTR (f_get_course_levels, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
),
1,
2
),
SUBSTR (f_get_course_levels, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
),
1,
2
),
SUBSTR (f_get_course_levels, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
),
1,
2
),
SUBSTR (f_get_course_levels, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
),
1,
2
),

a.scbcrse_divs_code, ssbsect_subj_code, ssbsect_crse_numb,
a.scbcrse_ceu_ind, a.scbcrse_csta_code,
NVL (ssbsect_credit_hrs, a.scbcrse_credit_hr_low),
a.scbcrse_credit_hr_low, a.scbcrse_credit_hr_high,
a.scbcrse_credit_hr_ind,
NVL (ssbsect_bill_hrs, a.scbcrse_bill_hr_low),
a.scbcrse_bill_hr_low, a.scbcrse_bill_hr_high,
a.scbcrse_bill_hr_ind, ssbsect_ssts_code, ssbsect_camp_code,
NVL (ssbsect_gmod_code,
SUBSTR (f_default_gmod, (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
),
1,
1
)
),
NVL (ssbsect_crse_title, a.scbcrse_title), ssbsect_sapr_code,
ssbsect_census_enrl, ssbsect_census_enrl_date,
ssbsect_census_2_enrl, ssbsect_census_2_date, ssbsect_proj_enrl,
ssbsect_max_enrl, ssbsect_enrl, ssbsect_seats_avail,
ssbsect_ptrm_code, ssbsect_ptrm_start_date, ssbsect_ptrm_end_date,
ssbsect_link_ident, k.ssrmeet_begin_time, k.ssrmeet_end_time,
k.ssrmeet_bldg_code, k.ssrmeet_room_code, k.ssrmeet_schd_code,
k.ssrmeet_mon_day, k.ssrmeet_tue_day, k.ssrmeet_wed_day,
k.ssrmeet_thu_day, k.ssrmeet_fri_day, k.ssrmeet_sat_day,
k.ssrmeet_sun_day, l.ssrmeet_begin_time, l.ssrmeet_end_time,
l.ssrmeet_bldg_code, l.ssrmeet_room_code, l.ssrmeet_schd_code,
l.ssrmeet_mon_day, l.ssrmeet_tue_day, l.ssrmeet_wed_day,
l.ssrmeet_thu_day, l.ssrmeet_fri_day, l.ssrmeet_sat_day,
l.ssrmeet_sun_day, m.ssrmeet_begin_time, m.ssrmeet_end_time,
m.ssrmeet_bldg_code, m.ssrmeet_room_code, m.ssrmeet_schd_code,
m.ssrmeet_mon_day, m.ssrmeet_tue_day, m.ssrmeet_wed_day,
m.ssrmeet_thu_day, m.ssrmeet_fri_day, m.ssrmeet_sat_day,
m.ssrmeet_sun_day, n.ssrmeet_begin_time, n.ssrmeet_end_time,
n.ssrmeet_bldg_code, n.ssrmeet_room_code, n.ssrmeet_schd_code,
n.ssrmeet_mon_day, n.ssrmeet_tue_day, n.ssrmeet_wed_day,
n.ssrmeet_thu_day, n.ssrmeet_fri_day, n.ssrmeet_sat_day,
n.ssrmeet_sun_day, o.ssrmeet_begin_time, o.ssrmeet_end_time,
o.ssrmeet_bldg_code, o.ssrmeet_room_code, o.ssrmeet_schd_code,
o.ssrmeet_mon_day, o.ssrmeet_tue_day, o.ssrmeet_wed_day,
o.ssrmeet_thu_day, o.ssrmeet_fri_day, o.ssrmeet_sat_day,
o.ssrmeet_sun_day, p.ssrmeet_begin_time, p.ssrmeet_end_time,
p.ssrmeet_bldg_code, p.ssrmeet_room_code, p.ssrmeet_schd_code,
p.ssrmeet_mon_day, p.ssrmeet_tue_day, p.ssrmeet_wed_day,
p.ssrmeet_thu_day, p.ssrmeet_fri_day, p.ssrmeet_sat_day,
p.ssrmeet_sun_day, q.ssrmeet_begin_time, q.ssrmeet_end_time,
q.ssrmeet_bldg_code, q.ssrmeet_room_code, q.ssrmeet_schd_code,
q.ssrmeet_mon_day, q.ssrmeet_tue_day, q.ssrmeet_wed_day,
q.ssrmeet_thu_day, q.ssrmeet_fri_day, q.ssrmeet_sat_day,
q.ssrmeet_sun_day, r.ssrmeet_begin_time, r.ssrmeet_end_time,
r.ssrmeet_bldg_code, r.ssrmeet_room_code, r.ssrmeet_schd_code,
r.ssrmeet_mon_day, r.ssrmeet_tue_day, r.ssrmeet_wed_day,
r.ssrmeet_thu_day, r.ssrmeet_fri_day, r.ssrmeet_sat_day,
r.ssrmeet_sun_day, s.ssrmeet_begin_time, s.ssrmeet_end_time,
s.ssrmeet_bldg_code, s.ssrmeet_room_code, s.ssrmeet_schd_code,
s.ssrmeet_mon_day, s.ssrmeet_tue_day, s.ssrmeet_wed_day,
s.ssrmeet_thu_day, s.ssrmeet_fri_day, s.ssrmeet_sat_day,
s.ssrmeet_sun_day, t.ssrmeet_begin_time, t.ssrmeet_end_time,
t.ssrmeet_bldg_code, t.ssrmeet_room_code, t.ssrmeet_schd_code,
t.ssrmeet_mon_day, t.ssrmeet_tue_day, t.ssrmeet_wed_day,
t.ssrmeet_thu_day, t.ssrmeet_fri_day, t.ssrmeet_sat_day,
t.ssrmeet_sun_day, T1.ssrmeet_begin_time, t1.ssrmeet_end_time,
T1.ssrmeet_bldg_code, t1.ssrmeet_room_code, t1.ssrmeet_schd_code,
T1.ssrmeet_mon_day, t1.ssrmeet_tue_day, t1.ssrmeet_wed_day,
T1.ssrmeet_thu_day, t1.ssrmeet_fri_day, t1.ssrmeet_sat_day,
T1.ssrmeet_sun_day, e1.ssrattr_attr_code, e2.ssrattr_attr_code,

SUBSTR (f_more_attributes, (scbcrse_subj_code,
scbcrse_crse_numb,
scbcrse_eff_term
),
1,
1
),
x.spriden_id, NVL (x.spriden_last_name, 'STAFF'),
x.spriden_first_name, SUBSTR (x.spriden_mi, 1, 1), y.spriden_id,
y.spriden_last_name, y.spriden_first_name,
SUBSTR (y.spriden_mi, 1, 1), z.spriden_id, z.spriden_last_name,.
z.spriden_first_name, SUBSTR (z.spriden_mi, 1, 1),
DECODE (u.spriden_pidm, NULL, 'n', 'Y'), ssbovrr_coll_code,
ssbovrr_divs_code, ssbovrr_dept_code, f1.scrschd_schd_code,
F1.scrschd_workload, f1.scrschd_max_enrl, f1.scrschd_adj_workload,
F2.scrschd_schd_code, f2.scrschd_workload, f2.scrschd_max_enrl,
F2.scrschd_adj_workload, f3.scrschd_schd_code, f3.scrschd_workload,
F3.scrschd_max_enrl, f3.scrschd_adj_workload, f4.scrschd_schd_code,
F4.scrschd_workload, f4.scrschd_max_enrl, f4.scrschd_adj_workload
Scbcrse a.,
ssbovrr,
spriden x,
spriden,
ssrmeet k,
ssrmeet l,
ssrmeet m,
ssrmeet n,
ssrmeet o,
ssrmeet p,
ssrmeet q,
ssrmeet r,
s ssrmeet,
ssrmeet t,
ssrmeet t1,
scrschd f1,
scrschd f2,
scrschd f3,
scrschd f4,
ssrattr e1,
ssrattr e2,
spriden z,
spriden u,
ssbsect
WHERE x.ROWID (+) =
f_get_instr_spriden_rowid (ssbsect_crn,
ssbsect_term_code,
« Y »,
''
)
AND y.ROWID (+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, ', 1).
AND z.ROWID (+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, ', 2)
AND u.ROWID (+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, cm, 3)
AND ssbovrr_term_code (+) = ssbsect_term_code
AND ssbovrr_crn (+) = ssbsect_crn
AND a.scbcrse_subj_code = ssbsect_subj_code
AND a.scbcrse_crse_numb = ssbsect_crse_numb
AND a.scbcrse_eff_term =
(SELECT MAX (b.scbcrse_eff_term)
OF scbcrse b
WHERE b.scbcrse_subj_code = ssbsect_subj_code
AND b.scbcrse_crse_numb = ssbsect_crse_numb
AND b.scbcrse_eff_term < = ssbsect_term_code)
AND k.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
1
)
AND l.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
2
)
AND m.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
3
)
AND n.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
4
)
AND o.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
5
)
AND p.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
6
)
AND q.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
7
)
AND r.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
8
)
AND s.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
9
)
AND t.ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
10
)

AND t1. ROWID (+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
11
)

AND f1. ROWID (+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
)
AND f2. ROWID (+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
)
AND f3. ROWID (+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
)
AND f4. ROWID (+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
)
AND e1.ssrattr_term_code (+) = ssbsect_term_code
AND e1.ssrattr_crn (+) = ssbsect_crn
AND e1.ssrattr_attr_code (+) = "SWS".
AND e2.ssrattr_term_code (+) = ssbsect_term_code
AND e2.ssrattr_crn (+) = ssbsect_crn
AND e2.ssrattr_attr_code (+) LIKE '% TM ";

Thank you

user3367455 wrote:
Hello
I have a query that shows two different results under 2 different schema.

Hello

Different how?

-Different number of records, please run this and show us what you get:

select owner, object_name, object_type
  from dba_objects
 where object_name in
     ('SCBCRSE',
      'SCRSCHD',
      'SPRIDEN',
      'SSBOVRR',
      'SSBSECT',
      'SSRATTR',
      'SSRMEET',
      'F_GET_INSTR_SPRIDEN_ROWID',
      'F_GET_SSRMEET_ROWID_JS')
order by object_name;

If different values in some records, also include all functions in your selection list.

Concerning
Peter

Tags: Database

Similar Questions

  • Why I have two different execution plans for the same query on two different servers

    Hello everyone.

    I need your help to solve the problem quickly.

    In a nutshell, we have two servers that have the same version of Oracle RDBMS (11.2.0.4 EE). One of them for purposes of development and another is a production one.

    We have therefore two different execution plans for the same query executed on both servers. The only case of execution is OK and another is too slow.

    So I have to slow down the work of query using the same scheme to explain that young.

    Fence wire.

  • Get the sizes of tables with the same name but from different schemas

    There are two patterns in my database: HAND and ARCH.
    Each of these schemas contains a table named SPOITEMS. I would like to get the size of the table "SPOITEMS" of patterns one and another.
    I found this script:

    Select
    nom_segment table_name,
    Sum (bytes) /(1024*1024) table_size_meg
    Of
    user_extents
    where
    segment_type = 'TABLE '.
    and
    nom_segment = "SPOITEMS".
    Table_name group

    but it returns only a single element with the name of the table "SPOITEMS" (owner ARCH).

    Any ideas?

    Thanks in advance

    I assume that you run the query in the ARK? Use ALL_EXTENTS or DBA_EXTENTS instead of USER_EXTENTS

  • Different output for the same query in SQL Server and Oracle

    I have two tables table1 and table2

    -table1 has two columns c1 int and varchar c2. There are no constraints added in it. It contains data as shown below

    C1 c2
    -------------------
    d 6
    5 d
    102 g
    6%
    f 103
    5.
    501 j
    1 g
    601 n
    2 m

    -table2 has only a single column c1 int. There is no added in constraints. It contains data as shown below

    C1
    ----
    6
    1
    4
    3
    2

    now when I run below, given the query in sql server and oracle it gives me different results

    Select *.
    FROM table1
    table2 on table2.c1 = table1.c1 inner join (SELECT ROW_NUMBER() (any ORDER by ASC c1) AS c1 from table2)

    output of SQL server
    ------------------------
    C1 c2 c1
    --------------------------------
    1 g 1
    2 m 2
    3 h 3
    4 g 4
    5 d 5


    release of Oracle
    ----------------------
    C1 C2 C1
    ---------------------------------
    5 d 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2


    If you notice the first column in the two outputs. It is sorted in sql server and no oracle.

    Why he behaves differently in oracle? Is there a way I can fix this problem in oracle?

    Thank you
    Jigs

    It is NOT a behavior "differently" in Oracle; you did not specify just an order that you expect of your results, so you'll get output in what order the fantasies of the database showing (ie. no guaranteed order). It is an artifact of the way the database chooses to collect the data and databases (or same sets of data within the same database) can and will most likely behave differently.

    Same SQL Server will not be guaranteed to always get your data in an orderly manner if you exclude the order by clause, even if you think that there always display the data in an orderly manner.

    Your solution is to add an order by clause, in the TWO databases, to force the order of the data output.

  • 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.

  • Source code is the same name but different schema owner

    I got 1 of the online test and there the question has been asked. I have already answered but curious to cross-check my response with your advice...

    Question

    You want to see the source code of your defined package 'test1' and you issue the following query:

    Select the text in all_source

    WHERE name = "test1";

    After executing query, you have noticed that the result has 1 or more of source code with the code source test1 with the same name, but exist in different schema owner.

    Based on above circumstances, which is the type of possible object of the other source code?

    a Package

    b form

    c View

    d table

    e synonym

    My response was a (Package).

    Concerning

    Muzz

    Hello

    You answer is correct, all_source contains code for one of the following object types

    FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE,TYPE BODY

    for more detail check the following link

    http://docs.oracle.com/cloud/latest/db121/REFRN/refrn20249.htm#REFRN20249

    Concerning

    Salim

  • explain plan for the same query diff

    Hi experts,

    Please, help me understand explain the plan.  I have tow Server (server and two server). The server are same table, even the type of database, even version Oracle (gr 11 (2), same operating system (linux Redhat 5.5) and same table and index.

    but when I explain the plan for the same query on the two server. I got diff--diff to explain the plan. reason it has different, according to my understanding, it should be same. explain please, I share the explain plan and lower indices for the two server.

    Server a

    SQL > col COLUMN_NAME format a20

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

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

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    3 union

    4. Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

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

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 3659874059

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

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

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

    |   0 | SELECT STATEMENT |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

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

    PLAN_TABLE_OUTPUT

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

    Information of predicates (identified by the operation identity card):

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

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANTYPE"=1 AND "LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    16 selected lines.

    Second server

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

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

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    Union

    3 4 Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

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

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 1161680601

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

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

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

    |   0 | SELECT STATEMENT |                            |     2.    84.     5 (0) | 00:00:01 |       |       |

    |*  1 |  FILTER                             |                            |       |       |            |          |       |       |

    |*  2 |   TABLE ACCESS BY INDEX ROWID | LOAN_RUNNING_DETAILS_SOUTH |     2.    84.     5 (0) | 00:00:01 | ROWID | ROWID |

    |*  3 |    INDEX RANGE SCAN | DATE_IND1_S |     2.       |     3 (0) | 00:00:01 |       |       |

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

    PLAN_TABLE_OUTPUT

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

    Information of predicates (identified by the operation identity card):

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

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    2 - filter ("LOANTYPE" = 1)

    3 - access("LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    17 selected lines.

    Reg,

    Hard

    Hi , HemantKChitale,

    I also update statistics manual as you say, but not see 'TABLE ACCESS FULL' good result

    What should I do? my need of production tuning, but I cannot able tune this...

    SQL > exec dbms_stats.gather_table_stats (-online 'ttt' ownname, tabname => 'LOAN_RUNNING_DETAILS_SOUTH', cascade => TRUE, estimate_percent => NULL, method_opt => 'for all columns size 254', => of degree 4);

    PL/SQL procedure successfully completed.

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME<=sysdate-2 and="" loandatetime="">sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 3659874059

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

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

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

    |   0 | SELECT STATEMENT |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

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

    PLAN_TABLE_OUTPUT

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

    Information of predicates (identified by the operation identity card):

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

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANDATETIME">SYSDATE@!-15 AND "LOANTYPE"=1 AND "LOANDATETIME")<>

    16 selected lines.

  • Determine the maximum length of a column and its use in the same query?

    I would like to determine the maximum length of a column and use it in the same query. Is this possible? IE:

    SELECT RPAD (last_name, SELECT MAX (LENGTH (last_name)) + 5 FROM user, '-')
    OF the user.

    Thank you

    Hello

    Welcome to the forum!

    jfraley wrote:
    I would like to determine the maximum length of a column and use it in the same query. Is this possible? IE:

    SELECT RPAD (last_name, SELECT MAX (LENGTH (last_name)) + 5 FROM user, '-')
    OF the user.

    Thank you

    Sure. You almost go in your message: a scalar subquery . Just put brackets around the subquery:

    SELECT      RPAD ( last_name
              , (
                 SELECT  MAX (LENGTH (last_name)) + 5
                 FROM    user_tbl          -- USER is not a good table name
                )
              , '-'
              )          AS padded_last_name
    FROM      user_tbl
    ;
    

    Scalar subqueries in SQL are like tape in your garage in canvas: they are used for thousands of different things and open, maybe 1% of them. Usually, there are better ways to achieve the same results, such as the analytical functions:

    SELECT      RPAD ( last_name
              , 5 + MAX (LENGTH (last_name)) OVER ()
              , '-'
              )          AS padded_last_name
    FROM      user_tbl
    ;
    

    Still another way is to make the subquery and then join his game as if it were a table of results:

    WITH     got_max_length     AS
    (
         SELECT     MAX (LENGTH (last_name))     AS max_length
         FROM     user_tbl
    )
    SELECT      RPAD ( u.last_name
              , m.max_length + 5
              , '-'
              )          AS padded_last_name
    FROM           user_tbl     u
    CROSS JOIN     got_max_length     m
    ;
    

    Published by: Frank Kulash, December 12, 2011 21:17
    Added cross join example

  • FK two in the same query/tabe

    I'm trying to return two fields in the table even through two joins in the same query.

    Take this example:
    : Table
    ID Varchar PK
    Name Varchar
    FK Varchar Person.ID Chief
    Backup of Varchar Person.ID FK

    DATA:
    1 MyProduct 123 345
    2 YouProdct 345 678

    Table: person
    ID Varchar PK
    Name Varchar

    DATA
    John 123
    James 345
    Tom 678

    I need to come back

    RESULT:
    Name Leader Backup
    MyProduct John James
    Tom James YouProdct

    I have a lot of different queries, but I always get what looks like a Cartesian product or a syntax error.

    Thanks in advance

    Published by: jdc114 on March 28, 2009 17:20

    What have you tried? It seems to me

    SELECT product.name, leader.name, backup.name
      FROM product,
           person leader,
           person backup
     WHERE product.leader = leader.id
       AND product.backup = backup.id
    

    would be sufficient.

    Justin

  • Query will display No results

    A very simple analysis in OBIEE11g, revenue watch without results.
    In the journal, copy the generated SQL query and running in SQL Developer - works OK and returns several records.

    I checked the physiqueet and logical diagrams, data type for the key... etc.

    Pls. Any clue?

    Antonio

    Hello

    Purge the cache and try to run the same query, also run many lines of update on the three tables in the physical layer of the RPD.

    Kind regards
    DpKa

  • In the bar when I write sth such as address: soccer, it leads to search results from yahoo? How do I will change it give me the results of google search?

    In the bar when I write sth for example to address: "soccer", it leads to search results from yahoo. How do I will change it give me the results of google search?

    Hi vavamvak,

    You should take a look at article in the database Search the Web from the address bar . It will show you how to change the default address bar search provider.

    Hope this helps!

  • I have a corrupt user profile. Windows XP. When I add a new can be the same, or should be different. And the user's profile should match the user ID?

    Corrupted user profile

    I have a corrupt user profile.  Windows XP. When I add a new can be the same, or should be different.  And the user's profile should match the user ID?

    If the profile has recently become corrupted, you can probably get the same user by performing a system restore operation:

    "Windows XP problems if your profile is corrupted"
      <>http://support.Microsoft.com/kb/326688 >

    Otherwise, you will need to create another user and copy your data.  The simplest procedure is here:

    "How to recover damaged Windows XP user profile"
      <>http://support.Microsoft.com/kb/555473 >

    HTH,
    JW

  • I INSTALLED A PROGRAM ON MY COMPUTER THAT ME GIVES A DIFFERENT FROM THAT ONE KEY TO THE BACK OF THE COMPUTER YHE. WHY? WHAT IS THE REAL KEY?

    I INSTALLED A PROGRAM ON MY COMPUTER THAT ME GIVES A DIFFERENT FROM THAT ONE KEY TO THE BACK OF THE COMPUTER YHE. WHY? WHAT IS THE REAL KEY?

    I HOPE FOR SUPPORT OF MY FRIEND FROM JAMAICA

    IT IS FASTER THAN USAIN BOLT AND MORE AMIABLE THA BOB MARLEY

    Thank you

    Computers, which are built by large manufacturers provided with pre-installed Windows are supplied with 2 two product keys:

    (A) OEM SLP: this key comes pre-installed in Windows, when it comes to the factory. This key is designed to work with the special instructions isn't on the hardware of this manufacturer. Then, when Windows was installed using the OEM SLP (in factory) Windows 7 key leans on the motherboard and he sees special instructions and activates. (that's why you had no need to turn on your computer after you brought it home)

    (B) SLP COA: it's the product key that you see on the sticker on the side (or at the bottom, [or in the battery compartment]) of your computer. It is a valid product key, but must be used only in certain situations (for example, if the OEM SLP key stops automatic activation for a reason any). The key must be activated by phone. (Note: all manufacturers that use the SLP OEM system are bound by contract to include a certificate of Authenticity sticker (COA), which has a COA SLP key, on the computer)

  • Download photoshop for free twice on the same computer with a different account?

    Download photoshop for free twice on the same computer with a different account?

    No, you can use the trial only once on a single computer.

    Concerning

    Hervé Khare

  • Avoid using the same query...

    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    Fanny says:
    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    A few cross join?

    select a, b*cnt, c*cnt, d*cnt
      from t1, (select count(c1) cnt from t2)
    

Maybe you are looking for

  • Windows Longhorn

    I'm happy to walk on the existing system to windows XP is 32 bit or 64 bit processor? and the toshiba notebooks with 64 bit?I Herald the new operating system of window called LONGHORN will be on the market soon, or at the end of this year and will be

  • Equium A60-157 - PCMCIA or USB WLan adapter

    I have an Equium A60-157 and you want to add a wireless adapter.Can someone advise me on a PCMCIA or USB adapter suitable for this model. VIN.

  • OfficeJet 6500 a print is more black

    It seems that I too was victim of the issue of "change the cartridge and cannot print.I changed the black cartridge, cleaned the heads several times and nothing.Print many pages of test - color... Black work does not work.I confirmed that the cartrid

  • Memphis B-mother Board's SATA ports

    I'm a 700-310xt system with a motherboard of Memphis b which is equipped with 5 SATA connectors. I currently have 2 internal hard drives and internal optical drive. I should any problem by adding a 3rd internal HD and a second optical drive internal.

  • Hotel wireless network

    Where can I find it