Supertype and Subtypes

Hello,
I created an employees table with 3 types, although when I insert the values, it works but doesn't display the last value which is from a different type. Any idea how to fix this?
DROP TYPE employees_type FORCE;
DROP TYPE hourly_employees FORCE;
DROP TYPE salaried_employee FORCE;
DROP TYPE consultant_employee FORCE;
DROP TABLE employees;
CREATE OR REPLACE TYPE employees_type AS OBJECT
emp_id CHAR(4) ,
fname VARCHAR2(20),
lname VARCHAR2(20),
date_hired DATE ,
emp_type CHAR(1)
)NOT FINAL;
CREATE OR REPLACE TYPE hourly_employees UNDER employees_type
hourly_rate NUMBER(6,2)
)NOT FINAL;
CREATE OR REPLACE TYPE salaried_employee UNDER employees_type
annual_salary NUMBER(9,2),
stock_option     CHAR(1)
)NOT FINAL;
CREATE OR REPLACE TYPE consultant_employee UNDER employees_type
contract_number NUMBER,
billing_rate     NUMBER(8,2)
CREATE TABLE employees OF employees_type;
INSERT INTO employees
VALUES (hourly_employees(1234,null,null,null,null,0));

SQL> SELECT TREAT(VALUE(e) AS hourly_employees)
  2    FROM employees e
  3   WHERE VALUE(e) IS OF(hourly_employees);
TREAT(VALUE(E)ASHOURLY_EMPLOYEES)(EMP_ID, FNAME, LNAME, DATE_HIRED, EMP_TYPE, HOURLY_RATE)
HOURLY_EMPLOYEES('1234', NULL, NULL, NULL, NULL, 0)or
SQL> SELECT e.*,
  2         TREAT(VALUE(e) AS hourly_employees).hourly_rate AS hourly_rate
  3    FROM employees e
  4   WHERE VALUE(e) IS OF(hourly_employees);
EMP_ FNAME                LNAME                DATE_HIR E HOURLY_RATE
1234                                                                0Regards

