User Data Type

Visual Basic has the capability to define a User Data Type as
follows:
Type myDataType
foo as Boolean
bar as Integer
anArray(1 to 10) as Integer
end Type
Then you can create a new array of this this type as follows:
myNewVariable(1 to 5) as myDataType
and access the first member of the array and its submembers
as follows:
myNewVariable(1).foo = True
myNewVariable(1).bar = 23
myNewVariable(1).anArray(8) = 41
All of the submembers are strictly typed.
I would like to do the same thing in Actionscript 2.0. I
assume I would do this by creating a
class myDataType extends Array {
function myDataType(){
but I can't figure out how to create and strictly type the
submembers of myDataType, so that I can access them from an
instance of an array of myDataType in a fla file.
var myNewVariable:myDataType = new myDataType(5);
myNewVariable(1).foo = True;
myNewVariable(1).bar = 23;
myNewVariable(1).anArray = new Array(10);
Is there a way to do what I want?
Thanks in advance.

You can do this with classes in an .as file.

Similar Messages

  • Sql Devloper 4.0.0.13 - problems with displaying user data types

    Hi,
    I have installed new version of sqldeveloper and have discovered some problems with displaying user data types. The data that is described as VARCHAR2 are displayed with ‘???’.
    The problem persist in table view, script output and exported files.
    My type is described as follows:
    create or replace TYPE "DPTY_ADRESA" AS OBJECT
      ID_DPSF_OPCINE                                         NUMBER,
      ID_DPSF_MJESTA                                        NUMBER,
      OPCINA                                            VARCHAR2(100),
      MJESTO                                            VARCHAR2(100),
      ULICA                                 VARCHAR2(200),
      BROJ                                   VARCHAR2(20),
      SPRAT                VARCHAR2(20),
      OSTALO                             VARCHAR2(100),
      CONSTRUCTOR FUNCTION dpty_adresa RETURN SELF AS RESULT
    add MEMBER FUNCTION dajAdresu RETURN VARCHAR2 cascade;
    when make select column from table that contains this type I get next results:
    CASE 1:
    SQLDeveloper Version 3.2.20.09; Build MAIN-09.87; JDK 1.6.0_43; Windows 7 64 bit
    Select:
    select id, adresalokacija
    from dptr_saglasnosti
    where id = 1;
    Result:
            ID ADRESALOKACIJA
             1 COMP.DPTY_ADRESA(124,4913,'TRAIK','TURBE','BABANA','3452','0',NULL)
    END CASE 1;
    CASE 2:
    SQLDeveloper Version 4.0.0.13; Build MAIN-13.80; JDK 1.7.0_40; Windows 7 64 bit
    Select1:
    select id, adresalokacija
    from dptr_saglasnosti
    where id = 1;
    Result1:
    ID ADRESALOKACIJA
             1 COMP.DPTY_ADRESA(124,4913,'???','???','???','???','???',NULL)    
    But if I select one element it is displayed normal.
    Select2:
    select id, a.adresalokacija.opcina
    from dptr_saglasnosti a
    where id = 1;
    Result2:
    ID ADRESALOKACIJA.OPCINA
             1 TRAVNIK                  
    END CASE 2;
    I have tried this scenario on three different pc with same output.
    Pleas help me to get rid of the '???' in result.
    Best Regards,
    Omer

      I tried on SQLDeveloper Version 4.0.0.13; Build MAIN-13.80; JDK 1.7.0_45; Windows 7 64 bit; NLS setting is default
    all data can show,No ??? in result
    Test step as following:
    create or replace TYPE "DPTY_ADRESA" AS OBJECT
      ID_DPSF_OPCINE                                         NUMBER,
      ID_DPSF_MJESTA                                        NUMBER,
      OPCINA                                            VARCHAR2(100),
      MJESTO                                            VARCHAR2(100),
      ULICA                                 VARCHAR2(200),
      BROJ                                   VARCHAR2(20),
      SPRAT                VARCHAR2(20),
      OSTALO                             VARCHAR2(100),
      CONSTRUCTOR FUNCTION dpty_adresa RETURN SELF AS RESULT
    alter TYPE "DPTY_ADRESA" add MEMBER FUNCTION dajAdresu RETURN VARCHAR2 cascade;
    CREATE TABLE dptr_saglasnosti (
    adresalokacija        DPTY_ADRESA,
      id    number);
      INSERT INTO dptr_saglasnosti VALUES (
      DPTY_ADRESA (65,225,'Vrinda Mills', '1-800-555-4412','sss','aaaa','eeeee','attta'),1 );
    select id, adresalokacija from dptr_saglasnosti where id = 1;
    ID ADRESALOKACIJA
    1    HRCP.DPTY_ADRESA(65,225,'Vrinda Mills','1-800-555-4412','sss','aaaa','eeeee','attta')

  • ActiveX User Data Type Implementation

    I am trying to read calibration information from a Photon Inc. Nanoscan system which uses ActiveX controls. I keep getting the following error: -2147417851 "The server threw an exception". The calibration information is stored in a structure which must be accessed through a pointer. It is a User Data Type defined in a file called Nanoscan.tlb  I'm attaching a file that a programmer sent me about how to implement this in C++. I'd like to figure out how to implement it in Labview, since I don't have a C++ compiler and the code he sent me is beyond anything I've done in C.
    I've tried registering the .tlb file, but it just gives me the same properties and methods I can already see. I tried creating a cluster of string, single, single, converting it to variant, and passing that. If there is some way for Labview to see the iRecordInfo UDT of the .tlb file, that might get me there.
    Here is the summary of the steps in the attached file:
    1. Get ITypeLib pointer from the NanoScan type Library ( it uses the NanoScan GUID for this purpose)
    2. Get the ITypeInfo and IRecordInfo pointers for the power calibration structure ( it uses the PowerCalibration GUId as defined in the NanoScan.tlb)
    3. Create a VARIANT of VT_RECORD type.
    4. Initialize the pRecInfo field of the variant with the IRecordInfo of the PowerCalibration structure.
    5. Initialize the pvRecord field of the variant with a pointer to a power Calibration structure.
    6. Pass the created VARIANT to the NsAsGetPowerCalibration together with the index of the power calibration to be retrieved. To find out how many calibrations are stored in the scanhead EEPROM, use the NsAsGetNumPwrCalibrations function.
    7.Use the RecordCopy method to copy the VARIANT's record to the local power calibration structure.
    Attachments:
    Nanoscan iRecordInfo.txt ‏5 KB

    Hello,
    You should be able to register the activeX control and use it in LabVIEW.  Perhaps the registration process was not successful, and I think you should have an ocx file associated with your activeX control.  To register it and begin using it in LabVIEW, please see the following document for registration instructions:
    How Do I Manually Register Type Libraries, ActiveX Controls, and ActiveX Servers?
    http://digital.ni.com/public.nsf/websearch/4F811A9B23F1D46E862566F700615B7A?OpenDocument
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Issue with xsd Data type mapping for collection of user defined data type

    Hi,
    I am facing a issue with wsdl for xsd mapping for collection of user defined data type.
    Here is the code snippet.
    sample.java
    @WebMethod
    public QueryPageOutput AccountQue(QueryPageInput qpInput)
    public class QueryPageInput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class QueryPageOutput implements Serializable, Cloneable
    protected Account_IO fMessage = null;
    public class Account_IO implements Serializable, Cloneable {
    protected ArrayList <AccountIC> fintObjInst = null;
    public ArrayList<AccountIC>getfintObjInst()
    return (ArrayList<AccountIC>)fintObjInst.clone();
    public void setfintObjInst(AccountIC val)
    fintObjInst = new ArrayList<AccountIC>();
    fintObjInst.add(val);
    Public class AccountIC
    protected String Name;
    protected String Desc;
    public String getName()
    return Name;
    public void setName(String name)
    Name = name;
    For the sample.java code, the wsdl generated is as below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions
    name="SimpleService"
    targetNamespace="http://example.org"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    >
    <wsdl:types>
    <xs:schema version="1.0" targetNamespace="http://examples.org" xmlns:ns1="http://example.org/types"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.org/types"/>
    <xs:element name="AccountWSService" type="ns1:accountEMRIO"/>
    </xs:schema>
    <xs:schema version="1.0" targetNamespace="http://example.org/types" xmlns:ns1="http://examples.org"
    xmlns:tns="http://example.org/types" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://examples.org"/>
    <xs:complexType name="queryPageOutput">
    <xs:sequence>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="accountEMRIO">
    <xs:sequence>
    <xs:element name="fIntObjectFormat" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageType" type="xs:string" minOccurs="0"/>
    <xs:element name="fMessageId" type="xs:string" minOccurs="0"/>
    <xs:element name="fIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fOutputIntObjectName" type="xs:string" minOccurs="0"/>
    <xs:element name="fintObjInst" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="queryPageInput">
    <xs:sequence>
    <xs:element name="fPageSize" type="xs:string" minOccurs="0"/>
    <xs:element name="fSiebelMessage" type="tns:accountEMRIO" minOccurs="0"/>
    <xs:element name="fStartRowNum" type="xs:string" minOccurs="0"/>
    <xs:element name="fViewMode" type="xs:string" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.org" xmlns:ns1="http://example.org/types">
    <import namespace="http://example.org/types"/>
    <xsd:complexType name="AccountQue">
    <xsd:sequence>
    <xsd:element name="arg0" type="ns1:queryPageInput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQue" type="tns:AccountQue"/>
    <xsd:complexType name="AccountQueResponse">
    <xsd:sequence>
    <xsd:element name="return" type="ns1:queryPageOutput"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="AccountQueResponse" type="tns:AccountQueResponse"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="AccountQueInput">
    <wsdl:part name="parameters" element="tns:AccountQue"/>
    </wsdl:message>
    <wsdl:message name="AccountQueOutput">
    <wsdl:part name="parameters" element="tns:AccountQueResponse"/>
    </wsdl:message>
    <wsdl:portType name="SimpleService">
    <wsdl:operation name="AccountQue">
    <wsdl:input message="tns:AccountQueInput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    <wsdl:output message="tns:AccountQueOutput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
    ns1:Action=""/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="SimpleServiceSoapHttp" type="tns:SimpleService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="AccountQue">
    <soap:operation soapAction=""/>
    <wsdl:input>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SimpleService">
    <wsdl:port name="SimpleServicePort" binding="tns:SimpleServiceSoapHttp">
    <soap:address location="http://localhost:7101/WS-Project1-context-root/SimpleServicePort"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    In the above wsdl the collection of fintObjInst if of type xs:anytype. From the wsdl, I do not see the xsd mapping for AccountIC which includes Name and Desc. Due to which, when invoking the web service from a different client like c#(by creating proxy business service), I am unable to set the parameters for AccountIC. I am using JAX-WS stack and WLS 10.3. I have already looked at blog http://weblogs.java.net/blog/kohlert/archive/2006/10/jaxws_and_type.html but unable to solve this issue. However, at run time using a tool like SoapUI, when this wsdl is imported, I am able to see all the params related to AccountIC class.
    Can some one help me with this.
    Thanks,
    Sudha.

    Did you try adding the the XmlSeeAlso annotation to the webservice
    @XmlSeeAlso({<package.name>.AccountIC.class})
    This will add the schema for the data type (AccountIC) to the WSDL.
    Hope this helps.
    -Ajay

  • User defined table types sometimes show up a unknown data type in Profiler

    A couple of our users have a problem when using user defined table types. Calls are made using UDTT as variables and these are then passed to a stored procedure as parameters. Sometimes the application returns a timeout. In such situations a Profiler-Trace
    shows the following:
    declare @p4 unknown
    whereas the correct trace (that is sometimes displayed) should be:
    declare @p4 dbo.ReportFilterTableType
    ReportFilterTableType is a UDTT. The users do have correct permissions for the UDTT (otherwise they would never be usable for the user). What could be the reason that the data types for the variable
    @p4 in the example are sometimes returned as unknown and at other times are returned correctly as
    ReportFilterTableType? Could this possibly be a network related issue?
    Thank you.
    Graham Goodwin Email: [email protected]

    I know this is a old post, but i am also facing the same issue that too in my production server. Did you find any workarround for this issue. Please do reply. Critical problem we are facing.
    Alka, Is your problem timeouts when passing TVP parameters, or is it that a Profiler Trace shows type "unknown" for the TVP data type name?
    If your problem is timeouts, be aware that TVPs do not have statistics so the optimizer might not be able to generate an optimal plan for non-trivial queries. Declaring a primary key or unique constraint on the table type may help since that will provide
    useful cardinality information.  You may need to resort to hints in some cases.
    I suggest you start a new thread with details of your specific situation if the information in this thread doesn't help.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • User-Defined Type does not display values in Table Data grid

    I have a User defined Type that is a collection of one character VARCHAR2 values. In the Table Data grid it does not display the character values. I know on all our other Oracle development applications these values display. Is this a bug or is there a snippet to display these values?

    Version: 1.0.0.15
    DB: 10.2.0
    Workstation OS: Windows XP

  • Updating data in User Event doesn't propogate to uses of the User Event type

    So I have a user event which is seeded with a cluster in which there are a few typedefs. Now, as you might expect, I have to pass the user event to different VIs so that they can trigger the events which are interpretted by a main vi. Pretty simple and all is happy. There's one rub though: one of my vis which is passed the user event is called by reference. The call by reference vi requires a certain vi pattern when you create the reference for the vi (namely, a strictly typed vi reference), which includes the user event type. Now, sometimes, I update the typedefs in the data type of the user event. This means that user event type changes. Now, what's maybe not too surprising, is that either the user event type doesn't update with the type def or that the type specifier vi constant doesn't update with the change in user event type. This means that every time I have to go back and create a type specifier based on the updated pattern for the vi which takes the user event as an input.
    Is there a way for labview to automatically do this? One way to fix it, I'm sure, is to change the user event input into the vi I call by reference to a variant. Then inside the vi I call, to type cast the variant with the output of a Create User Event vi that has been seeded with the appropriate cluster of typdefs. But that seems pretty silly (like, why not just make EVERYTHING a variant). Any ideas?
    - Chris

    Take a static VI reference (from the app control palette), drag your subVI into it, right click it and make it strict and wire it into the type input for the Open VI Reference primitive. Now it should always update.
    Two more advantages you get from this is that now the VI is in memory, so it will automatically be included in your build and that you can use the VI Name (or VI Path) property from the static reference to get the name for the Open VI Reference primitive and it will always work correctly.
    Try to take over the world!

  • BAPI_DOCUMENT_CHANGE2 - Characteristic Number of User-Defined Data Type

    We are using classifications in the DMS system (it is the same classification system as the sales order and a few other transaction types). We also have defined our own characteristic data types.  If we manually go into CV01n and enter in values into the user defined characteristics everything works fine.  However, if I specify them in BAPI_DOCUMENT_CHANGE2 the values are not created/stored.  I get a null return on the return parameter so there isn't a warning nor is there an error. 
    Is there another way to set these values as it doesn't look like it will work with BAPI_DOCUMENT_CHANGE2?
    Regards,
    Davis

    We are using classifications in the DMS system (it is the same classification system as the sales order and a few other transaction types). We also have defined our own characteristic data types.  If we manually go into CV01n and enter in values into the user defined characteristics everything works fine.  However, if I specify them in BAPI_DOCUMENT_CHANGE2 the values are not created/stored.  I get a null return on the return parameter so there isn't a warning nor is there an error. 
    Is there another way to set these values as it doesn't look like it will work with BAPI_DOCUMENT_CHANGE2?
    Regards,
    Davis

  • How to call user define data type as data type for concurrent parameter

    Hi All,
    i find some difficulty while creating the concurrent program.
    i.e.
    i have one of the parameter of table type i.e. user define data type at PLSql program
    now i need to register same PLSQL program into oracle applications as concurrent program
    but while i am creating Parameters for concurrent program
    How could i define that user define data type at database level in oracle applications using 'Value set' ?
    any one save me from this Problem
    thanks and Regards,
    sai krishna@cavaya.

    Don't think this can be done..
    One way I can think of is to wrap your PL/SQL program under another procedure/package that can accept "normal" parameter,and use/register this wrapper instead of your original pl/sql program.
    HTH

  • Data retrieval from columns having user defined type

    I was learning abstract types the other day.So I created an abstract type and a table.
    create type student_ty as object
    (name varchar2(20),roll number);
    create table result(
    student student_ty,
    total number);
    I have also inserted some data.But I am having some problems with the rretrieval of data.Suppose I want to select only the roll and name of the student as described in the studen type.So I used the follwing query:-
    select student.name from result;
    But its not working.But when i'm using something like this:-
    select r.total,r.student.name from result r;
    It is working perfectly.My question is that is it a rule that oracle enforces to use an alias whenever retrieving values from a user defined datatype?.Please help.
    Thanks in advance.

    Hi,
    Good observation. As you can see with your first query, the student is considered by oracle as a alias instead of a user-defined type column which is included in your result's table.
    >
    select student.name from result;
    >That is why in this case, you really need to use an alias or you can just use the complete table name like this:
    select result.student.name from resultBut, of course, it is not recommended, using alias is much appropriate.
    Cheers.

  • Characteristic of Data Type = Date follows User Profile Only

    Hi All
    In EHS SVT the characteristic TSCAList_Date [SAP_EHS_1023_053_DATE_LIST] is of Data Type = Date) and follows the date format defined in the User Profile of actual user.
    If a user is using EU profile such as:
    EU date format = 1 DD.MM.YYYY
    EU decimal notation format = 1.234.567,89
    If he enters a date in another format (Such as YYYY-MM-DD - 2010-03-27) than the one defined in the User Profile (DD.MM.YYYY - 27.03.2010); he will get an error message text:  "Value (&) is not numeric"
    Question:
    How he can bypass this error and allow SAP make the conversion to changing the date entered (2010-03-27) to the one used in the User profile (27.03.2010)?
    I will apreciate any Help
    KO

    Hello Ouadria
    very interesting request indeed.
    a.) my understanding of SAP GUI approach is: user has an user id and logon parameter
    b.) by specifing an user profile some "default" set up should be used in further UI interaction in SAP GUI interface (especially date format etc.)
    c.) Therefore it makes "no" sense to use a "different" format in entering a date etc. as specified in the user profile; in addition I believe the "look and feel" of the data (display and no maintain) is once again connected to the user profile, That means if you change the data in user profile the "date" format and "numeric" format should change in UI; this "change" should be active after saving the profile once again (regarding fonts etc. in UI: the change is done "immediate"; user profile changes is done in a further session and I believe the original session is not changed (not sure ..))
    d.) indipendent on  user profile the application makes sure that the data is written into the SAP internal format (date and numeric vlaue) into the tables
    Coming with EH&S 2.7 you can use a new function in class/characteristic maintenance to change (display conversion in different allowed UOM) "UOMs" (etc.) and to get an idea which UOMs are allowed. I believe (not sure) that this new function should be available regarding characteristics of date format too. This function is "hidden" in some sense in the Menue (if I remember correct; i am not using it often).
    May be you could think of a "tricky" way to use the user parametres (by preparing some programming) but I would not investigate the money (and time) but simple change the user profile enter the data and then change back the profile.
    Different "easy" solution would be to use a second user id (one with default format DD.MM.YYYY and second with YYYY-MM-DD)
    May be this helps
    With best regards
    C.B.
    PS: Regarding UOM conversion: take a look here:
    http://help.sap.com/erp2005_ehp_04/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
    And search for topic: "Conversion of Units of Measurement"  which can be found in "Editing Characteristic Values" which is subtopic of: "Value Assignment "
    Edited by: Christoph Bergemann on Nov 19, 2010 10:08 PM
    Edited by: Christoph Bergemann on Nov 19, 2010 10:11 PM

  • User exit for adding more date types into IT0041

    Hi all,
    I have a requirement where in HCM infotype IT0041 I need to add couple more custom date types besides standard date types in IT0041. So if I use user exit, what are the steps to do this? what enhancement name should be used?
    Thanks,

    Ben - Unfortunately I haven't implemented a BAdI as I do more functional work.  I found a few documents on line that may help (gotta love Google!).  Maybe someone on SDN who is more technical can provide additional information.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702?quicklink=index&overridelayout=true
    http://sapient.wordpress.com/2007/05/25/implementing-business-add-ins-badi/
    http://it.toolbox.com/wiki/index.php/Document_on_BADI#BADI_Implementation
    Good luck!
    Thanks,
    Danialle

  • 'Master data type User table cannot add row'-DTW error

    Hi All,
          I am creating a template for user define Master data table from DTW, when i am trying to port data by using that template through DTW. it is giving error like--'Master data type User table cannot add row'
    So can any one have solution for this.
    Regard's
    Hari

    Hari,
    Please see SAP Note 1234690 on the SAP PartnerEdge Portal.  This seems like a similar problem although the example is using the Business One SDK which uses the DI API.  The DTW also uses the DI API ... so there may be a relation.
    You may want to check the latest patch level for SAP Business One 2007A as the note says it is a known issue.
    Eddy

  • Using user-defined data types in Forms 6i

    When I use the following code in Oracle Forms 6i
    PROCEDURE test IS
    prcl prcl_ty;
    BEGIN
    prcl := prcl.setParcel('xxx-xx-xxxx');
    END;
    I get 'Error 801'. However the above does work in SQL editor. The online help says PL/SQL8 client-side program units cannot support Oracle 8 object-related functionality and I suspect this is the reason I get the error from Forms. Is there a work-around for this.
    The TYPE is defined as:
    CREATE OR REPLACE
    TYPE PRCL_TY AS OBJECT
    (parcel VARCHAR2(11),
    MEMBER FUNCTION getBook RETURN VARCHAR2,
    MEMBER FUNCTION getMap RETURN VARCHAR2,
    MEMBER FUNCTION getItem RETURN VARCHAR2,
    MEMBER FUNCTION getItem_NS RETURN VARCHAR2,
    MEMBER FUNCTION getSplit      RETURN VARCHAR2,
    MEMBER FUNCTION find RETURN VARCHAR2,
    MEMBER FUNCTION find (yr in VARCHAR2) RETURN VARCHAR2,
    MEMBER FUNCTION isValid RETURN BOOLEAN,
    MEMBER FUNCTION toString                     RETURN VARCHAR2,
    MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2,
    STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty) -- to be used as a constructor
    NOT FINAL
    CREATE OR REPLACE
    TYPE BODY PRCL_TY AS
    MEMBER FUNCTION getBook RETURN VARCHAR2 IS
    BEGIN
    return substr(self.parcel,1,3);
    END;
    MEMBER FUNCTION getMap RETURN VARCHAR2 IS
    BEGIN
    return substr(self.parcel,4,2);
    END;
    MEMBER FUNCTION getItem RETURN VARCHAR2 IS
    BEGIN
    return substr(self.parcel,6);
    END;
    MEMBER FUNCTION getItem_NS RETURN VARCHAR2 IS
    BEGIN
    return substr(self.parcel,6,3);
    END;
    MEMBER FUNCTION getSplit RETURN VARCHAR2 IS
    BEGIN
    return substr(self.parcel,9,1);
    END;
    MEMBER FUNCTION find RETURN VARCHAR2 IS
    found varchar2(1);
    BEGIN
    begin
    select 'x'
         into found
         from casrp
         where cp_book_num = self.getBook
         and cp_map_num = self.getMap
         and cp_item_num = self.getItem
              and rownum = 1;
         return 'CASRP';
         exception
         when NO_DATA_FOUND then
         begin
    select 'x'
         into found
         from pro_prop
         where pp_book_num = self.getBook
         and pp_map_num = self.getMap
         and pp_item_num = self.getItem
              and rownum = 1
              and NOT EXISTS (select 'x'
                                  from cncl_prcl
                                  where cr_book_num = self.getBook
                                  and cr_book_num = self.getMap
                                       and cr_book_num = self.getItem
                                       and rownum = 1);
         return 'PRO_PROP';
         exception
         when NO_DATA_FOUND then
              return '';
         end;
    end;
    END;
    MEMBER FUNCTION find (yr IN VARCHAR2) RETURN VARCHAR2 IS
    found varchar2(1);
    BEGIN
    begin
    select 'x'
         into found
         from casrp
         where cp_book_num = self.getBook
         and cp_map_num = self.getMap
         and cp_item_num = self.getItem
              and cp_tax_yr = yr
              and rownum = 1;
         return 'CASRP';
         exception
         when NO_DATA_FOUND then
         begin
    select 'x'
         into found
         from pro_prop
         where pp_book_num = self.getBook
         and pp_map_num = self.getMap
         and pp_item_num = self.getItem
              and pp_tax_yr = yr
              and rownum = 1
              and NOT EXISTS (select 'x'
                                  from cncl_prcl
                                  where cr_book_num = self.getBook
                                  and cr_book_num = self.getMap
                                       and cr_book_num = self.getItem
                                       and cr_tax_yr = yr
                                       and rownum = 1);
         return 'PRO_PROP';
         exception
         when NO_DATA_FOUND then
              return '';
         end;
    end;
    END;
    MEMBER FUNCTION isValid RETURN BOOLEAN IS
    i number;
    BEGIN
    for i in 1..8 loop
         if substr(parcel,i,1) not between '0' and '9' then
         return FALSE;
         end if;
         end loop;
         if nvl(substr(parcel,9,1),'#') not between 'A' and 'Z' and
         nvl(substr(parcel,9,1),'#') != '#' then
         return FALSE;
         end if;
         return TRUE;
    END;
    MEMBER FUNCTION toString RETURN VARCHAR2 IS
    BEGIN
    return self.toString('-');
    END;
    MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2 IS
    BEGIN
    return self.getBook||par|| self.getMap||par|| self.getItem;
    END;
    STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty IS
    len number;
    pos number;
         lastch varchar2(1);
    temp varchar2(30);
    invalid_format exception;
         pragma exception_init(invalid_format,-9001);
    BEGIN
    temp := upper(istr);
    -- Find 1st occurance of '-'. If not in correct postion, pad book num with zeros.
         pos := instr(temp,'-',1,1);
    if pos > 0 then
         if pos != 4 then
    temp := lpad(substr(temp,1,pos-1),3,'0')||substr(temp,pos);
         end if;
    -- Find 2nd occurance of '-'. If not in correct postion, pad map num with zeros.
         pos := instr(temp,'-',1,2);
         if pos != 7 then
    temp := substr(temp,1,4)||lpad(substr(temp,5,1),2,'0')||substr(temp,pos);
         end if;
         -- Pad item num
         len := length(temp);
         lastch := substr(temp,len);
         temp := substr(temp,1,7)||lpad(substr(temp,8,len-1),3,'0');
         if lastch between 'A' and 'Z' then
              temp := temp||lastch;
         end if;
    end if;
    temp := replace(temp,'-','');
         if prcl_ty(temp).isValid then
    return (prcl_ty(temp));
         else
         raise invalid_format;
         end if;
    END;
    END;
    Rich Hall
    [email protected]

    You are correct in your assumptions. Client side PLSQL does not support user defined types like the one you are trying to use.
    There are no workarounds I am afraid.

  • User defined data type generated class

    Hi
    When defining a new data type in the local dictionary, one has to option of generating a representation class.
    I have done this and indeed received the class in my app.
    However, I fail to understand how I can use this class to retrieve values set in the data type.
    Thank you for your assistance
    Regadrs
    yuval

    Hello Y PEERY
    I am not clear which context you are talking about .
    Are you taking about simple type inside local dictonary ?
    or
    A project with data dictonary type ?
    (for webdynpro only)
    In both the case no need to deal with internal generated class, this is somethig which is requrired to framework itself , end developer not at all using /modifiying it.
    or
    Might you are dealing with EJB so in this case representation class is generated once we provide the basic(name , package etc) to it , further you can modify it according to your use.
    Please clarify
    BR
    Satish Kumar

Maybe you are looking for