Connection MESG and INOB with additional field

Hi friends,
i'm beginner in ABAP and for this reason i create reports in ABAP query.
So i create query between tables MSEG and INOB (then INOB with AUSP).
In INOB-OBJEK - value is matnr and charg,
but value in this field is: for example 
matnr                    charg
EK759064BK (8 free spaces) 0000000066
EK759064BK (8 free spaces) 0000000067
EK759064BK (8 free spaces)  0000000068
EK759064BK (8 free spaces)  0000000069
EK759064BK (8 free spaces) 0000000070
My idea is to create additional field with MSEG-MATNR and MSEG-CHARG and relate with INOB-OBJEK
(concatenate mseg-matnr mseg-charg into refkey.) 
result is:
EK759064BK0000000066
EK759064BK0000000067
EK759064BK0000000068
EK759064BK0000000069
EK759064BK0000000070
Now my question is how to change code and create additional field like INOB-OBJEK, how to change my code so i have 8 free spaces between MATNR and CHARG?
Edited by: Marin Lyubomirov on Dec 13, 2009 9:39 AM

the ABAP keyword CONCATENATE has a parameter RESPECTING BLANKS
So if you use this this parameter, then you would get the missing 8 spaces, because the material number field is 18 long and your material only 10 long.
Alternative, just use an own field that is 8 long and do the concatenation like this :
concatenate mseg-matnr myfield mseg-charg into refkey

