Clarification regarding the understanding of the ORACLE CONNECT BY PRIOR Clause

Dear all,

I'm trying to understand the ORACLE CONNECT BY CLAUSE, and I wrote a query to check my understanding.


I wrote the below two queries.

Select the level, lpad ('* ', 2 * (level - 1),'* '). t_ename Ename, empno, sys_connect_by_path(ename,'/') enames, Bishop of PEM
-where empno = empno
Start by empno = 7654
-start with mgr is null
Connect by prior empno = mgr;

LEVEL T_ENAME ENAMES EMPNO, MGR
---------- -------------------- -------------------------------------------------- ---------- ----------
1 MARTIN 7654 7698 /MARTIN

Explanation: Start by EMPNO = 7654 here means, the root node is 7654. Connect BY PRIOR EMPNO = average MGR-> for the empno = 7654 are all the people under him. IE. Mgr with 7654.

Select the level, lpad ('* ', 2 * (level - 1),'* '). t_ename Ename, empno, sys_connect_by_path(ename,'/') enames, Bishop of PEM
-where empno = empno
Start by empno = 7698
-start with mgr is null
Connect by prior empno = mgr

LEVEL T_ENAME ENAMES EMPNO, MGR
--------- -------------------- -------------------------------------------------- ---------- ----------
1 BLAKE 7698 7839 /BLAKE
2 * ALLEN/BLAKE/ALLEN 7499 7698
2 * 7521 7698 WARD/BLAKE/WARD
2 * MARTIN/BLAKE/MARTIN 7654 7698
2 * TURNER, BLAKE/7844 7698 TURNER
2 * JAMES BLAKE/JAMES 7900 7698

Explanation: Start by EMPNO = 7698 here means, the root node is 7698. Connect BY PRIOR EMPNO = average MGR-> for the empno = 7698 are all the people under him. IE. Mgr with 7698.


I UNDERSTAND TO CONNECT BY PRIOR IS CORRECT?

Please correct me if I'm wrong.

Thank you
MK.

Yes, you're right

Kind regards
Sayan M.

Tags: Database

