Please help: WebLogic + BI + SQL Group Authenticator

Hi all, i have big problem with solution on my company project. I please somebody help me.
This is my problem:
I have bifoundation_domain :
WebLogic Server Version: 10.3.5.0
EM 11g
Oracle Business Intelligence 11.1.1.7.0
with this structure:
bifoundation_domain
|- AdminServer
|- bi_cluster
  |- bi_server1
So and i need use Weblogic embedded LDAP (DefaultAuthenticator in realms security providers) and i need loading GROUPS from DATABASE. I read and tried a lot of articles, blogs, manuals but
within positive result.
My procedure is:
In WLS console :
- create jdbc datasource with name "bip_apps_DS"
- create BI SQL Group provider (with name BIGroupLoader) with this settings
<sec:authentication-provider xmlns:ext="http://xmlns.oracle.com/weblogic/security/extension" xsi:type="ext:bisql-group-providerType">
  <sec:name>BIGroupLoader</sec:name>
  <sec:control-flag>OPTIONAL</sec:control-flag>
  <ext:data-source-jndi-name>bip_apps_DS</ext:data-source-jndi-name>
  <ext:sql-list-member-groups>SELECT ROLE_NAME FROM V_SYS_AUTH_ROLES WHERE LOGIN_NAME = ?</ext:sql-list-member-groups>
  <ext:sql-list-groups>SELECT NAME FROM UA_ROLES WHERE NAME LIKE ?</ext:sql-list-groups>
  <ext:sql-group-exists>SELECT NAME FROM UA_ROLES WHERE NAME = ?</ext:sql-group-exists>
  <ext:sql-is-member>SELECT LOGIN_NAME FROM V_SYS_AUTH_ROLES WHERE ROLE_NAME = ? AND LOGIN_NAME = ?</ext:sql-is-member>
  <ext:sql-get-group-description>SELECT DESCRIPTION FROM UA_ROLES WHERE NAME = ?</ext:sql-get-group-description>
</sec:authentication-provider>
(my DB schema is correct)
and i move him on first place in providers list.
So after these steps in WLS console i see in security realm->groups my groups from DB. Everything is OK.
Now i need use GROUPS from my database in EM in the context of create BI users roles (maping BI application roles on GROUPS (enterprise roles)).
So i created a database adapter for the Virtualized Identity Store
this is it:
<?xml version = '1.0' encoding = 'UTF-8'?>
<adapters schvers="303" version="1" xmlns="http://www.octetstring.com/schemas/Adapters" xmlns:adapters="http://www.w3.org/2001/XMLSchema-instance">
  <dataBase id="directoryType" version="0">
  <root>%ROOT%</root>
  <active>true</active>
  <serverType>directoryType</serverType>
  <routing>
  <critical>true</critical>
  <priority>50</priority>
  <inclusionFilter/>
  <exclusionFilter/>
  <plugin/>
  <retrieve/>
  <store/>
  <visible>Yes</visible>
  <levels>-1</levels>
  <bind>true</bind>
  <bind-adapters/>
  <views/>
  <dnpattern/>
  </routing>
  <pluginChains xmlns="http://xmlns.oracle.com/iam/management/ovd/config/plugins">
  <plugins>
  <plugin>
  <name>VirtualAttribute</name>
  <class>oracle.ods.virtualization.engine.chain.plugins.virtualattr.VirtualAttributePlugin</class>
  <initParams>
  <param name="ReplaceAttribute" value="uniqueMember={cn=%uniquemember%,ou=people,ou=myrealm,dc=bifoundation_domain}"/>
  </initParams>
  </plugin>
  </plugins>
  <default>
  <plugin name="VirtualAttribute"/>
  </default>
  <add/>
  <bind/>
  <delete/>
  <get/>
  <modify/>
  <rename/>
  </pluginChains>
  <driver>oracle.jdbc.driver.OracleDriver</driver>
  <url>%URL%</url>
  <user>%USER%</user>
  <password>%PASSWORD%</password>
  <ignoreObjectClassOnModify>false</ignoreObjectClassOnModify>
  <includeInheritedObjectClasses>true</includeInheritedObjectClasses>
  <maxConnections>10</maxConnections>
  <mapping>
  <joins/>
  <objectClass name="groupofuniquenames" rdn="cn">
  <attribute ldap="cn" table="V_SYS_AUTH_ROLES" field="ROLE_NAME" type=""/>
  <attribute ldap="description" table="V_SYS_AUTH_ROLES" field="ROLE_NAME" type=""/>
  <attribute ldap="uniquemember" table="V_SYS_AUTH_ROLES" field="LOGIN_NAME" type=""/>
  </objectClass>
  </mapping>
  <useCaseInsensitiveSearch>true</useCaseInsensitiveSearch>
  <connectionWaitTimeout>10</connectionWaitTimeout>
  <oracleNetConnectTimeout>0</oracleNetConnectTimeout>
  <validateConnection>false</validateConnection>
  </dataBase>