Similar Messages

  • Connect by and start with

    what do these comands do connect by and start with ? please answer thanks

    what do these comands do connect by and start with ? please answer thanks Here's an example that may help. In the EMP table you have all employees of a company; this includes
    all levels, President, managers, and (regular) employees.
    Let's say you want to know who works for who.
    First, just to see who is in the table
    select empno, ename, job from emp;
    EMPNO     ENAME     JOB           MGR
    7901     CLARK     MANAGER            7900
    7902     MILLER     CLERK          7901
    7903     SMITH     CLERK          7905
    7904     ADAMS     CLERK          7906
    7905     FORD     ANALYST          7907
    7906     SCOTT     ANALYST          7907
    7907     JONES     MANAGER     7900
    7908     ALLEN     SALESMAN     7909
    7909     BLAKE     MANAGER     7900
    7910     MARTIN     SALESMAN     7909
    7911     JAMES     CLERK          7912
    7912     TURNER     SALESMAN     7909
    7913     WARD     SALESMAN     7909
    7900     KING     PRESIDENT
    [\CODE]
    Now, using the START WITH and CONNECT BYSELECT LPAD(' ',2*(LEVEL-1)) || ename org_chart,
    empno, mgr, job
    FROM emp
    START WITH job = 'PRESIDENT'
    CONNECT BY PRIOR empno = mgr
    ORG_CHART     EMPNO     MGR     JOB
    KING          7900          PRESIDENT
    CLARK          7901     7900     MANAGER
    MILLER          7902     7901     CLERK
    JONES          7907     7900     MANAGER
    FORD          7905     7907     ANALYST
    SMITH          7903     7905     CLERK
    SCOTT          7906     7907     ANALYST
    ADAMS     7904     7906     CLERK
    BLAKE          7909     7900     MANAGER
    ALLEN          7908     7909     SALESMAN
    MARTIN          7910     7909     SALESMAN
    TURNER          7912     7909     SALESMAN
    JAMES          7911     7912     CLERK 30
    WARD          7913     7909     SALESMAN
    [\CODE]

  • Uploading of cost center data with additional fields

    Hi Gurus,
    I have uploaded the cost center data. now my client has given same data with additional fields data(ORT01, ORT02, TXJCD). first time I have uploaded with LSMW IDOC methos COSMAS1. but in the same idoc the extra field not available. So i have tried recording method for KS02 to upload the data. but the data is not changed. in the sence the additional fields data not loading. while uploading i getting the probelm at TXJCD. it is getting a popup window. i was not able to handle that. Is there any other Basic IDOC to upload the data with all the fields in cost center. BAPI or Direct input program? Thanks in advance

    hi,
    you can  avoid the popup screen by using  OK code.
    ~linganna.

  • Connecting MBA and iphone with bluetooth?

    connecting MBA and iphone with bluetooth?

    Do you have a question specifically?
    How does it work?
    Why isn't my configuration working?
    I'm getting an error message?
    What do I need to do to make it work?
    Otherwise, Yes.

  • Generic UDF to handle empty contexts and contexts with missing fields

    Hi,
    I have been trying to get my head around a UDF for this for a while, but cannot find the solution. I''l start by showing input structure, and expected target structure (subset of an invoice IDoc with 4 line items):
    SOURCE:
    E1EDK01 (0..1)
    E1EDP01
    ---POSEX = 1
    ---E1EDP05
    KOTXT (qualifier) = Z1
    BETRG (amount) = 200,00
    ---E1EDP05
    KOTXT = Z2
    BETRG = 300,00
    ---E1EDP19...
    E1EDP01
    ---POSEX = 2
    ---E1EDP05
    KOTXT = Z1
    ---E1EDP05
    KOTXT = Z2
    BETRG = 400,00
    ---E1EDP19...
    E1EDP01
    ---POSEX = 3
    ---E1EDP05
    KOTXT = Z2
    BETRG = 500,00
    ---E1EDP19...
    E1EDP01
    ---POSEX = 4
    ---E1EDP19...
    TARGET:
    Line
    ---PosId = 1
    ---Price = 200.00
    Line
    ---PosId = 2
    ---Price = N/A
    Line
    ---PosId = 3
    ---Price = N/A
    Line
    ---PosId = 4
    ---Price = N/A
    I want the price from E1EDP05/BETRG where KOTXT = Z1to be set for each line. As you can see the source structure can be split in 4 cases:
    1. for some line items there exist multiple E1EDP05-segments with one of them qualifier Z1 and one corresponding amount field. This is the "perfect" structure and easy to handle.
    2. some line items contains E1EDP05 with qualifier Z1 with no BETRG. Problem-case
    3. some line items contains no E1EDP05-segments with qualifier Z1, but contains other E1EDP05-segments. Can be solved.
    4. some line items contains no E1EDP05-segments at all. Can be solved.
    I need to (I believe) set the context of the KOTXT and BETRG to E1EDP01 since I want one value per line item, irrespective of how many E1EDP05-segments exist per line item. In cases where no value can be found for relevant qualifier (Z1) or no E1EDP05-segments exist for a line item I want a default value to be set (N/A).
    My problem is that all these different cases might occur in the same file, and they mess up the values in each context, leading to wrong BETRG to be picked in some cases (where case 2 exist) since mapWithDefault cannot be used (context contains value for other qualifier).
    Do you know how to handle all these cases?
    Any pseudo-code for an UDF?
    Many thanks for your help!
    Br,
    Kenneth

    Hi Shweta!
    Thanks a lot, your idea didn't completely solve my problem, but pointed me in the right direction and gave me some valuable ideas:)
    For anyone wondering how it is done, I solved it by using your suggested two inputs, along with a third input (constant) which functions as default value for contexts where value-field is missing for a specific qualifier, or in case no segments with desired qualifier exists for a context.
    My mapping now looks like the following (where KOTXT is qualifier and KRATE is value field) for the 3 inputs:
    KOTXT(Context = E1EDP01) \
                                equalsS -->
    Constant(qualifier value) /
    KOTXT(Context = E1EDP05) \
                                equalsS  \
    Constant(qualifier value) /            ifWithoutElse --> removeContexts -->
               KRATE (Context = E1EDP05) /
    Constant(default value) -->
    Then these 3 inputs goes into the following UDF (queue function):
    int j=0;
    boolean contextDone = false;
    for(int i=0;i<a.length;i++)
         if(a<i>.equals("true"))
              if(b[j].equals(ResultList.SUPPRESS))
                   result.addValue(c[0]);
              else
                   result.addValue(b[j]);
              contextDone = true;
              j=j+1;
         if(a<i>.equals(ResultList.CC))
              if (contextDone)
                   contextDone = false;
                   result.addValue(ResultList.CC);
              else
                   result.addValue(c[0]);
                   result.addValue(ResultList.CC);
    This results in a target node created for each context, where context relates to each line item in this case, where each value is either a default value or the value corresponding to the qualifier. This works in all cases where:
    1. there are no segments containing relevant qualifier
    2. there are segments with relevant qualifier, but missing value field
    3. there are segments with relevant qualifier and value field
    Thanks a lot again, Shweta, for guiding me!
    Br,
    Kenneth

  • Brand New 80GB Ipod connects on and off with my usb cable

    hi, i just got a new 80gb ipod for xmas, and when i plug the usb cable to my ipod, it connects sometimes, and sometimes doesnt, and when it does, it disconnects sometimes too, i usually have to keep moving into different usb ports and one will work, then not work again, then work again later. i even tried my friends cable and its the same thing, i think somethings wrong with the port in the ipod, can anyone help ?

    Turn it off.  If it got wet somehow, you may try drying your ipod off.  The slow method would be a sunny window sill.  You could use a hair dryer on LOW, pointing it at the contacts.  When it drys out, charge itand try a hard-reset. If it still doesn't function properly....  ?

  • Enhance Component BP_CONT with additional Field Set

    Hi Experts,
    I want to achieve following scenario. In sales account master, when you create a contact out of an account you get view BP_CONT/ContactQuickCreateEF. This view does not offer the the field set STANDARDADDRESS which is the one used for contact individual address.
    Hence, I want to enhance the view BP_CONT/ContactQuickCreateEF with the field set STANDARDADDRESS from view BP_ADDR/StandardAddress.
    Can you give me a solution on how to enhance view BP_CONT/ContactQuickCreateEF with the wizard. I want to make the STANDARDADDRESS fields (from contact master main address) available here. We do not want to use the Work/Relationship address for contacts.
    Any help on this is higly appreaciated, as I am new to WebUI dev.
    thx
    Makroeis

    For button creation, code in DO_PREPARE_OUTPUT of the result IMPL class after redefining. Once done. On-Click event name should be created in the same IMPL class. This method id where you will code the logic.
    Since the netity would be available from the context node RESULT, you will have the collection for all the entities. STRUCT.BP_GUID  will give you the necessary GUID of the concerned contact person.
    Rg,
    Harshit

  • Database connection encryption and integrity with ColdFusion and Oracle thin client

    As ColdFusion datasource we are using the Oracle thin client to  connect with the database. So, basically we are using a JDBC URL such as  jdbc:oracle:thin:@... and as Driver Class oracle.jdbc.OracleDriver. This works successfully however we would like to set encryption and  integrity parameters as well. In Java this is done similarly by setting a  Properties object prior to getting a connection as follows:
    Properties prop = new Properties();
    prop.put("oracle.net.encryption_client", "REQUIRED");
    prop.put("oracle.net.encryption_types_client", "( DES40 )");
    prop.put("oracle.net.crypto_checksum_client", "REQUESTED");
    prop.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
    OracleDataSource ods = new OracleDataSource();
    ods.setProperties(prop);
    ods.setURL("jdbc:oracle:thin:@localhost:1521:main");
    Connection conn = ods.getConnection();
    Is there a way that I can pass these parameters to the ColdFusion  datasource. Ideally, I would love to do this centrally in such way that a  change to all the cfquery or cfstoredproc is not needed.
    I also know that in application servers such as Oracle AS there is an  option when creating a datasource which says "Add Properties". In there  you can add such properties. So, I was thinking of maybe creating a  JNDI DS in the app. server and then magically connecting to it but this  may have some impacts on the app.
    Besides this I was also thinking of communicating with the CF  datasource through the CF admin API (cfide.adminapi.administrator) and  also the option of extending the Oracle driver so that when CF connects  with it these params are already set.
    I would love to have your professional opinion and suggestions on this.

    I believe the thin driver actually needs the IP address (not the DNS name). Also, is "java" the name of the Oracle instance to which you are trying to connect?
    Try the following:String driver = "jdbc:oracle:thin";
    String dbIP = "W2RZ1NXG01's IP address";
    String dbPort = "1530";
    String dbSid = "java";
    String dbUser = "Admin";
    String dbPswd = "apassword";
    String cnctStr = driver + ":@" + dbIP + ":" + port + ":" + dbSid;
    try
        Class.forName("oracle.jdbc.driver.OracleDriver");
        con = DriverManager.getConnection( cnctStr, dbUser, dbPswd );
        stmt = con.createStatement();
        stmt.executeUpdate(createString);
        stmt.close();
        con.close();
    catch(SQLException ex)
        System.err.println( "The following SQLException occurred: " + ex );
        System.err.println( "Message: " + ex.getMessage() );

  • FAGL_FC_VAL with additional field

    Hi SAP guru,
    I am striving to tranfer the additional account assignments (cost centre) from the original posting. So I have maintained them in the view V_FAGL_FCBAL when performing  the balance valuation for profit and loss accounts with report FAGL_FC_VALUATION (New General Ledger). I am using ECC6.0
    However, the sytem still does not transfer the cost centre at all.
    Would any of you have any idea as to why the system ignores the entries from V_FAGL_FCBAL?
    Kind regards
    taro

    Hello,
    The system behaviour is, If you have Cost Center activated as one of the document split characteristics in the customizing "Define Document Splitting Characteristics for Controlling" in the IMG menu, in such case, the exchange rate difference lines will receive the cost center of the original invoices so that these exchange rate difference lines will be distributed correctly as per the account assignment. From document split point of view, this is necessary. In such case, OKB9 setting does not have any impact. Only if KOSTL (Cost Center)  is not defined as split characteristic at the IMG mentioned above, then OKB9 will be taken into account because document split is not nessary to distribute the amount per cost center.
    Either you have to maintain correct cost center in OKB9 Or active document splitting for your company code in order to get cost center for exchange rate difference line item.
    Hope this information helps.
    Suresh Jayanthi.

  • Weblogic and cmp with blob fields

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

  • How to connect to and communicate with an SQLite database in AIR/Flex

    Hey guys,
    I recently decided I would try programming a vocabulary-training program in AIR, so I could use it on Linux as well. I got stuck pretty soon. I am trying to connect to a local SQLite database and I obviously fail epically. Posting the source code of the application here:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
       <mx:Script>
          <![CDATA[  
               import flash.filesystem.File;
              import flash.data.*;
             import mx.controls.Alert; 
                      private var dbFile:File;
                   private var conn:SQLConnection;
                   // -- AUTO INIT FUNCTIONS --------------------------------------------------- /
                   private function init():void {
                        // Create a File Reference to the Included DB
                        dbFile = File.applicationDirectory.resolvePath( "../slovniky.db" );
                        // Create SQL Connection
                        conn = new SQLConnection();
                        // Event Listener that will tell us when the DB is opened
                        conn.addEventListener(SQLEvent.OPEN, openSuccess);
                        // Event Listener that will tell us if an error occurs
                        conn.addEventListener(SQLErrorEvent.ERROR, openFailure);
                   // -- EVENT HANDLERS -------------------------------------------------------- /
             private function starter() :void {
                  slovickoEn.enabled = true;
                  nazor.enabled = true;
                  odeslat.enabled = true;
                  zrusit.enabled = true;
                  start.enabled = false;
                  // Otevírám spojení s databází v asynchroním módu
                   conn.openAsync( dbFile );
             private function openSuccess( event:SQLEvent ):void {
                        // Pokud se spojení povede!
                        Alert.show("Spojení se zdařilo!");
               private function openFailure( event:SQLEvent ):void {
                        // Pokud spojení selže!
                        Alert.show("Spojení se nezdařilo!")
             private function kontrola() : void {
                  if (nazor.text != "") {
                       if (nazor.text == "Pes") {
                       Alert.show("Správně!");    
                       else {
                       Alert.show("Špatně!! " + "Napsané slovíčko bylo " + nazor.text);     
          ]]>   
       </mx:Script>
       <mx:VBox width="400" height="200"
                   horizontalCenter="0" verticalCenter="0" backgroundColor="#FFFFFF"
                   paddingBottom="20" paddingLeft="20" paddingRight="20" paddingTop="20"
       >
          <mx:HBox width="100%" verticalAlign="middle" horizontalAlign="center">
             <mx:Label text="Anglicky:"/>
             <mx:TextInput id="slovickoEn" editable="false" text="Dog" enabled="false"/>
          </mx:HBox>
          <mx:HBox width="100%" verticalAlign="middle" horizontalAlign="center">
             <mx:Label text="Česky:"/>
             <mx:TextInput id="nazor"  enter="kontrola()" enabled="false"/>
          </mx:HBox>
          <mx:HBox width="100%" horizontalAlign="center">
             <mx:Spacer width="50" height="10"/>
             <mx:Button id="odeslat" label="Odeslat" color="#0D8401" click="kontrola()" enabled="false"/>
             <mx:Button id="zrusit" label="Zrušit" color="#0D8401" enabled="false"/>
          </mx:HBox>
          <mx:HBox width="100%" horizontalAlign="center">
             <mx:Spacer width="50" height="10"/>
             <mx:Button id="start" label="Start" color="#0D8401" click="starter()" enabled="true"/>
          </mx:HBox>
       </mx:VBox>
    </mx:WindowedApplication>
    The Run of the program tells me this:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
         at pes/starter()[C:\air\projects\pes\src\pes.mxml:45]
         at pes/__start_click()[C:\air\projects\pes\src\pes.mxml:93]
    I would appreciate any help or a how-to. I am an absolute beginner with some experience from HTML, CSS, PHP and rarely JS. What am I doing wrong? File attached for easier manipulation as well.
    Erthy

    Hi,
    Here is the complete example for the same with the code.Let me know if you have any issue with this.
    http://shardulbartwal.wordpress.com/2008/04/14/adobe-air-and-sqlite-connectivity/
    with Regards,
    Shardul Singh Bartwal

  • Unable to connect Forms and Report with Oracle 9i database

    Dear All
    Please help
    I have received the following message when i connect Developer 10G Report builder with oracle 9i database.
    scott/tiger@z
    REP-0501:Unable to connect to the specified database ORA-12154:TNS could not resolve service name.
    I have written the following text in tnsnames.ora file.
    # TNSNAMES.ORA Network Configuration File: E:\ora_10g\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    z =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = zkhan-dfml)(PORT = 1521))
    (CONNECT_DATA =
    (SID = dba)
    One more thing that i need to mention,I have also installed Oracle Report 6i and its connecting well.I have installed Oracle database in my own computer.
    Regards

    [email protected] wrote:
    Thanks for the reply,Now my tnsnames.ora file is look like this.
    z =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = zkhan-dfml)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = dba)
    but still facing the same error ,one more thing that i need to mention, I have 3 Oracle home.details are:
    for Oracle database 9i
    for report builder 6i
    for Developer 10G
    Kindly advise.Yes, you definately needed to mention that. That suggests you also have 3 $ORACLE_HOME/network/admin directories, each with its own tnsnames.ora file. So you need to make sure you are hitting the correct one. I'd pick one to be the controlling one and set the TNS_ADMIN enviornment variable to point to it.

  • 'Connect By' and 'Start With' in Discoverer

    Hello,
    I have a hierarchal query to show all child organizations under the parameter ':Parent_ID'
    This is the query, I execute it in SQL Developer normally:
    SELECT el.organization_id_child, ch.name,level*
    FROM hr.hr_all_organization_units org,*
    hr.PER_ORG_STRUCTURE_ELEMENTS el      ,*
    hr.hr_all_organization_units ch*
    WHERE el.org_structure_version_id         = 61*
    AND org.organization_id                     = el.organization_id_parent*
    AND ch.organization_id                      = el.organization_id_child*
    START WITH el.organization_id_parent = :Parent_ID*
    CONNECT BY el.organization_id_parent = PRIOR el.organization_id_child*
    in the below line:
    START WITH el.organization_id_parent = :Parent_ID*
    The hierarchal query will start with parameter value to show all childes under that organization...
    How can I use this simple query in Discoverer !! I am trying to find the START WITH in the discoverer also can not put this query in a new custom folder without removing the parameters.
    Please Help...
    Regards
    Edited by: adelshehri on Oct 21, 2009 2:47 PM

    Hi,
    If you need to use the hierarchical query then you will not be able to pass a Discoverer parameter directly to the start with clause in the custom folder.
    However, you can use a database context as a session parameter and use this parameter in the customer folder. More details on this can be found at LearnDiscoverer
    Also you could put your hierarchical query into a table function passing the parent_id as a parameter to the table function. Then in your custom view you would join this to a table that returns the list of parent ids that you wish to use. e.g.
    select f.organization_id_child, f.name,level
    from hr.hr_all_organization_units par
    , table (hierarchy_function(par.parent_id) f
    where par.organization_id = :parent_id
    Rod West

  • Hierarchical connect by and start with and joins?

    I've got an employees table and an identifiers table. The identifiers table is hierarchical, with parents and children. Each employee has one or more identifiers, but only one identifier is considered the "primary" or root identifier for each employee. Unfortunately, the employee table might be pointing at one of the child identifier rows and not the root. I need a fast query to join the employees with their most current (root) identifier.
    Here's code to define the problem.
    create table employees (employeeid varchar2(8), fakeNationalID varchar2(9), empname varchar2(30));
    insert into employees (employeeid, fakeNationalID, empname) values (1,'001000001','John Smith');
    insert into employees (employeeid, fakeNationalID, empname) values (2,'002000002','James Jones');
    create table realids (realidkey NUMBER, fakeNationalID VARCHAR2(9) not null,
       realNationalID VARCHAR2(9) UNIQUE, parent_realidkey number);
    insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values
       (1,'001000001','111111111',3);
    insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values
       (2,'002000002','222222222',null);
    insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values
       (3,'003000003','333333333',null);
    commit;  
    create or replace function get_parentid (fakeID in VARCHAR2) return varchar2 is
       tempid VARCHAR2(9);
       begin
          select realNationalID into tempid
             from (
               select realNationalID, fakeNationalID
                  from realids
                  start with fakeNationalID = fakeID
                  connect by nocycle prior parent_realidkey = realidkey
                  order by level desc)
                  where rownum = 1;
          return tempid;
          exception
             when NO_DATA_FOUND then
                return NULL;
             when others then raise;
        end;
    select get_parentid('001000001') from dual; -- returns 333333333 because its linked to a parent
    select get_parentid('002000002') from dual; -- returns 222222222 because there is only one child
    select get_parentid('003000003') from dual; -- returns 333333333 because it is the parentWhat I want is to get the highest parent node in realids for each row in employees...
    This works, but is NOT very efficient:
    select employeeid, get_parentid(fakeNationalID) realid, empname from employees;
    employeeid   realid       empname
    1            333333333     John Smith
    2            222222222     James JonesYou can imagine what this would be like with 100K rows or greater. It takes about 3 minutes to run.
    This seemed like a good way to do this, but with a sub query.
    select e.employeeid, e.fakenationalid, e.empname, sub.realnationalid
       from employees,
          (select realidkey, fakenationalid, realnationalid, parent_realidkey
             from realids r
             start with r.fakenationalid = e.fakenationalid
             connect by prior r.parent_realidkey = r.realidkey) subUnfortunately, it produces an invalid identifier on e.fakenationalid (in the start with clause).
    Anyone have any ideas on how to get the top most parent node from the realids for each row in the employees table? In real life there are 6 or more employees tables spread across several remote instances some of which point at children in the realids table and some of which point at the parents. We always want the top most parent realid. Any help would be much appreciated.

    Hi,
    Thanks for posting the sample data in such a convenient form!
    It always helps to post your Oracle version, too, especially when dealing with CONNECT BY queries.
    The following does what you requested in Oracle 10:
    WITH     got_roots   AS
         SELECT     CONNECT_BY_ROOT     fakenationalid     AS leaf_id
         ,     realnationalid
         FROM     realids
         WHERE     CONNECT_BY_ISLEAF     = 1
         START WITH      fakenationalid IN ( SELECT  fakenationalid
                                              FROM    employees
         CONNECT BY     realidKEY     = PRIOR parent_realidkey
    SELECT     e.employeeid
    ,     r.realnationalid
    ,     e.empname
    FROM     employees     e
    JOIN     got_roots     r     ON     r.leaf_id     = e.fakenationalid
    ;In any query, calling a user-defined function for each row is going to be slow. Fortunately, Oracle now has built-in functions and operators that can take the place of get_parentid. The CONNECT_BY_ROOT operator, which was introduced in Oracle 10, is the key to this problem. In Oracle 9, you can get the same results using SYS_CONNECT_BY_PATH.
    It's usually faster to do the CONNECT BY query separately, and then join whatever other tables you need to the results.
    You had a good idea in your last query. The problem was that sub and employees were equal tables in the FROM clause, and you can't correlate equals. You can only correlate a sub-query to its super-query. You could make that general idea work by changing sub into a scalar sub-query,which could be correlated to employees, but I think it would be a lot less efficient than what I posted above.

  • 802.11n connection comes and goes with 10.5.2 update

    Running 10.5.2 with Mac Pro Quad Core and Airport Extreme base station on latest firmware.
    802.11n loses signal randomly (airport icon goes grey), all I have to do to get it back is act like I'm going to choose a new network (click on airport icon in the menu bar) and then let go of the menu without choosing anything and voila, back.
    802.11g works fine... if I switch the base station to b/g compatible no drop outs. This however, is not a solution in my book.
    No problems prior to 10.5.2

    Check this out before someone deletes it.
    http://discussions.apple.com/thread.jspa?threadID=1389855
    Also
    http://discussions.apple.com/thread.jspa?threadID=1428660
    and
    http://discussions.apple.com/thread.jspa?threadID=1231631
    I tried everything (and believe me my job is to sort out stuff like this). If someone brought back a machine like this to where I work I would tick a box on a form that says 'pre-loaded software fault' and send it back.
    I have gone back to Tiger as I cannot maintain a wireless connection or stop all my applications from randomly quitting etc etc etc. Of course a small minority have given me excessive grief for daring to state that this is apple's fault but hay ho.
    PS you are lucky if it always comes back as you have described. Imagine you had to reboot several times an hour. Windows 95 anyone?

Maybe you are looking for

  • I converted my resume from PDF to word, now how do I edit the spacing as I add information?

    This is not functioning like a word file.  I upgraded because I needed to add a couple dates to my resume, as well as one job, but when I did the formatting and margins are funky and I cannot add portions to the document.  What do I do? Beth

  • WorkBook Formatting.

    Hello All, Can i get parent child relation of hierarchies in Workbook if i need to do further formatting of hierarchies in Workbook. If yes how where can i get these relationship. Thanks in advance,

  • Pdf view : jumping back problem ?

    Hello. I've been having an issue lately where i view pdfs on Acrobat.com, and when i drag the sliders up, the page first jumps to its top, then slides normally from where it should be. Correct behaviour while dragging sliders to the bottom : pages fl

  • Ipod doesn't show up after snow leopard update

    since i made the snow leopard update my iPod doesn't show up in iTunes, in iPhoto it still works... any ideas to solve my problems?

  • Delete # in string

    Hi, I have used below code for notes field in the layout: <thtmlb:textArea cols = "164" rows = "5" height = "300" width = "100%" text = "//NOTES/NOTES" disabled = "FALSE" /> To retrive the above text i am using below code: CALL METHOD lr_property_not