Similar Questions

  • Hi all of that I'm using a connection by prior clause

    Hi all

    In my connect by prior clause, I have a request. I want to pass the values to the query of my outer query. Is this possible in Oracle.Can all help me in this. Also paste my request for your reference

    SELECT rct2.trx_number

    rctl2.customer_trx_line_id

    fifs.flex_value_set_id

    gcc.code_combination_id

    ffvc.child_flex_value

    ffvc.parent_flex_value

    gcc.segment4

    ffvc.description

    ffvc.lvl

    OF ra_customer_trx_all rct2

    ra_customer_trx_lines_all rctl2

    ra_cust_trx_line_gl_dist_all rctlgd

    gl_code_combinations gcc

    (SELECT ffvv.flex_value_set_id

    ffvv.flex_value child_flex_value

    , LEVEL lvl, ffvv.parent_flex_value

    ffvv.description

    OF fnd_flex_value_children_v ffvv

    WHERE 1 = 1

    START WITH ffvv.flex_value = (SELECT

    GCC.segment4

    OF ra_customer_trx_all rct1,.

    ra_customer_trx_lines_all rctl1,

    ra_cust_trx_line_gl_dist_all rctlgd,

    gl_code_combinations gcc

    WHERE rct1.customer_trx_id = rctl1.customer_trx_id

    AND rctl1.customer_trx_line_id = rctlgd.customer_trx_line_id

    AND rct1.customer_trx_id = rctlgd.customer_trx_id

    AND rctlgd.account_class = 'REV '.

    AND rctlgd.code_combination_id = gcc.code_combination_id

    AND rct1.trx_number =: trx_number - want to move here from the rct2.trx_number that comes from the outer query

    AND rctla.customer_trx_line_id =: trx_line_id)-to move rctl2.customer_trx_line_id here which comes from the outer query

    Ffvv.parent_flex_value CONNECT BY PRIOR = ffvv.flex_value) ffvc

    s fnd_flex_value_sets

    fnd_id_flex_segments FIFS

    gl_ledgers l

    WHERE rct2.customer_trx_id = rctl2.customer_trx_id

    AND rctl2.customer_trx_line_id = rctlgd.customer_trx_line_id

    AND rct2.customer_trx_id = rctlgd.customer_trx_id

    AND rctlgd.code_combination_id = gcc.code_combination_id

    AND fifs.flex_value_set_id = ffvc.flex_value_set_id

    AND fifs.application_id = 101

    AND fifs.flex_value_set_id = s.flex_value_set_id

    AND fifs.application_column_name = 'SEGMENT4. '

    AND fifs.id_flex_code = ' GL #

    AND l.chart_of_accounts_id = fifs.id_flex_num

    AND l.ledger_id = rct2.set_of_books_id

    AND rctlgd.account_class = 'REV '.

    AND rctl2.customer_trx_line_id =: trx_line_id - spend Trx id

    AND rct2.trx_number =: trx_number - number of trx Pass

    Hi all

    I have used a workaround to achieve this.

    I created a function and added the query above to function and the values passed as parameters in two places

    Thank you

  • CONNECT by PRIOR Clause

    Hi friends,

    I am using Connect by prior in path, subsequently

    SELECT SOCIETY, EMPLOYEE_NO, DM_EMPLOYEE_NO, DM_COMPANY OF)

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 10, EMPLOYEE_NO 3, 1 COMPANY FROM DUAL UNION ALL

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 3, EMPLOYEE_NO 4, 1 COMPANY FROM DUAL UNION ALL

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 4, EMPLOYEE_NO 5, 1 COMPANY FROM DUAL UNION ALL

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 5, EMPLOYEE_NO 6, 1 COMPANY FROM DUAL UNION ALL

    SELECT 2 COMPANY, EMPLOYEE_NO 11, DM_EMPLOYEE_NO 10, DM_COMPANY 100 DOUBLE UNION ALL

    SELECT COMPANY 2, EMPLOYEE_NO 12, DM_EMPLOYEE_NO 11, 200 DM_COMPANY FROM DUAL UNION ALL

    SELECT COMPANY 2, EMPLOYEE_NO 13, DM_EMPLOYEE_NO 12, 200 DM_COMPANY FROM DUAL UNION ALL

    SELECT COMPANY 2, EMPLOYEE_NO 14, DM_EMPLOYEE_NO 13, 200 DM_COMPANY FROM DUAL UNION ALL

    SELECT DOUBLE UNION ALL COMPANY 3, EMPLOYEE_NO 3, DM_EMPLOYEE_NO 10, DM_COMPANY 100

    SELECT THE COMPANY 4, EMPLOYEE_NO 3, DM_EMPLOYEE_NO 10 DM_COMPANY 100 DOUBLE

    )

    START WITH DM_EMPLOYEE_NO = 10 AND DM_COMPANY = 100

    CONNECT BY (PRIOR EMPLOYEE_NO = DM_EMPLOYEE_NO AND COMPANY BEFORE =: P_COMPANY)

    ORDER OF SOCIETY, EMPLOYEE_NO

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

    I get the following output

    LEVEL OF THE SOCIETY EMPLOYEE_NO DM_EMPLOYEE_NO DM_COMPANY

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

    1           3             10        100         1

    1           4              3        100         2

    1           4              3        100         2

    1           4              3        100         2

    1           5              4        100         3

    1           5              4        100         3

    1           5              4        100         3

    1           6              5        100         4

    1           6              5        100         4

    1           6              5        100         4

    2          11             10        100         1

    2          12             11        200         2

    2          13             12        200         3

    2          14             13        200         4

    3           3             10        100         1

    4           3             10        100         1

    16 selected lines.

    My Question is, why am I Getting The double rows?

    Hello

    So the rows that meet the condition to START WITH are:

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 10, EMPLOYEE_NO 3, 1 COMPANY FROM DUAL UNION ALL

    ...

    SELECT 2 COMPANY, EMPLOYEE_NO 11, DM_EMPLOYEE_NO 10, DM_COMPANY 100 DOUBLE UNION ALL

    ...

    SELECT DOUBLE UNION ALL COMPANY 3, EMPLOYEE_NO 3, DM_EMPLOYEE_NO 10, DM_COMPANY 100

    SELECT THE COMPANY 4, EMPLOYEE_NO 3, DM_EMPLOYEE_NO 10 DM_COMPANY 100 DOUBLE

    These 4 rows will be at LEVEL 1.

    LEVEL 2 will include a line any who meet the conditions CONNECT BY, where PREVIOUSLY referred to LEVEL 1.  If the same row in the table of the lines above matches, then it will appear N times LEVEL 2.

    For example, this line of the sample data

    SELECT DM_COMPANY 100, DM_EMPLOYEE_NO 3, EMPLOYEE_NO 4, 1 COMPANY FROM DUAL UNION ALL

    corresponds to 3 lines at LEVEL 1, so this step appears 3 times to LEVEL 2.

    This explains why the current results.

    If you want to get different results, post the results you want and explain how you get the results of the data. ; in other words, describe what it means to make a line is considered to be one child of another line in the table.

  • Regarding the wifi connection

    This is regarding hp 15-r007tx

    I can not connect to the wifi network. I can only use wired connection. The wifi button is permanently off (orange color). No matter how many times I press on, it is the same and does not detect wifi. Is - this hardware problem or driver. Please provide the steps to solve my problem.

    You can contact me at [email protected].

    Hoping to get a positive feedback.

    Concerning

    Elliott Pépin

    Hello:

    If it is a driver problem, you will see a device controller network under another category of devices in Device Manager.

    Depending on what operating system you installed, you must install the driver Ralink wireless lan and ralink bluetooth software and driver.

    It is the wireless driver for W7/W8:

    http://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdDetails/?spf_p.tpst=swdMain&spf_p.prp_swdMain=wsrp-navigationalState%3DswItem%253Dob_133279_1&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken

    This is the bluetooth driver and software for W7/W8:

    http://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdDetails/?spf_p.tpst=swdMain&spf_p.prp_swdMain=wsrp-navigationalState%3DswItem%253Dob_130390_1&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken

    If you need drivers for W8.1, you can get your laptop support and driver page.

    http://h10025.www1.HP.com/ewfrf/wc/product?product=7089866&cc=us&DLC=en&LC=en&query=15-r007tx&tool=s-002

  • Need a clarification regarding the application of blocking replicated Cache

    Hello
    I need to know what will happen when the locking of the caches replicated when we have configured configuration lease-granularity member or a thread?

    Suppose in my set of 2 members of replicated caches and it extend customers who writes the cached data and another extended which data in caches for its calculation.

    Assume that my setup of the granularity of the lease is a member.
    My definition:
    1. when I say lock on a special touch in all two replicated caches that record with the special key will be locked and no other thread can update this key until I released the lock.
    2. in the course of my number blocking any readers can read the record to the above key.
    3. even if I update the record (while another player reading this record) by consistency it itself will take care of the update data without corrupting the file and give damaged data to the reader.

    Suppose that my setup is thread in granularity of lease
    1 when I say lock it will act as a lock on the thread that is running but not a lock for all replicated nodes.
    2. This is why when two writers say lock they will get the lock but they can update the same record at the same time, and it could make simultaneous update exception
    3 Eventhought writer has acquired the lock and while doing the update any reader can read the data relevant to this record.
    4. the update of data relevant to the particular key will be coherense handle (unless the simultaneous update exception doesnot appear) it self and any player can use data not currupted.


    Please correct me if I'm wrong. I need to know when we have configured member or thread in rental-granularity under implementation of this lock. According to the documentation I've seen replicated caceh supports the feature LOCK_ALL. hope this function means it locks all cache as a global lock.

    Hope you guys can show me a way to add/update records in line while some readers read the same cache.

    Kind regards
    Sura

    Published by: Sura August 3, 2011 20:25

    Published by: Sura August 4, 2011 00:26

    Hi Sura,

    If you use Clients range from updating the replicated Cache, it is recommended to have the following:

    (1) specify the granularity lease = "thread" for the replicated cache,
    (2) prohibit, by convention, explicit locks in any client of the replicated cache, and
    (3) allow customers to extend update the replicated cache via EntryProcessors (http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/appbestextend.htm#CIHCJHFA)

    If the granularity "Member" value, once any thread in this member acquires a lock, another thread running in this node will have access to the lock (and any thread in this member can unlock the key). Having said this, lease-granularity = "thread" restricted access to a key to a single thread within the cluster.

    I hope this helps!

    See you soon,.
    NJ

  • Regarding the Oracle startup command

    Hi all


    Whenever we execute the startup command in sqlplus:

    SQL > startup
    ORACLE instance started.

    Total System Global Area 252776588 bytes
    Bytes of size 450700 fixed
    218103808 variable size bytes
    33554432 buffers of data bytes
    Redo buffers 667648 bytes
    Mounted database.
    Open database.
    SQL >


    Please specify what contains the size of size fixed and Variable?

    I mean what components are fixed and Variable size?

    Thank you!!

    Kind regards
    Sabrina

    Fixed size is somewhat like a "bootstrap". It's not exactly a bootstrap. Think of it as a part of memory where all associated CMS pointers are initialized for the first time. The variable size is the sum of the Shared Pool, the pool of Java and the large pool. I suggest you read AskTom thread below, which explains a lot better that I did.
    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:365088445659

    HTH
    Aman...

  • Regarding the oracle character set change of EE8MSWIN1250 to AL32UTF8

    Hello

    Today I changed EE8MSWIN1250 in AL32UTF8 characters in oracle 10.2.0.1, who does not, here is the summary of the analysis please give me best suggestion how I can go a head with it.

    Database scan summary report

    Started on time: 2012-01-12 20:50:20
    Elapsed time: 2012-01-12 21:20:54

    Time to end started process ID
    ---------- -------------------- --------------------
    1 2012-01-12 20:54:39 2012-01-12 21:19:57
    2 2012-01-12 20:54:39 2012-01-12 21:20:20
    3 2012-01-12 20:54:39 2012-01-12 21:20:37
    4 2012-01-12 20:54:39 2012-01-12 21:19:57
    5 2012-01-12 20:54:41 2012-01-12 21:19:56
    6 2012-01-12 20:54:39 2012-01-12 21:20:43
    7 2012-01-12 20:54:40 2012-01-12 21:19:56
    8 2012-01-12 20:54:40 2012-01-12 21:19:57
    9 2012-01-12 20:54:41 2012-01-12 21:19:57
    10 2012-01-12 20:54:42 2012-01-12 21:19:56
    11 2012-01-12 20:54:41 2012-01-12 21:20:39
    12 2012-01-12 20:54:42 2012-01-12 21:19:57
    2012-01-13 12 20:54:41 2012-01-12 21:19:56
    14 2012-01-12 20:54:42 2012-01-12 21:19:57
    15 2012-01-12 20:54:40 2012-01-12 21:19:57
    16 2012-01-12 20:54:42 2012-01-12 21:19:56
    17 2012-01-12 20:54:40 2012-01-12 21:19:56
    18 2012-01-12 20:54:43 2012-01-12 21:19:56
    19 2012-01-12 20:54:40 2012-01-12 21:20:49
    2012-01-20 12 20:54:42 2012-01-12 21:20:52
    21 2012-01-12 20:54:40 2012-01-12 21:20:21
    22 2012-01-12 20:54:42 2012-01-12 21:19:57
    23 2012-01-12 20:54:40 2012-01-12 21:19:56
    24 2012-01-12 20:54:43 2012-01-12 21:19:56
    25 2012-01-12 20:54:41 2012-01-12 21:19:56
    26 the 2012-01-12 20:54:43 2012-01-12 21:19:57
    27 2012-01-12 20:54:41 2012-01-12 21:19:56
    28 2012-01-12 20:54:43 2012-01-12 21:19:57
    29 2012-01-12 20:54:42 2012-01-12 21:19:56
    30 2012-01-12 20:54:43 2012-01-12 21:19:57
    31 2012-01-12 20:54:43 2012-01-12 21:19:57
    32 the 2012-01-12 20:54:43 2012-01-12 21:19:57
    ---------- -------------------- --------------------

    [Size of the database]

    Tablespace used free total Expansion
    ------------------------- --------------- --------------- --------------- ---------------
    SYSTEM OF 693, M 50, 26, M 50, 720, 00M 1, 06M
    UNDOTBS1 59, 50M 1 150, 50M 1 210, 00M, 00K
    SYSAUX 438, 19M 11, 81M 450, 00M 8 M 62
    TEMP, 00K, 00K, 00K, K 00
    3 USERS, 13M 1, 00M, 88M 5, 00K
    EXAMPLE OF 77, 38M 22, M 63, 100, 00M 108, 00K
    PDESRV 2 771, 25 M 228, 75 M 3 000, 00 M 758, 03 M
    PDEVEGY 1 394, 06 M 105, 94 M 1 500, 00 M 3, 73 M
    PDEREN 1 270, M 63, 229, 38 M 1 500, 00 M 3, 89 M
    ------------------------- --------------- --------------- --------------- ---------------
    Total 6 707, 63 M 1 777, 38 M 8 485, 00 M 775, 42 M

    Most CLOB size is 3982807 bytes

    [Database scanning settings]

    Value of the parameter
    ------------------------------ ------------------------------------------------
    CSSCAN Version v2.1
    Instance name pdent
    Database Version 10.2.0.1.0
    Comprehensive analysis of database type
    Analyze the data TANK? YES
    Character set of database EE8MSWIN1250
    FROMCHAR EE8MSWIN1250
    TOCHAR AL32UTF8
    Analyze the NCHAR data? NO.
    Size of buffer extraction table 1024000
    Number of process 32
    Convertible data capture? NO.
    ------------------------------ ------------------------------------------------

    [Scanning summary]

    Some character in the data dictionary data are not convertible to the new character set
    Some type of character application data are not convertible to the new character set

    [Summary of the Data Conversion dictionary]

    Immutable data type Convertible truncation with loss
    --------------------- ---------------- ---------------- ---------------- ----------------
    VARCHAR2 5 888 961 19 608 0 0
    CHAR 1 097 0 0 0
    LONG 311 066 579 0 0
    25 204 1 901 0 1 CLOB
    VARRAY 22 366 0 0 0
    --------------------- ---------------- ---------------- ---------------- ----------------
    6 248 694 22 088 0 1-total
    Total in % 99 648 0,352% 0.000 0.000%

    The data dictionary cannot be migrated safely using the CSALTER script

    [Application summary of data Conversion]

    Immutable data type Convertible truncation with loss
    --------------------- ---------------- ---------------- ---------------- ----------------
    8 246 189 1 248 156 800 VARCHAR2 0
    CHAR 1 024 547 0 0 0
    LONG 18 639 30 0 0
    CLOB 615 152 7 410 0 0
    VARRAY 2 019 0 0 0
    --------------------- ---------------- ---------------- ---------------- ----------------
    Total 9 906 546 1 255 596 800 0
    Total 88 745 11 248 0.007 0.000% percentage

    [Cabriolet, truncated and distribution data with loss of Table]

    I stuck half as the summary is too long, I'm very new please help out me.

    Thanks and greetings
    Flo
    -------

    It seems that Data Dictionary has some convertible entries. you need to fix this all the objects individually as suggested in metalink Note 258904.1

    Application object has a truncation and entered convertible. For truncation entries, you must increase the size of the column of the completed columns as shown in the .err log file. For convertible entries, you must perform the export/import. Note 1283764.1

  • detect Oracle Connection Manager sessions in the database?

    Hello

    I wonder if it is possible to tell if the user connected to the database through the Oracle Connection Manager proxy or directly.

    Thank you!

    1444209 wrote:

    Hello

    I wonder if it is possible to tell if the user connected to the database through the Oracle Connection Manager proxy or directly.

    Thank you!

    No, no way to detect

  • Access 2007 and Oracle connections

    Where can I find information on the Oracle connection. I'm on Vista and Access 2007.
    The Oracle db is on a remote server that I VPN in.

    Thank you

    You can visit the FAQ of the ODBC from here
    http://www.Oracle.com/technology/tech/Windows/ODBC/index.html

    It is possible that the ODBC for Oracle driver is not installed by default. Download and install the driver from this link.

  • How can I make the ERP Oracle connection same powers as company IDs?

    Hello

    I have to run business with Oracle ERP authentication authentication.

    We have the same credentials for our company interrnal (Gmail and Helpdesk, Jira) Portal, but we have different credentials (username and password) for ERP, as these two password are kept in two separate systems.

    Please suggest me how can I do ERP Oracle qualifications from the society Gmail (AD) identification information so that if we change the passowrd of gmail, then with the same password society we should be able to connect to oracle ERP.

    We are unable to perform such a LDAP authentication through recommonded EBS with SSO and OID integration solution. As for the SSO and the OID, we will require OAM, who is the licensed version. We are 8000 + employees and it will be a huge cost to society. So we dropped this idea.

    Our idea is the following:

    We will define a password hardcoded to the LES for all users to identify the user is a valid user for Oracle EBS.

    When click on Login , happen internal authentication LDAP that identify this same password hardcoded as a password valid internally and then the user is able to see the Oracle ERP homescreen.

    Please suggest me how can I do the LDAP using the OPS (JDeveloper 10.1.3.3.0) authentication.

    Is it possible to do this?

    Assume that POC, we have 2 fields username and password, and properly integrate into our company AD, this means that if I put my AD company credentials, it should allow me to login in there.

    Please suggest how can I do this? is there an API for it? Also suggest me another possible solution for ERP Oracle credentials identical to that of AD.

    Kind regards

    Monika

    Hi Monika,

    First to write all your calls of dbms_ldap in the procedure a pl/sql. Do not call dbms_ldap api functions separately in java.

    Didn't test it, but it should work.

    1 Wrrite a pl/sql package. You can also add create api user.

    create or replace package apps.xxanil_pkg as
    
        function authenticate(p_dn in varchar2, p_password in varchar2 ) return varchar2;
    
        function password_operation ( username varchar2, newpassword varchar2 ) return varchar2;
    
    end;                      
    
    /
    
    create or replace package body apps.xxanil_pkg as
    
        function authenticate(p_dn in varchar2, p_password in varchar2 ) return varchar2 is
            l_ldap_port   number        := 389; --ldap port
            l_ldap_host   varchar2(100) := '';
            l_out         varchar2(1);
    
            l_retval      pls_integer;
            l_retval2     pls_integer;
            l_session     dbms_ldap.session; 
    
            l_string      varchar2(256);
    
            my_attrs     dbms_ldap.string_collection;
            my_message   dbms_ldap.message;
            my_dn        varchar2(256);
            my_entry     dbms_ldap.message;
            x_retval     pls_integer;
            x_dn         varchar2(256);
    
            ldap_base     varchar2(256):= '';
            l_admin_dn    varchar2(256):= '';
            l_admin_pass  varchar2(256):= '';
        begin
            if p_password is null then
                return 'N';
            end if;
    
            l_retval                    := -1;
            dbms_ldap.use_exception     := true;       
    
            begin
                l_session   := dbms_ldap.init( l_ldap_host , l_ldap_port );
                l_retval    := dbms_ldap.simple_bind_s( l_session, l_admin_dn, l_admin_pass );
                my_attrs(1) := 'distinguishedName';
                x_retval    := dbms_ldap.search_s( l_session, ldap_base,  dbms_ldap.scope_subtree, 'sAMAccountName='||p_dn ,my_attrs , 0, my_message);
                my_entry    := dbms_ldap.first_entry(l_session, my_message);
                my_dn       := DBMS_LDAP.get_dn( l_session, my_entry );
                l_retval2   := dbms_ldap.unbind_s( l_session );
                if my_dn is not null then
                   x_dn := my_dn;
                end if;
            exception when others then
                x_dn := null;
            end;      
    
            begin
                l_session       := dbms_ldap.init( l_ldap_host , l_ldap_port );
                l_retval        := dbms_ldap.simple_bind_s( l_session, x_dn, p_password );
                l_retval2       := dbms_ldap.unbind_s( l_session );
                l_out := 'Y';
            exception when others then
                l_retval2       := dbms_ldap.unbind_s( l_session );
                l_out := 'N';
            end;  
    
            if l_out = 'Y' then
                return 'Y';
            end if;            
    
            return 'N';
        exception when others then
            return 'N';
        end;
    
        function password_operation ( username varchar2, newpassword varchar2 ) return varchar2 is
            l_result                    boolean;
            l_out                       varchar2(1) :='N';
            l_user_exist                varchar2(1);
            l_user_password_correct     varchar2(1);
        begin
    
            select decode(count(*),0,'N','Y') into l_user_exist from fnd_user where user_name = username ;
    
            if l_user_exist = 'Y' then  -- user exists
    
                l_user_password_correct := fnd_web_sec.validate_login(username,newpassword);
                if l_user_password_correct = 'N' then  -- user exists but password is wrong. change the password
    
                    l_result := fnd_user_pkg.changepassword(username,  newpassword );
                    commit;
    
                    if l_result then
                        l_out := 'Y';
                    else
                        l_out := 'N';
                    end if;
    
                else -- user exists, password is correct, do nothing
                    l_out := 'N';
                end if;
    
            else -- user not exists. create user here
                null;
            end if;  
    
            return l_out;
        exception when others then
            l_out := 'E';
            return l_out;
        end;   
    
    end;                      
    

    2. decompile LoginCO.class and add after the code before "hashmap.put ("username", s1);". Launch OAExceptions if any statement that may be called by error occurs.

    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
    OADBTransaction txn = am.getOADBTransaction();
    
    CallableStatement csLdap = null;
    String ldapResult =null;
    String sqlldap = "Begin :1 := APPS.xxanil_pkg.authenticate(:2, :3); End;";
    csLdap = txn.createCallableStatement(sqlldap, 1);
    try {
      csLdap.registerOutParameter(1, Types.VARCHAR);
      csLdap.setString(2, s1);
      csLdap.setString(3, s2);
      csLdap.execute();
      ldapResult = csLdap.getString(1);
    } catch (SQLException e) {
      //throw OAException here, cut the process
    } finally {
      try {
      if (cs != null)
      cs.close();
      } catch (SQLException e) {
      //throw OAException here, cut the process
      }
    }
    
    if("Y".equals(ldapResult)) {
      CallableStatement cs = null;
      String result =null;
      String sql = "Begin :1 := APPS.xxanil_pkg.password_operation(:2, :3); End;";
      cs = txn.createCallableStatement(sql, 1);
      try {
      cs.registerOutParameter(1, Types.VARCHAR);
      cs.setString(2, s1);
      cs.setString(3, s2);
      cs.execute();
      result = cs.getString(1);
      } catch (SQLException e) {
      //throw OAException here, cut the process
      } finally {
      try {
      if (cs != null)
      cs.close();
      } catch (SQLException e) {
      //throw OAException here, cut the process
      }
      }
    }
    

    Kind regards

    Anil

  • Oracle: Connect loop in the user data

    I understand when a loop can occur in Oracle. In principle that it is said if a recording is both parent to another node and at the same time he was a child to him, then it may go into a loop.

    But I can't get why my this particular query is running in a loop.

    SELECT Empno, Ename, Job FROM Emp START WITH Empno = 7839 CONNECT BY PRIOR Job='PRESIDENT'

    Can someone please explain to me how these data can result in a loop. I did a CONNECT_BY_ISCYCLE check and found that the closure of the case is KING (Chairman). But I still don't understand how can be possible, that the KING is the President and I do not see anything in which it becomes child and parent to any record in the table.

    Please explain to me, why is it a mistake and where is the loop?

    Thanks in advance.

    Maybe if I pull on the hierarchy of your query, you will see what he is doing...

    PRESIDENT OF KING 7839<-- start="">

    PRESIDENT OF KING 7839<-- prior="" job='PRESIDENT'>

    PRESIDENT OF KING 7839<-- prior="" job='PRESIDENT'>

    .. etc.

    .. etc.

    ANALYST SCOTT 7788<-- prior="" job='PRESIDENT'>

    7902 FORD ANALYST<-- prior="" job='PRESIDENT'>

    7369 SMITH CLERK<-- prior="" job='PRESIDENT'>

    7934 MILLER CLERK<-- prior="" job='PRESIDENT'>

    7900 JAMES CLERK<-- prior="" job='PRESIDENT'>

    CLERK OF 7876 ADAMS<-- prior="" job='PRESIDENT'>

    7566 JONES MANAGER<-- prior="" job='PRESIDENT'>

    MANAGER CLARK 7782<-- prior="" job='PRESIDENT'>

    BLAKE MANAGER 7698<-- prior="" job='PRESIDENT'>

    7499 ALLEN SALESMAN<-- prior="" job='PRESIDENT'>

    7521 WARD SALESMAN<-- prior="" job='PRESIDENT'>

    7654 MARTIN SALESMAN<-- prior="" job='PRESIDENT'>

    7844 TURNER SELLER<-- prior="" job='PRESIDENT'>

    ANALYST SCOTT 7788<-- prior="" job='PRESIDENT'>

    7902 FORD ANALYST<-- prior="" job='PRESIDENT'>

    7369 SMITH CLERK<-- prior="" job='PRESIDENT'>

    7934 MILLER CLERK<-- prior="" job='PRESIDENT'>

    7900 JAMES CLERK<-- prior="" job='PRESIDENT'>

    CLERK OF 7876 ADAMS<-- prior="" job='PRESIDENT'>

    7566 JONES MANAGER<-- prior="" job='PRESIDENT'>

    MANAGER CLARK 7782<-- prior="" job='PRESIDENT'>

    BLAKE MANAGER 7698<-- prior="" job='PRESIDENT'>

    7499 ALLEN SALESMAN<-- prior="" job='PRESIDENT'>

    7521 WARD SALESMAN<-- prior="" job='PRESIDENT'>

    7654 MARTIN SALESMAN<-- prior="" job='PRESIDENT'>

    7844 TURNER SELLER<-- prior="" job='PRESIDENT'>

    Thus, in the first level of the hierarchy is your record START you WITH.

    When all folders are examined, the test of the PREREQUISITE WORK examines the top level folder, determines that he was the PRESIDENT and therefore each record matches this condition.

    Then, each of these folders are evaluated to determine the child records.  At this second level, only KING's post of PRESIDENT, he is the one who would have no record of the child and this WORK PRECONDITION = PRESIDENT will be valid for all records under the 2 KING level.

    This model keeps occurring under each folder KING indefinitely.

  • I out of the CC to my previous laptop and I can not understand how to create the link connection in my new laptop

    I out of the CC to my previous laptop and I can not understand how to create the link connection in my new laptop

    Hi Steven,

    You have the CC of Adobe desktop application installed on your machine?

    In the case is not, please see the help below document to download the same:

    Creative cloud to desktop

    Kind regards

    Sheena

  • Unable to connect to the Oracle Forms cmdlet after 30 Seconds (OATS)

    Hello

    While playback get error of OATS (Oracle Application Testing Suite) am most of the time 'Impossible to connect to the Oracle Forms applet after 30 Seconds (OATS)'.

    Please suggest solution for this type of error. I can't go further with this type of error.

    Kind regards
    Sairam

    Hi Sairam,

    GoTo OpenScript preference and change timeout for reading of the EBS/forms.

    Launch OpenScript, click view and select Preferences OpenScript. Then select Oracle EBS/functional forms under playback. Change timeout value.

    Kind regards
    Dembélé M

  • Oracle connection problem: cannot open the library

    Hello

    I'm using VS2010, Timesten 112241 and ODAC 1120320 on Windows 7. When I try to access database of TT using SQL Developer, for example, it works perfectly, but everything I try to access it from my application, he throws ORA-29158: could not open except for the library. I read a few threads on the forum about this problem, tried to copy the tnsnames.ora, sqlnet.ora and on the record of the new client after installing the ODP, set TNS_ADMIN to locations of files .ora, tns alias, the value, but nothing seems to work. Which library it refers? What Miss me?

    Here is the output of ttVersion:
    TimesTen release 11.2.2.4.1 (64 bit NT) (tt1122_64:53396) 2012-10 - 30 T 06: 32:14Z
    Forum admin: nikola.bajic
    Home Directory Forum: C:\TimesTen\TT1122~1\
    Accessible world
    Demon base directory: C:\TimesTen\TT1122~1\srv\info
    PL/SQL active.

    Here is the output of ttStatus:
    Daemon pid 1872 port 53396 instance tt1122_64
    TimesTen PID 1960 server started on port 53397
    C:\tt_temp\TT_ItemCache data store
    There is no connection to the data store
    Replication strategy: manual
    Agent caching policy: manual
    PL/SQL active.
    C:\users\nikola~1.baj\appdata\roaming\timesten\demoda~1\TT_tt1122_64 data store
    There is no connection to the data store
    Replication strategy: manual
    Agent caching policy: manual
    PL/SQL active.
    C:\users\nikola~1.baj\appdata\roaming\timesten\demoda~1\sampledb_112 data store

    There is no connection to the data store
    Replication strategy: manual
    Agent caching policy: manual
    PL/SQL active.
    Accessible by any group
    End of report

    Here the tnsnames.ora entry:
    tns_item_cache = (DESCRIPTION =
    (CONNECT_DATA =
    (SERVICE_NAME = TT_ItemCache)
    (Server = timesten_client)))

    Here's the code for the app:
    connStr = "user Id =;". Data Source = tns_item_cache;
    GetConnection (connStr);

    private OracleConnection GetConnection (String connStr)
    {
    Con OracleConnection = new OracleConnection (connStr);

    con. Open();
    return con;
    }

    Best regards
    Nikola

    Hello Nikola,

    Could you please put the code you are using, and the exact error you get. In addition, please check the env variables, as CLASSPATH, LD_LIBRARY_PATH and etc. here (java.sql.SQLException: problems with the native/lack of loading methods library )

    Also "verify that the entry in the tnsnames.ora file is associated with a DSN TimesTen or service_name in the simple connection string is set to a DSN TimesTen." (http://download.oracle.com/otn_hosted_doc/timesten/odpnet/readme.htm)

    Best regards
    Gena

  • What is the setting of State regarding the procedures of the Oracle

    You seem like a good place to ask.

    explain the term "Parameter Status" regarding the procedures for Oracle? I am a student rehearsal-review and can't answer

    from what I understand this has nothing to do with the procedures

    a report parameter indicates the overall percentage of a work complete "DataPump.

    *-
    You're right, 'Parameter Status' nothing to do with procedures, unless it's a real parameter called status defined (used) in a particular procedure.

    However, the 'status' column in table _OBJECTS all THEwill show if a procedure is "VALID" or "INVALID" according to whether it compiled without error (s).

    Good luck! : p
    +

Maybe you are looking for