Similar Messages

  • Resolving Supertypes and Subtypes in the Database Design Transformer

    Hi,
    I have a design question re. converting Logical to Physical Data Models in Designer.
    For the mapping approach from my ERD to my SMD, I chose the Implicit Subtype Implementation, i.e. separate tables for each subtype and for the supertype. However, the subtypes have all the supertype columns. I wondered why Designer enforces this? It makes my SMD very cluttered. I would prefer to have the supertype columns in the supertype only.
    But, before you ask, I know this can be avoided by chosing the Arc Implementation. The problem I have with this approach is that the supertype has a separate FK column for each subtype. I am potentially dealing with many subtypes (50+), so am concerned about the number of null id columns in the supertype table. (Have used this approach before, but with only a handful of tables.)
    Thanks,
    Antony

    The reason that DDT creates one FK column per subtype is that Oracle cannot enforce referential integrity if the same FK references more than one table. You could reverse the foreign keys and have the subtype tables reference the supertype table, but I'm not sure that DDT can generate this - I guess I'd have to try it. Actually, null columns take up little or no space, so they really shouldn't cause a problem. If I remember correctly, the keys are enforced as exclusive arcs - only one of the FKs can be not null.

  • Info type and subtype to stop income tax deduction for a month

    can i know how to stop income tax deduction for a month for a specific employee. I understand that this s possible

    Hi
    You can use additional wage type (infotype 0015)
    and subtype voluntary tax std is MVT1 as per SAP
    if you maintain 0.01 value here and indicating the month
    SAP calculated income tax is supressed and this is how u can stip income tax deduction for a month
    with regards
    partha
    keep sharing and learning

  • SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype

    Hi,
    i have created web service link which deals with calling a Pl/sql procedure with the help of DBAdapter in jdev 10.1.3.4 .here i am trying to insert a row in tables.my webservice is working fine from BPEL console
    my collegue who is working on PHP is trying to access the the wsdl link with the help of Appcelator and php
    code for php
    <?php
    //include("general.php");
    $wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/CreateRepairOrder/1.0/CreateRepairOrder?wsdl';
    //$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl';
    $client = new SoapClient($wsdl_url,array('trace' => 1,'exceptions' => 0));
    print_r($client);
    exit;
    class CreateOrderNd
    var $PARTY_ID="";
    var $CUST_ACCOUNT_ID="";
    var $INVENTORY_ITEM_ID="";
    var $SERIAL_NUMBER="";
    var $UNIT_OF_MEASURE="";
    var $QUANTITY="";
    var $ITEM_CROSS_REFERENCE="";
    var $PROBLEM_DESCRIPTION="";
    function CreateOrderNd($PartyNam,$AccountId,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
    $quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata)
    $this->PARTY_ID=$PartyName;
    $this->CUST_ACCOUNT_ID=$AccountId;
    $this->INVENTORY_ITEM_ID=$ItemId_requestdata;
    $this->SERIAL_NUMBER=$SerialNumber_requestdata;
    $this->UNIT_OF_MEASURE=$uom_requestdata;
    $this->QUANTITY=$quantity_requestdata;
    $this->ITEM_CROSS_REFERENCE=$ItemCrossReference_requestdata;
    $this->PROBLEM_DESCRIPTION=$ProblemDescription_requestdata;
    $parm = new CustomerNd($PartyName_requestdata,$AccountId_requestdata,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
    $quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata);
    $parm = new CustomerNd('Bus%','');
    $parm = new CreateOrderNd(4429,1608,6761,'0722AB05','Ea',1,'abc123','Network error');
    $ret=$client->process($parm);
    print_r($ret);
    ?>
    when she/he access it they are facing a error
    SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype
    and some times it will give
    Warning: SoapClient::SoapClient(http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl) http://function.SoapClient-SoapClient: failed to open stream: HTTP request failed! in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
    Warning: SoapClient::SoapClient() http://function.SoapClient-SoapClient: I/O warning : failed to load external entity "http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl" in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
    Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl' in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6

    Hi,
    i have created web service link which deals with calling a Pl/sql procedure with the help of DBAdapter in jdev 10.1.3.4 .here i am trying to insert a row in tables.my webservice is working fine from BPEL console
    my collegue who is working on PHP is trying to access the the wsdl link with the help of Appcelator and php
    code for php
    <?php
    //include("general.php");
    $wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/CreateRepairOrder/1.0/CreateRepairOrder?wsdl';
    //$wsdl_url = 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl';
    $client = new SoapClient($wsdl_url,array('trace' => 1,'exceptions' => 0));
    print_r($client);
    exit;
    class CreateOrderNd
    var $PARTY_ID="";
    var $CUST_ACCOUNT_ID="";
    var $INVENTORY_ITEM_ID="";
    var $SERIAL_NUMBER="";
    var $UNIT_OF_MEASURE="";
    var $QUANTITY="";
    var $ITEM_CROSS_REFERENCE="";
    var $PROBLEM_DESCRIPTION="";
    function CreateOrderNd($PartyNam,$AccountId,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
    $quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata)
    $this->PARTY_ID=$PartyName;
    $this->CUST_ACCOUNT_ID=$AccountId;
    $this->INVENTORY_ITEM_ID=$ItemId_requestdata;
    $this->SERIAL_NUMBER=$SerialNumber_requestdata;
    $this->UNIT_OF_MEASURE=$uom_requestdata;
    $this->QUANTITY=$quantity_requestdata;
    $this->ITEM_CROSS_REFERENCE=$ItemCrossReference_requestdata;
    $this->PROBLEM_DESCRIPTION=$ProblemDescription_requestdata;
    $parm = new CustomerNd($PartyName_requestdata,$AccountId_requestdata,$ItemId_requestdata,$SerialNumber_requestdata,$uom_requestdata,
    $quantity_requestdata,$ItemCrossReference_requestdata,$ProblemDescription_requestdata);
    $parm = new CustomerNd('Bus%','');
    $parm = new CreateOrderNd(4429,1608,6761,'0722AB05','Ea',1,'abc123','Network error');
    $ret=$client->process($parm);
    print_r($ret);
    ?>
    when she/he access it they are facing a error
    SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype
    and some times it will give
    Warning: SoapClient::SoapClient(http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl) http://function.SoapClient-SoapClient: failed to open stream: HTTP request failed! in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
    Warning: SoapClient::SoapClient() http://function.SoapClient-SoapClient: I/O warning : failed to load external entity "http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl" in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6
    Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://sfhyd1.softforce.com:8888/orabpel/DepotExtnDev/UpdateROStatus1/1.0/UpdateROStatus1?wsdl' in C:\xampp\htdocs\DepotExtensions\version9\app\services\CreateOrderNd.class.php on line 6

  • Infotypes and subtypes ESS WebDynpro

    Hi,
    How to find which infotype(and subtype) the specific ESS WebDynpro is storing(retrieving) information from?? There is not much information on ESS Business package or help.sap.com. There is not much on Service market place also....
    I am also looking for information on all the WebDynpros of ESS Business Package.
    Thanks

    Hi Santhosh,
    If you haven't already looked at it, there is some info available in <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/6a/5bc8a009d54fcaa8e06c826a57253b/content.htm">SAP Help</a>
    probably not exactly what you wanted..
    Regards,
    Suresh Datti

  • Change time constraint of Infotype 0006 subtype 1 and subtype 2

    Hi
    Can anyone tell me how to change the TC of infotype 0006 subtype 1 and subtype 2.
    Currently I tried to change the TC in table V_T582A but its giving me an error : "Text maintenance not permitted as infotype part of Data Sharing (T582G)  "
    Can anyone please advise.
    Currently the TC is T
    I want to change it to 2.

    hi ,
    you can use SE38 to create a report like :
    to change the time constraint for IT0006 +subty 1 + 2
    REPORT  ZTEST.
    tables: t591a.
    data: wt_tc type table of t591a.
    select * from t591a into table wt_tc where infty = '0006' AND
                                                 ( subty = '1' OR
                                                  subty = '2').
    if sy-subrc = 0.
    loop at wt_tc into t591a.
    t591a-zeitb = 'x'. "new TC that you need
    modify table t591a from t591a.
    endloop.
    endif.
    regards

  • What is infotype 0105 and subtype 9050 updation?

    I got a spec, need to notify supervisor thru mail, whether pernr attached to a position, with failure or success message.
    But I need to update Infotype 0105 and subtype 9050.
    Where can I see whether these 2 updated or not.
    Thanks

    Hi,
    Go to table PA0105.
    All the infotypes table start with PA<infotype number>
    Regards,
    Atish

  • Loosing preset for Entity and Subtype generation

    I can change the two options in
      Entitiy Properties->Subtypes->Entitiy and subtypes generation preset
    and the change has some kind of effect. But when I save and reopen the model the changes are lost. And during the next engineering some strange things happen.
    Is this a bug in my model or a bug in the modeler?

    it's not a property, it's preset functionality - Entity Inheritance
    Philip

  • Subtype supertype and delegationtype

    i need to create an object type zself which is delegated to BOR selfitem
    on going to settings and clicking on delegate i see a few BOR objects i dont see self item so i went ot new entries and treid to create one
    it asks for objecttype:?(is it selfitem)
    delegation type:?
    2.in the tcode swo1 i wrote zself and on the top of it there is subtype creation i ihave clicked on it it asked for super type where i have given it as selfitem
    i could create one
    but does it imply that it is delegated to selfitem with out physycally going to
    settings tab and delegating

    Hii Kittu,
    For ur first query------
    Yes, U need to give SELFITEM as object type and in delegation type, give z-object name and save it.
    delegation will be created.
    For ur 2nd Query-------
    No, Subtype creation is similar to inheritance i.e. u have created a child of parent object, thus it accesses all the methods, attri etc.
    . Now u can extend this for ur own requirement.
    But delegation means the changes (rather extension u r doing in z-object), u can access it in standard object (In other words u r editing the standard object).
    So u explicitly need to create a delegate for this. Only subtype creation is not suffice.
    Another thing to add, U can create any no of subtypes for a BO but only 1 delegate for it.
    hope it solves ur query.
    <b>"Dont forget to reward points if helpful"</b>
    regards,
    Ashish

  • Fwd.Eng issue with self-relation and subtypes.

    This issue can be a bug as well. I'm not sure what to expect from FE when acting in this case:
    - a logical model
    - 1 entity
    - 1 subtype.
    - a self-relation, 1-1, optional-optional. Models the concept of "revision of"
    - FE
    - download the model here: [http://www.filesavr.com/HEZ551R6P4HUZXB|http://www.filesavr.com/HEZ551R6P4HUZXB]
    what went wrong
    - the relation has given birth to 2 FK.
    - both a self-FK,
    - both insisting on same column.
    what should happen.
    - I dunno what's right in this context. In my mind, and optional-optional 1-1 => 1 FK.
    - Arises only in presence of subtypes, even if subtypes aren't involved in relations.
    Consideration.
    If one of the ends on the relations is changed to non-optional, the issue disappear.
    The box "dominat role" can be used, due to subtyping. It makes the issue disappear. NB: the combo box list is a little weird.
    Edited by: T. on May 27, 2011 5:19 AM
    Edited by: T. on Jun 1, 2011 12:28 AM

    Here is the odd listing under DominantRole [http://postimage.org/image/2e8qxtls4/]

  • Getting the data for the infotype 0006 and Subtype 4 in HR ABAP

    Hi All,
       I need to get the data from the info type 0006 and the subtype 4 , only i need to fetch the data in communications . Could you any one tell me best way to fetch that data.
    Thanks,
    SAP SAR.

    Write a select single on PA0006 for the given pernr begin and end dates and for subtype 4 ...
    select single * from PA0006
               where pernr = p_pernr
               and SUBTY = '0004'
               and ENDDA >= s_date-low
               and BEGDA <= s_date-high.

  • Regarding infotypes and subtypes

    from i can get the list of all subtypes related to a particular infotype?

    Hi,
    There is lot of ways
    I will tell u to see easy way
    Go to PA30 and give some Personnel No and give Infotype no then press enter now press F4 by placing cursor in subtypes field
    now u can see the all subtypes
    regards,
    Nandha
    Reward if it helps

  • Business objects and subtyping

    Hi,
    I recently went through a very intriguing article on BOR at
    www.sapgenie.com/abap/bor.htm
    The article has raised several questions in my mind.
    1) Has SAP brought all of the Business Processes to the Business Objects? I mean, can everything be done ( like creating/changing materials in MM, creating sales documents in SD etc) using BO alone? In other words, is the entire business functionality covered in the BOR?
    2) Do the Business Objects call the transactions or the Transactions call the Business Objects?
    This doubt has aroused because the article mentions that when we change the password of a customer the CHANGEPASSWORD method of BO KNA1 is called. And, in contrast, I found that some BAPI's(not CHANGEPASSWORD) called by the BO methods actually use 'CALL TRANSACTION' statements.
    3) If the transactions actually do call the BO methods, will the subtyped method be called after delegation even when the transactions make a call to the BO?
    I was not able to find satisfying answers anywhere, neither on Internet nor the SDN Forums. Please help me find some answers. Or atleast, if possible, please send me some links or forward this mail to any of your friends who might be able to help me.
    Thanks in advance.
    Anand.

    Hi Anand,
    1) No.  BOR is a wrapper and uses old techniques.  From a workflow perspective ABAP OO is better.  There is still a place currently for BOR as a BAPI reference tool, but I'm expecting that with the Business Process Platform we will have some alternative for BOR altogether at some point.  What I think you are really getting towards is the Business Process Platform ... in which case you might find the Business Process Expert forum interesting. But that's a much broader topic than workflow.
    2) Both is possible but in general the BOR calls the transaction.  There are a few "naughty" BAPIs that cop out and call transactions but they are mercifully few.
    Tranactions do use BOR e.g. to call Generic Object Services features.   All of this will change with the Business Process Platform anyway when hopefully we have more BAPI-like method calls to use and are less restricted by monolithic transactions.
    3) Yes delegation would still apply in the scenario you describe - although I can't think of an example where we actually do that - as per the answer to 2., that's not usually how it works.
    In the meantime, start learning ABAP OO for Workflow.
    My Blog series is currently available - first 3 blogs are now available. 
    Regards,
    Jocelyn

  • Syntax and subtype

    What is the different between "binary syntax" and "binary subtype" ?
    Can someone tell me about this basic concept ?
    I've configured "client certificate authentication". In the schema, "userCertificate" has "binary syntax (2.5.4.40)", but if you just enter plain without "binary subtype", the authentication doesn't work.
    This is work, if you enter in "ldapmodify" :
    userCertificate;binary: < file:/// ......
    This isn't work
    userCertificate: < file:///....
    thanks in advance,
    martin

    Binary syntax was underspecified. This is why it's been removed from the new LDAPv3 specifications (RFC 4510-4522).
    RFC 4517 says:
    The Binary syntax has been removed because it was not adequately
    specified, implementations with different incompatible
    interpretations exist, and it was confused with the ;binary
    transfer encoding.
    The ;binary transfer option is an LDAP artifact to cope with the fact that LDAP community wanted to treat certificates as blob and not as complex structured encoded data (a Certificate has an ASN.1 description, a DER encoding and X.500 refers it by the complete syntax).
    When adding or retrieving userCertificates from an LDAP server with LDAPv3, the client application must use the ;binary transfer option to indicate to the server that the encoded value of the userCertificate attribute is considered as a blob.
    It is a protocol violation to use userCertificate without the ;binary transfer option with LDAPv3.
    Also, as Sun developers fully understood all of the issues with the binary vs ;binary option there has been some changes in the way Directory Server stores the attributes that had this binary syntax... The latest available version (5.2patch4) has a consistent behavior and a few flags for backward compatible behaviors.
    Regards,
    Ludovic.

  • Object Diagrams that support user define type (create type....and subtypes

    Hello it would be very nice to be able to use user define types in a diagram, at this time oracle, ibm db2 9 and sql server 2005 suport sql ansi 2003 and to use all this potential we have to take tecnology foward. My sugestion is create object diagram that can help design all this funtionability, rational rose has the oracle8 addin this will give you an exact idea of what i am asking.
    Thanks for your atention and let me know if you are planing to do this.
    Perhaps this is not the right forum please tell me where I can send this as a future requests

    JDeveloper has a UML class diagram with transformation into a Java class diagram - are you looking for anything beyond that?

Maybe you are looking for

  • Can't burn more than 1 DVD

    So I finally got iDVD to work - I can't use a theme or anything, I'm just burning "one Step DVD from Movie..." I'll deal with the theme problem later but I really need these DVDs burned by tomorrow... so here's the problem: I burn the DVD just fine,

  • Converting to Upper Case

    Hi Guys, I facing weird issue in the report.I have a 0SPM_Plant  Master data as Berlin (Upper and Small Case).Is there any option to convert the Berlin to BERLIN in the reporting not in modeling.I have taken 0SPM_Plant as a reference of 0Plant. Pleas

  • Scrollbar Help Appreciated!

    Hello everyone, this is my first post and was hoping for some advice. I am fairly new to Flash, I have no idea about Actionscript, a part from stop(); I have designed a button that when you put your mouse over, it slides out using a motion tween to r

  • Need help with capturing live performance with 2 cameras

    I captured a live performance with two different cameras, one was AVCHD the other in DV. In Adobe, is there a way to down convert the large AVCHD to match the HD so that I can do a multi-camera edit? Here are the specs of the videos Here are the two

  • Wait event in 10g "events in waitclass others" , DB is stuck

    Hi , I need help , no one can login into the DB , there are 5 updates running in parallel right now , only those who were inside before the updates began to run can work . connect through listener is impossible , but without listener (i.e sqlplus use