</adapters>
and run command to register:
./libovdadapterconfig.sh -adapterName BIGroupLoader -adapterTemplate bi_sql_groups_adapter_template.xml
-host localhost -port 7001 -userName weblogic -domainPath /OFM/BI/user_projects/domains/bifoundation_domain
-dataStore DB -root ou=people,ou=myrealm,dc=bifoundation_domain -contextName default -dataSourceJNDIName bip_apps_DS
Adapter is creatted successfully within errors!
I restarted managed server(bi_server1) and AdminServer, all bi commponets etc. BUT WITHOUT RESULT. I still dont see GROUPS in Enterprise manager in
BI->coreapplication->security->application roles
I tried set in security setting of webLogic domain in EM virtualize=true.
This procedure is described on all sites but not funkcionaly for me. Do you know somebody where is mistake? Etc. need i installing OVD server? I dont know. Please helm me. after 10 days i really hopeless :( ..so sorry for my english

If you are still looking for sol? send me email  [email protected]

Similar Messages

  • Please help: WebLogic + BI + Bi SQl Group Loader

    Hi all, i have big problem with solution on my company project. I please somebody help me.
    This is my problem:
    I have bifoundation_domain :
    WebLogic Server Version: 10.3.5.0
    EM 11g
    Oracle Business Intelligence 11.1.1.7.0
    with this structure:
    bifoundation_domain
    |- AdminServer
    |- bi_cluster
      |- bi_server1
    So and i need use Weblogic embedded LDAP (DefaultAuthenticator in realms security providers) and i need loading GROUPS from DATABASE. I read and tried a lot of articles, blogs, manuals but
    within positive result.
    My procedure is:
    In WLS console :
    - create jdbc datasource with name "bip_apps_DS"
    - create BI SQL Group provider (with name BIGroupLoader) with this settings
    <sec:authentication-provider xmlns:ext="http://xmlns.oracle.com/weblogic/security/extension" xsi:type="ext:bisql-group-providerType">
      <sec:name>BIGroupLoader</sec:name>
      <sec:control-flag>OPTIONAL</sec:control-flag>
      <ext:data-source-jndi-name>bip_apps_DS</ext:data-source-jndi-name>
      <ext:sql-list-member-groups>SELECT ROLE_NAME FROM V_SYS_AUTH_ROLES WHERE LOGIN_NAME = ?</ext:sql-list-member-groups>
      <ext:sql-list-groups>SELECT NAME FROM UA_ROLES WHERE NAME LIKE ?</ext:sql-list-groups>
      <ext:sql-group-exists>SELECT NAME FROM UA_ROLES WHERE NAME = ?</ext:sql-group-exists>
      <ext:sql-is-member>SELECT LOGIN_NAME FROM V_SYS_AUTH_ROLES WHERE ROLE_NAME = ? AND LOGIN_NAME = ?</ext:sql-is-member>
      <ext:sql-get-group-description>SELECT DESCRIPTION FROM UA_ROLES WHERE NAME = ?</ext:sql-get-group-description>
    </sec:authentication-provider>
    (my DB schema is correct)
    and i move him on first place in providers list.
    So after these steps in WLS console i see in security realm->groups my groups from DB. Everything is OK.
    Now i need use GROUPS from my database in EM in the context of create BI users roles (maping BI application roles on GROUPS (enterprise roles)).
    So i created a database adapter for the Virtualized Identity Store
    this is it:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <adapters schvers="303" version="1" xmlns="http://www.octetstring.com/schemas/Adapters" xmlns:adapters="http://www.w3.org/2001/XMLSchema-instance">
      <dataBase id="directoryType" version="0">
      <root>%ROOT%</root>
      <active>true</active>
      <serverType>directoryType</serverType>
      <routing>
      <critical>true</critical>
      <priority>50</priority>
      <inclusionFilter/>
      <exclusionFilter/>
      <plugin/>
      <retrieve/>
      <store/>
      <visible>Yes</visible>
      <levels>-1</levels>
      <bind>true</bind>
      <bind-adapters/>
      <views/>
      <dnpattern/>
      </routing>
      <pluginChains xmlns="http://xmlns.oracle.com/iam/management/ovd/config/plugins">
      <plugins>
      <plugin>
      <name>VirtualAttribute</name>
      <class>oracle.ods.virtualization.engine.chain.plugins.virtualattr.VirtualAttributePlugin</class>
      <initParams>
      <param name="ReplaceAttribute" value="uniqueMember={cn=%uniquemember%,ou=people,ou=myrealm,dc=bifoundation_domain}"/>
      </initParams>
      </plugin>
      </plugins>
      <default>
      <plugin name="VirtualAttribute"/>
      </default>
      <add/>
      <bind/>
      <delete/>
      <get/>
      <modify/>
      <rename/>
      </pluginChains>
      <driver>oracle.jdbc.driver.OracleDriver</driver>
      <url>%URL%</url>
      <user>%USER%</user>
      <password>%PASSWORD%</password>
      <ignoreObjectClassOnModify>false</ignoreObjectClassOnModify>
      <includeInheritedObjectClasses>true</includeInheritedObjectClasses>
      <maxConnections>10</maxConnections>
      <mapping>
      <joins/>
      <objectClass name="groupofuniquenames" rdn="cn">
      <attribute ldap="cn" table="V_SYS_AUTH_ROLES" field="ROLE_NAME" type=""/>
      <attribute ldap="description" table="V_SYS_AUTH_ROLES" field="ROLE_NAME" type=""/>
      <attribute ldap="uniquemember" table="V_SYS_AUTH_ROLES" field="LOGIN_NAME" type=""/>
      </objectClass>
      </mapping>
      <useCaseInsensitiveSearch>true</useCaseInsensitiveSearch>
      <connectionWaitTimeout>10</connectionWaitTimeout>
      <oracleNetConnectTimeout>0</oracleNetConnectTimeout>
      <validateConnection>false</validateConnection>
      </dataBase>
    </adapters>
    and run command to register:
    ./libovdadapterconfig.sh -adapterName BIGroupLoader -adapterTemplate bi_sql_groups_adapter_template.xml
    -host localhost -port 7001 -userName weblogic -domainPath /OFM/BI/user_projects/domains/bifoundation_domain
    -dataStore DB -root ou=people,ou=myrealm,dc=bifoundation_domain -contextName default -dataSourceJNDIName bip_apps_DS
    Adapter is creatted successfully within errors!
    I restarted managed server(bi_server1) and AdminServer, all bi commponets etc. BUT WITHOUT RESULT. I still dont see GROUPS in Enterprise manager in
    BI->coreapplication->security->application roles
    I tried set in security setting of webLogic domain in EM virtualize=true.
    This procedure is described on all sites but not funkcionaly for me. Do you know somebody where is mistake? Etc. need i installing OVD server? I dont know. Please helm me.

    Hi,
    You will not be able to see groups that you have defined in database in EM. To assign a database group to a role in EM go to BI->coreapplication->security->application roles & search for groups locate Advance Option at the bottom and check the box "Check to enter principal name here instead of searching from above. This option can be used for advanced scenarios related to custom authenticators". Now select Groups under Type and enter the name (exactly same) of the database group manually. Now you should be able to assign database groups to users authenticated through weblogic embedded LDAP.
    Thanks

  • Please help with an sql to show more than one records into single row for each student

    From the following data I would like to create an sql to get the information  as the following layout
    studentid,  firstTerm,  EnglishMark1,ScienceMark1,MathsMark1, Secondterm,EnglishMark2,ScienceMark2,MathsMark2,
    ThirdTerm,EnglishMark3,ScienceMark3,MathsMark3 // As single rows for each student
    Example
    1 First, 30,40,20,Sec,30,40,20,  simillarly next row for next row for another sudent. Please help to generate the sql for the same.
    Please help it would be very appreciate.
    With Thanks
    Pol
    polachan

    create table yourdata (studentid int, term varchar(10), section varchar(50), Mark int)
    insert into yourdata values
    (1,'First','Math',20),(1,'First','English',30),(1,'First','Science',40),
    (2,'First','Math',20),(2,'First','English',30),(2,'First','Science',40),
    (3,'First','Math',20),(3,'First','English',30),(3,'First','Science',40),
    (1,'Sec','Math',20),(1,'Sec','English',30),(1,'Sec','Science',40),
    (2,'Sec','Math',20),(2,'Sec','English',30),(2,'Sec','Science',40),
    (3,'Sec','Math',20),(3,'Sec','English',30),(3,'Sec','Science',40)
    Select studentid
    ,max(case when term='First' and section='English' Then Mark End) as EnglishMark1
    ,max(case when term='First' and section='Science' Then Mark End) as ScienceMark1
    ,max(case when term='First' and section='Math' Then Mark End) as MathMark1
    ,max(case when term='Sec' and section='English' Then Mark End) as EnglishMark2
    ,max(case when term='Sec' and section='Science' Then Mark End) as ScienceMark2
    ,max(case when term='Sec' and section='Math' Then Mark End) as MathMark2
    ,max(case when term='Third' and section='English' Then Mark End) as EnglishMark3
    ,max(case when term='Third' and section='Science' Then Mark End) as ScienceMark3
    ,max(case when term='Third' and section='Math' Then Mark End) as MathMark3
    From yourdata
    Group by studentid
    drop table yourdata

  • Please help on PL/SQL

    Please help me to this PL/SQL command. I want to count(*) from table i got on DEVCHG.REFRESH_TBL_LIST.
    declare
    cnt NUMBER;
    begin
    for tbl in (
         select table_name from DEVCHG.REFRESH_TBL_LIST
    loop
         select count(*) into cnt from tbl;
         DBMS_OUTPUT.PUT_LINE(tbl.table_name||':'||cnt);
    end loop;
    end;
    /

    Hi, try this PL/SQL block. I hope your problem will resolved by this. Revert back with query if any....
    set serveroutput on
    declare
    cnt NUMBER;
    begin
    select count(*) into cnt from DEVCHG.REFRESH_TBL_LIST;
    IF SQL%FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Total count of table is ' || cnt);
    ELSE
    DBMS_OUTPUT.PUT_LINE('No record found');
    END IF;
    end;
    /

  • Please help me with SQL query...

    I need some help to figure out how to do this query...
    Here is the data:
    OriginalMessageID MessageID(PK) ExecDate
    1 1234 10:20
    1 5FE2 10:55
    1 EA33 10:50
    2 4667 11:10
    2 98EA 10:13
    Now I need the MessageID for the latest record for each OriginalMessageID,
    so the result would be:
    MessageID(PK)
    5FE2
    4667
    What would the SQL SELECT look like to get this result....
    Thanks
    Maximu

    select
    country.country,
    count(*) Totalpostspercountry,
    count(distinct post.user_id) Totaldistincuserspercountry,
    count(*)/count(distinct post.user_id) Avgpostsperuserbycountry
    from
    country, muser, post
    where country.location_id = muser.location_id
    and muser.user_id = post.user_id
    group by country.country
    The output is like this for your sample data - hope this is what you were looking for :)
    COUNTRY,TOTALPOSTSPERCOUNTRY,TOTALDISTINCUSERSPERCOUNTRY,AVGPOSTSPERUSERBYCOUNTRY
    England,1,1,1,
    Spain,5,2,2.5,

  • Please help with PL/SQL

    Hi All,
    This is driving me nuts but I can't see what I am doing wrong....
    I have a simple PL/SQL with :
    DECLARE
    xxx NUMBER;
    BEGIN
    FOR z in 1..htmldb_application.g_f02.count loop
    xxx:=htmldb_application.g_f02(z);
    select task_id into present_task from dm_process_steps where process_id=:P34_ID AND task_id = xxx;
    htp.p(xxx);
    IF htmldb_application.g_f02(z) = present_task THEN
    htp.p('PRESENT');
    ELSE
    htp.p('NOT PRESENT');
    END IF;
    END;
    The above fails with:
    ORA-01403: no data found
    However if I replace the marked xxx with the number then the code works fine.
    I do not understand the reason for this since I know that xxx has in fact a value and the select should be valid!
    Kindly asking for any help on this!
    Pawel.

    Scott,
    This will probably be a quite extended but I'll try to make it as clear as possible. I took a different approach to find the element which is causing the problem.
    I have 2 TABLES defined as:
    DM_PROCESS_STEPS
    ID Number
    PROCESS_ID Number
    TASK_ID Number
    TASK_ORDER Number
    DM_TASKS
    TASK_ID Number
    TASK_TITLE Varchar2
    ...and some more columns ...
    On the page I have a PL/SQL Region with:
    DHTML_SHUTTLE (
    pSQL_1=>'select "TASK_TITLE","TASK_ID" from "DM_TASKS"',
    pSQL_2=>'select t.task_title, p.task_id from dm_tasks t,dm_process_steps p where t.task_id = p.task_id and process_id = :P34_ID order by p.task_order',
    pID_1=>'1',
    pID_2=>'2',
    pSort1=>'N',
    pSort2=>'Y',
    pFixed1=>'Y',
    pHeight=>'300',
    pWidth=>'400',
    pImagePrefix=>v('WORKSPACE_IMAGES')
    NOTE: All above code comes from a working shuttle_sample code. The only things I modified were pSQL_1 and pSQL_2
    - In this case I want to have "All available tasks in the first list"
    - Since the syntax for pSQL_2 item must return two columns I wrote a joined queary so that I can see the Task_Title on the second list although this column doesn't directly come from DM_PROCESS_STEPS.
    I also have a After Submit Process which is fired upon pressing an apply button:
    DECLARE
    BEGIN
    -- Clean the Tasks from current Process --
    delete from dump where process_id = :P34_ID;
    -- Populate the Process with new list
    FOR z in 1..htmldb_application.g_f02.count loop
    INSERT INTO DUMP
    (ID,TASK_ID,PROCESS_ID,TASK_ORDER)
    VALUES (DM_PROCESS_STEPS_SEQ.nextval,htmldb_application.g_f02(z),:P34_ID,z);
    END LOOP;
    END;
    Now, the problem is with htmldb_application.g_f02(z) element. If understand correctly (please verify this!) the value of this element is whatever the pSQL_2 returns in the second column. In this case, htmldb_application.g_f02(z) returns the Task_Id.
    However, when I view the contents of the DM_PROCESS_STEPS table I can see that the first row (or rows) contain PROCESS_ID under TASK_ID column !!! This is were I am most confused as I cannot figure out were these htmldb_application.g_f02(z) come from !!!
    For example:
    1. I am trying to edit tasks for a process with process_id = 421:
    2. In my select list I have 3 tasks (who's task_id are 746,782 and 785)
    When executing the above update process I get the following results:
    ID TASK_ID PROCESS_ID TASK_ORDER
    1737 421 421 1
    1738 421 421 2
    1739 421 421 3
    1740 746 421 4
    1741 782 421 5
    1742 785 421 6
    If I am not mistaken the value of
    htmldb_application.g_f02(1) - should be the Task_Id of the first element on my select list
    htmldb_application.g_f02(2) - should be the Task_Id of the second element on my select list and so on....
    Why does htmldb_application.g_f02(1-3) hold a different value is beyond me !
    Questions which bother me:
    - Is there any way to lookup to 'contents' of htmldb_application.g_f02(1) from a separate SQL session or does it has to be in run-time?
    - Perhaps there is a way to flush or clean the htmldb_application.g_f02 ?
    Your help would be greatelly appriciated !
    Regards,
    Pawel.

  • Please, help me with sql sentence

    hi everybody
    i have this sentence
    UPDATE RECIBO SET RECARGO = (SELECT MONTHS_BETWEEN (SYSDATE , (SELECT F_PAGADO FROM RECIBO WHERE N_RECIBO = '0001')) / 12 FROM DUAL);
    this sentence gives no erros, but in fact i want the FLOOR of that result (somethig like this):
    UPDATE RECIBO SET RECARGO = (SELECT FLOOR((SELECT MONTHS_BETWEEN (SYSDATE , (SELECT F_PAGADO FROM RECIBO WHERE N_RECIBO = '0001')) / 12 FROM DUAL) , 0) FROM DUAL);
    but this gives the error:
    ERROR en línea 1:
    ORA-00909: número de argumentos no válido
    please, could somebody help me to get the flloor of the first sentence? thanks!

    Here you go:
    UPDATE recibo
    SET    recargo = FLOOR(MONTHS_BETWEEN(SYSDATE , (SELECT f_pagado
                                                     FROM   recibo
                                                     WHERE  n_recibo = '0001')))

  • Please help with PL/SQL compiler message

    Hi
    When I compile a procedure, I get the message
    "Expected Symbol Name is missing"
    "Procedure created"
    The procedure actually got created in the database and runs.
    Can someone please let me know the meaning of "Expected Symbol Name is missing" and any side-effects of this message?
    Thanks in advance.

    Suresh,
    I'm getting the message when I start the file that has the code for the stored procedure (like @X.sql). The first line of the code is CREATE OR REPLACE PROCEDURE .....
    Thanks

  • Please Help with the sql below for hierarchies

    Hi all.
    I have a table named stg_org_hier whose data looks like this
    i would like to build the hierarchy from BU,AREA,REGION,DISTRICT,TERR
    There are data cyles in the data below
    stg_org has this data
    QTR_CD     HIER_LVL_CD CURR_RDT_ID     DISTRICT_RDT_ID
    2007Q4     AREA     E0F7B00000000     E0F7B00000000
    2007Q4     BU     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B40000088     E0F7B40000000
    2007Q4     REGION     N0F7B40400000     E0F7B40000000
    2007Q4     REGION     E0F7B40700000     E0F7B40000000
    2007Q4     AREA     E0F7B00000088     E0F7B00000000
    2007Q4     AREA     E0F7B40000000     E0F7B00000000
    2007Q4     DISTRICT     N0F6B40405C99     N0F7B40400000
    2007Q4     REGION     N0F7B40400088     N0F7B40400000
    2007Q4     DISTRICT     N0F7B40405M99     N0F7B40400000
    2007Q4     TERR     N0F1B40405201     N0F7B40405M99
    they would like to see the output in the below in the below form
    QTR_CD     HIER_LVL_CD CURR_RDT_ID     DISTRICT_RDT_ID
    2007Q4     BU     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B00000088     E0F7B00000000
    2007Q4     AREA     E0F7B40000000     E0F7B00000000
    2007Q4     AREA     E0F7B40000088     E0F7B40000000
    2007Q4     REGION     E0F7B40700000     E0F7B40000000
    2007Q4     REGION     N0F7B40400000     E0F7B40000000
    2007Q4     DISTRICT     N0F6B40405C99     N0F7B40400000
    2007Q4     REGION     N0F7B40400088     N0F7B40400000
    2007Q4     DISTRICT     N0F7B40405M99     N0F7B40400000
    2007Q4     TERR     N0F1B40405201     N0F7B40405M99
    Here is the sql i have written :
    select curr_terr_rdt_id,district_rdt_id,hier_lvl_cd,level from STG_ORG_QTR_SF_HCHY
    connect by prior
    curr_terr_rdt_id=district_rdt_id

    qtr_cd,hier_lvl_cd,curr_rdt_id,  district_rdt_id
    2007Q4,BU,         E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000088,E0F7B00000000
    2007Q4,AREA,       E0F7B40000000,E0F7B00000000
    2007Q4,AREA,       E0F7B40000088,E0F7B40000000
    2007Q4,REGION,     E0F7B40700000,E0F7B40000000
    2007Q4,REGION,     N0F7B40400000,E0F7B40000000
    2007Q4,DISTRICT,   N0F6B40405C99,N0F7B40400000
    2007Q4,REGION,     N0F7B40400088,N0F7B40400000
    2007Q4,DISTRICT,   N0F7B40405M99,N0F7B40400000
    2007Q4,TERR,       N0F1B40405201,N0F7B40405M99Not having a database at hand right now is helpful this time ;)
    Indenting the data clearly shows that the hierarchy rules are being violated (cycles you are mentioning do not matter in this case):
    Each node must have a unique predecessor except the root having none (in your case data on lines 3 and 4 both point to lines 1 and 2)
    2007Q4,BU,         E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000000,E0F7B00000000
           2007Q4,AREA,       E0F7B00000088,E0F7B00000000
           2007Q4,AREA,       E0F7B40000000,E0F7B00000000
                  2007Q4,AREA,       E0F7B40000088,E0F7B40000000
                  2007Q4,REGION,     E0F7B40700000,E0F7B40000000
                  2007Q4,REGION,     N0F7B40400000,E0F7B40000000
                         2007Q4,DISTRICT,   N0F6B40405C99,N0F7B40400000
                         2007Q4,REGION,     N0F7B40400088,N0F7B40400000
                         2007Q4,DISTRICT,   N0F7B40405M99,N0F7B40400000
                                2007Q4,TERR,       N0F1B40405201,N0F7B40405M99Removing the first data line or changing it's curr_rdt_id will make hierarhical queries work (lines 1 and 2 would better not point to themself)
    Regards
    Etbin
    Message was edited by: Etbin
    user596003

  • Please help in this sql query

    I have table a with columns ca1,ca2,ca3
    and I have a table b with columns cb1, cb2,cb3
    and a and b tables are related with a table's ca2 and b table's cb2
    ca1 not null,ca2 can be null and cb2 is a not null column, cb3 not null
    I want the output of ca1 and cb3
    If ca2 is null then the output should contain ca1 value and null for cb3
    If ca2 is not nulll comparing both it has to return cb3 value..
    Could anybody help me in tis???
    Thanks in advance..

    Hope I understood your requirement.
    SELECT NVL(ca2,ca1) ca1, DECODE(ca2,NULL,ca2,cb3) cb3 
      FROM a, b
    WHERE ca2=cb2

  • Please help with the sql logic

    The below is going to be a record set from for a view from the FROM CLAUSE
    1. Find component DOCUMENT where the document type = Square Metres (DOC.UOM_STD_ID = 'METR_MTR) If any components are found, retrieve the Document records for these components ONLY.
    2. Otherwise, if no components exist with a Document type = Square Metres, look for components with a Document type of Acres (DOC.UOM_STD_ID = 'ACRE'). If found, retrieve the Space Lease records for these components ONLY.
    3. Otherwise, if the Document does not have components with a type = Square Metres or Acres, look for components with the type of (DOC.UOM_STD_ID = 'PARK'). Then retrieve the departments associated with these parking components.
    For Space Lease records above, retrieve the associated Org ID (SPACE.SPORG).
    Return all departments where
    the associated Org Type (ORG.ORGCLASS) = 'NON'
    or the associated Org Type (ORG.ORGCLASS) = 'GD'
    Thank you

    maybe something like:
    SQL> select emp.empno, emp.ename, emp.deptno
      2    from emp,
      3         (select case when (select 1 from emp where deptno = 10 and rownum  = 1) = 1 then 1
      4                      when (select 2 from emp where deptno = 60 and rownum  = 1) = 2 then 2
      5                      else 3
      6                 end case_col
      7            from dual) d1
      8   where deptno = decode(d1.case_col,1,10,
      9                                     2,60,
    10                                     3,70);
         EMPNO ENAME          DEPTNO
          7839 KING               10
          7782 CLARK              10
          7934 MILLER             10
    SQL> in you code it will be something like:
    select ...
       from document t1,        
            (select case when (select 1 from document doc where DOC.UOM_STD_ID = 'METR_MTR' and rownum  = 1) = 1 then 1
                         when (select 1 from document doc where DOC.UOM_STD_ID = 'ACRE' and rownum  = 1) = 2 then 2
                         else 3
                    end case_col
               from dual) d1
    where t1.uom_std_id = decode(d1.case_col,1,'METR_MTR',
                                             2,'ACRE',
                                             3,'PARK',
                                               null);note: untested

  • Please help me  regarding SQl:Exception

    Hi all.
    I am not getting where i am going wrong
    java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where User_ID=0.0' at line 1
    (where 4 and 5 are the fields where i have to insert the data)
    int i=userTeam.getUserIdentification();
    float d1=userTeam.getUserBetTeam1();
    float f1=userTeam.getO1();
      float dd1=d1*f1;
      float d2=userTeam.getUserBetTeam2();
       float f2=userTeam.getO2();
      float dd2=d2*f2;
       try
            Class.forName("com.mysql.jdbc.Driver");
        con=DriverManager.getConnection("jdbc:mysql://192.168.11.250/Bidding","mysql","pennywise");
            ps=con.prepareStatement("insert into Balance values(?,?) where Balance.User_ID=?");
                      ps.setInt(1,i);
                      ps.setFloat(4,dd1);
                      ps.setFloat(5,dd2);
                      int j=ps.executeUpdate();
    .

    Again same error
    java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where User_ID=0.0' at line 1
    Is that what u r saying
    try
       Class.forName("com.mysql.jdbc.Driver");
       con=DriverManager.getConnection("jdbc:mysql://192.168.11.250/Bidding","mysql","pennywise");
       ps=con.prepareStatement("insert into Balance values(Balance.BettingTeam1=?,Balance.BettingTeam2=?) where User_ID=?");
       ps.setInt(1,i);
       ps.setFloat(2,dd1);
       ps.setFloat(3,dd2);
       int j=ps.executeUpdate();
                

  • Please help with better sql plan - full test case

    Hello,
    here is my test case:
    SQL> create table ib_auth_devices(dv_id number(12) primary key , dv_cl_id number(12));
    Table created.
    SQL> create table ib_clients (cl_id number(12) primary key);
    Table created.
    SQL> alter table ib_auth_devices add constraint fk1 foreign key(dv_cl_id) references ib_clients(cl_id);
    Table altered.
    SQL> create table ib_tokens (to_dv_id number(12) primary key);
    Table created.
    SQL> alter table ib_tokens add constraint to_dv_id foreign key(to_dv_id) references ib_auth_devices(dv_id);
    Table altered.
    SQL> create table ib_auth_cards(au_dv_id number(12) primary key);
    Table created.
    SQL>  alter table ib_auth_cards add constraint  au_dv_id foreign key(au_dv_id) references ib_auth_devices(dv_id);
    Table altered.
    SQL> insert into ib_clients values(1);
    1 row created.
    SQL> insert into ib_clients values(2);
    1 row created.
    SQL> insert into ib_clients values(3);
    1 row created.
    SQL> insert into ib_clients values(4);
    1 row created.
    SQL> insert into ib_clients values(5);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> insert into ib_auth_devices values(1 , 1);
    1 row created.
    SQL> insert into ib_auth_devices values(2 , 2);
    1 row created.
    SQL>  insert into ib_auth_devices values(3,3);
    1 row created.
    SQL> insert into ib_auth_devices values(4,4);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> insert into ib_tokens values(1);
    1 row created.
    SQL> insert into ib_tokens values(2);
    1 row created.
    SQL> insert into ib_tokens values(3);
    1 row created.
    SQL> insert into ib_auth_cards values(1);
    1 row created.
    SQL> insert into ib_auth_cards values(2);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select cl_id from ib_clients;
         CL_ID
             1
             2
             3
             4
             5
    SQL> select cl_id from ib_clients cli , ib_auth_devices ad
      2  where
      3  cli.cl_id = ad.dv_cl_id;
         CL_ID
             1
             2
             3
             4
    SQL> select * from ib_tokens;
      TO_DV_ID
             1
             2
             3
    SQL> select * from ib_auth_cards;
      AU_DV_ID
             1
             2
    SQL> select * from ib_clients;
         CL_ID
             1
             2
             3
             4
             5
    SQL> select * from ib_auth_devices;
         DV_ID   DV_CL_ID
             1          1
             2          2
             3          3
             4          4
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_DEVICES' , cascade => true);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_TOKENS'  , cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  exec dbms_stats.gather_table_stats(user , 'IB_CLIENTS' , cascade => true);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_CARDS' ,  cascade => true);
    PL/SQL procedure successfully completed.
    SQL> l
      1  select cli.cl_id from ib_clients cli , ib_auth_devices ad,
      2          (select dv_cl_id as cl_id
      3            from ib_auth_cards, ib_auth_devices
      4            where
      5               au_dv_id = dv_id
      6            ) cards,
      7  (       select dv_cl_id as cl_id
      8            from ib_tokens, ib_auth_devices
      9            where
    10               to_dv_id = dv_id
    11           ) tokens
    12  where
    13  cli.cl_id = ad.dv_cl_id
    14  and cards.cl_id(+)= cli.cl_id
    15  and cards.cl_id is null
    16  and tokens.cl_id(+)= cli.cl_id
    17* and tokens.cl_id is null
    SQL> r
      1  select cli.cl_id from ib_clients cli , ib_auth_devices ad,
      2          (select dv_cl_id as cl_id
      3            from ib_auth_cards, ib_auth_devices
      4            where
      5               au_dv_id = dv_id
      6            ) cards,
      7  (       select dv_cl_id as cl_id
      8            from ib_tokens, ib_auth_devices
      9            where
    10               to_dv_id = dv_id
    11           ) tokens
    12  where
    13  cli.cl_id = ad.dv_cl_id
    14  and cards.cl_id(+)= cli.cl_id
    15  and cards.cl_id is null
    16  and tokens.cl_id(+)= cli.cl_id
    17* and tokens.cl_id is null
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=5 Card=4 Bytes=128)
       1    0   FILTER
       2    1     HASH JOIN (OUTER)
       3    2       FILTER
       4    3         HASH JOIN (OUTER)
       5    4           NESTED LOOPS (Cost=1 Card=4 Bytes=24)
       6    5             TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=1
               Card=4 Bytes=12)
       7    5             INDEX (UNIQUE SCAN) OF 'SYS_C008299' (UNIQUE)
       8    4           VIEW (Cost=1 Card=2 Bytes=26)
       9    8             NESTED LOOPS (Cost=1 Card=2 Bytes=18)
      10    9               TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost
              =1 Card=4 Bytes=24)
      11    9               INDEX (UNIQUE SCAN) OF 'SYS_C008303' (UNIQUE)
      12    2       VIEW (Cost=1 Card=3 Bytes=39)
      13   12         NESTED LOOPS (Cost=1 Card=3 Bytes=27)
      14   13           TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=1 C
              ard=4 Bytes=24)
      15   13           INDEX (UNIQUE SCAN) OF 'SYS_C008301' (UNIQUE)
    Statistics
              0  recursive calls
             12  db block gets
              9  consistent gets
              0  physical reads
              0  redo size
            364  bytes sent via SQL*Net to client
            431  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              8  sorts (memory)
              0  sorts (disk)
              1  rows processedAny ideas about rewriting this query to achive better performance ?
    Oracle version 8.1.7
    Best Regards.
    Grzegorz

    The answer to this question totally depends on the real volumes you have in your tables. Your test case is probably not showing us these volumes.
    However, I see some needless table accesses, so it's probably safe to conclude that this rewrite will speed something up:
    SQL> create table ib_auth_devices(dv_id number(12) primary key , dv_cl_id number(12));
    Tabel is aangemaakt.
    SQL> create table ib_clients (cl_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_auth_devices add constraint fk1 foreign key(dv_cl_id) references ib_clients(cl_id);
    Tabel is gewijzigd.
    SQL> create table ib_tokens (to_dv_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_tokens add constraint to_dv_id foreign key(to_dv_id) references ib_auth_devices(dv_id);
    Tabel is gewijzigd.
    SQL> create table ib_auth_cards(au_dv_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_auth_cards add constraint  au_dv_id foreign key(au_dv_id) references ib_auth_devices(dv_id);
    Tabel is gewijzigd.
    SQL> insert into ib_clients values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(2);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(3);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(4);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(5);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(1 , 1);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(2 , 2);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(3,3);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(4,4);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(2);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(3);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_cards values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_cards values(2);
    1 rij is aangemaakt.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_DEVICES' , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_TOKENS'  , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_CLIENTS' , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_CARDS' ,  cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> set autotrace on explain
    SQL> select cli.cl_id
      2    from ib_clients cli
      3       , ib_auth_devices ad
      4       , ( select dv_cl_id as cl_id
      5             from ib_auth_cards
      6                , ib_auth_devices
      7            where au_dv_id = dv_id
      8         ) cards
      9       , ( select dv_cl_id as cl_id
    10             from ib_tokens
    11                , ib_auth_devices
    12            where to_dv_id = dv_id
    13         ) tokens
    14   where cli.cl_id = ad.dv_cl_id
    15     and cards.cl_id(+)= cli.cl_id
    16     and cards.cl_id is null
    17     and tokens.cl_id(+)= cli.cl_id
    18     and tokens.cl_id is null
    19  /
                                     CL_ID
                                         4
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=10 Card=4 Bytes=128)
       1    0   FILTER
       2    1     HASH JOIN (OUTER)
       3    2       FILTER
       4    3         HASH JOIN (OUTER)
       5    4           NESTED LOOPS (Cost=4 Card=4 Bytes=24)
       6    5             TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=3 Card=4 Bytes=12)
       7    5             INDEX (UNIQUE SCAN) OF 'SYS_C001354381' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       8    4           VIEW (Cost=3 Card=2 Bytes=26)
       9    8             NESTED LOOPS (Cost=3 Card=2 Bytes=18)
      10    9               INDEX (FULL SCAN) OF 'SYS_C001354385' (UNIQUE) (Cost=2 Card=2 Bytes=6)
      11    9               TABLE ACCESS (BY INDEX ROWID) OF 'IB_AUTH_DEVICES' (Cost=2 Card=1 Bytes=6)
      12   11                 INDEX (UNIQUE SCAN) OF 'SYS_C001354380' (UNIQUE) (Cost=1 Card=1)
      13    2       VIEW (Cost=3 Card=3 Bytes=39)
      14   13         NESTED LOOPS (Cost=3 Card=3 Bytes=27)
      15   14           INDEX (FULL SCAN) OF 'SYS_C001354383' (UNIQUE) (Cost=2 Card=3 Bytes=9)
      16   14           TABLE ACCESS (BY INDEX ROWID) OF 'IB_AUTH_DEVICES' (Cost=2 Card=1 Bytes=6)
      17   16             INDEX (UNIQUE SCAN) OF 'SYS_C001354380' (UNIQUE) (Cost=1 Card=1)
    SQL> select cli.cl_id
      2    from ib_clients cli
      3       , ib_auth_devices ad
      4   where cli.cl_id = ad.dv_cl_id
      5     and not exists
      6         ( select 'dummy'
      7             from ib_auth_cards
      8            where au_dv_id = ad.dv_id
      9         )
    10     and not exists
    11         ( select 'dummy'
    12             from ib_tokens
    13            where to_dv_id = ad.dv_id
    14         )
    15  /
                                     CL_ID
                                         4
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=8 Card=1 Bytes=9)
       1    0   FILTER
       2    1     NESTED LOOPS (Cost=4 Card=1 Bytes=9)
       3    2       TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=3 Card=1 Bytes=6)
       4    2       INDEX (UNIQUE SCAN) OF 'SYS_C001354381' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       5    1     INDEX (UNIQUE SCAN) OF 'SYS_C001354385' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       6    1     INDEX (UNIQUE SCAN) OF 'SYS_C001354383' (UNIQUE) (Cost=1 Card=1 Bytes=3)Regards,
    Rob.

  • Please help with the sql

    Hi ALL,
    Test_dpnt is a table.from this i want to find the total no.of applications
    (ssc,ssa,ssb,ssd,map,maq,oet,oet)---total 8.
    parent - 2(since oet is indepentdent)
    children---4
    independent-2
    source_app is the parent applications
    dpnt_app---child application of parent
    source_app dpnt_app
    ssc ssa
    ssc ssb
    ssc ssd
    mad map
    mad maq
    oet oet
    I want the output likethis
    total parent child independent
    8 2 4 2
    How to write the sql for this

    still unclear to me on how you will be able to get the output as
    total parent child independent
    8     2      4     2based on the sample data you have posted below:
    app_srce app_dpnt app_dpnt-typ-c
    43       190      R
    43       191      R
    150      200      R
    150      201      R
    300      300      Rdo you mean by the output should look something like this:
    srce count dpnt count
    2          1        
               1        
    2          1
               1
    1          1or that it needs to count all the rows for each of the 3 columns

  • Is there anyway to turn off the Group MMS texting?  I want to send a mass text but don't want every person to see every other person's response. Please help!

    Is there anyway to turn off the Group MMS texting?  I want to send a mass text but don't want every person to see every other person's response. I am getting ready to have a baby and want to send one text out to friends and family when the baby comes BUT I don't want all of those people to receive the responses.  Can I turn it off temporarily?  Please help!

    Settings > Messages > Group Messaging > Off

Maybe you are looking for

  • Home wireless connection instable

    Hi, I wonder if anybody can suggest me a valid solution: I have an IBM thinkpad with an Aironet PCI wireless LAN adapter. It worked fine with my home wireless router for months. Recently It started to have problems: the connection frequently stops (t

  • How to use Jquery Data Grid in HTML

    can anyone please tell me how to use JQuery Data grid in my HTML page with example. I have one HTML page i want the standard JQuery Data Grid with search and pagination functionality.

  • Zen Vision M Album Cov

    Can someone please tell me I can only see one album cover for all the albums on my player? How can I make it so that it shows the correct ones or just none at all?

  • Oracle BI EE (10.1.3.2): Maximum total number of cells in Pivot Table excee

    I'm trying to build a pivot table report from about source 1.3M rows. When I'm setting CubeMaxPopulatedCells to a small values (10'000 and less) I'm getting error: "Governor limit exceeded in cube generation (Maximum number of populated cells exceede

  • MyUsedLink Function Import in Launchpad Gateway Service

    In the standard delivered Gateway Service for working with Launchpads there is a function import that updates the frequently used counter to whatever the current counter is +1. I have a requirement to provide a button on the UI so that the end user c