Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2004
    Posts
    127

    Unanswered: DOMAINS & TYPE SYNTAX

    Hi can anyone inform me of the syntax required to define user defined types in oracle.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Luckily for all of us, Oracle actually document these things! Try this page.

  3. #3
    Join Date
    Jun 2004
    Posts
    127
    thanks for that.
    Last edited by FAC51; 11-09-04 at 07:36.

  4. #4
    Join Date
    Jun 2004
    Posts
    127
    can anyone tell me where im going wrong with creating domains. ive read the oracle syntax, and still nop avail. see example below:


    SQL> CREATE TYPE customer_typ_demo AS OBJECT
    2 ( customer_id NUMBER(6)
    3 , cust_first_name VARCHAR2(20)
    4 , cust_last_name VARCHAR2(20)
    5 , cust_address CUST_ADDRESS_TYP
    6 , phone_numbers PHONE_LIST_TYP
    7 , nls_language VARCHAR2(3)
    8 , nls_territory VARCHAR2(30)
    9 , credit_limit NUMBER(9,2)
    10 , cust_email VARCHAR2(30)
    11 , cust_orders ORDER_LIST_TYP
    12 ) ;
    13


    my prob is that when i go to execute the code via ;, it just goes to the next command line (i.e. 13, as above). ive tried numerous things to no avail. also set priviledges too - still no luck. any ideas folks?
    Last edited by FAC51; 11-09-04 at 11:27.

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    You just have to enter a / as you do with PL/SQL - I don't know why!

  6. #6
    Join Date
    Jun 2004
    Posts
    127
    hi Troy, sorry to ask the basics, but does the a / replace the ; or come after it?
    Last edited by FAC51; 11-09-04 at 12:50.

  7. #7
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Like this:
    Code:
    SQL> CREATE TYPE customer_typ_demo AS OBJECT
      2     ( customer_id        NUMBER(6)
      3     , cust_first_name    VARCHAR2(20)
      4     , cust_last_name     VARCHAR2(20)
      5     , nls_language       VARCHAR2(3)
      6     , nls_territory      VARCHAR2(30)
      7     , credit_limit       NUMBER(9,2)
      8     , cust_email         VARCHAR2(30)
      9     );
     10  /
    
    Type created.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •