CREATE OR REPLACE TYPE ADDR_TYP AS OBJECT ( Street CHARACTER VARYING (25) , City CHARACTER VARYING (20) , State CHARACTER (2) , PostalCode CHARACTER VARYING (9) ); /
CREATE TABLE CUSTOMER ( CUSTID INTEGER, LASTNAME VARCHAR2(25 BYTE), FIRSTNAME VARCHAR2(20 BYTE), ADDRESS ADDR_TYP, PHONE VARCHAR2(15 BYTE) ); Again, there is no such thing as "CREATE ROW" in Oracle DDL, as far as I know. Mike On Sun, Aug 19, 2012 at 5:47 PM, happytoday <ehabaziz2...@gmail.com> wrote: > It is found in the TEXT of SQL for dummies book : > > > > ROW types > The ROW data type was introduced with SQL:1999. It’s not that easy to > understand, > and as a beginning to intermediate SQL programmer, you may never > use it. After all, people got by without it just fine between 1986 and > 1999. > One notable thing about the ROW data type is that it violates the > rules of normalization > that E.F. Codd declared in the early days of relational database > theory. > I talk more about those rules in Chapter 5. One of the defining > characteristics > 33 Chapter 2: SQL Fundamentals > of first normal form is that a field in a table row may not be > multivalued. A > field may contain one and only one value. However, the ROW data type > allows > you to declare an entire row of data to be contained within a single > field in a > single row of a table — in other words, a row nested within a row. > Consider the following SQL statement, which defines a ROW type for a > person’s address information: > CREATE ROW TYPE addr_typ ( > Street CHARACTER VARYING (25) > City CHARACTER VARYING(20) > State CHARACTER (2) > PostalCode CHARACTER VARYING (9) > ) ; > After it’s defined, the new ROW type can be used in a table > definition: > CREATE TABLE CUSTOMER ( > CustID INTEGER PRIMARY KEY, > LastName CHARACTER VARYING (25), > FirstName CHARACTER VARYING (20), > Address addr_typ > Phone CHARACTER VARYING (15) > ) ; > > > On Aug 20, 1:32 am, Michael Moore <michaeljmo...@gmail.com> wrote: > > There is no such thing as CREATE ROW > > > > > > > > > > > > > > > > On Sun, Aug 19, 2012 at 2:41 PM, happytoday <ehabaziz2...@gmail.com> > wrote: > > > CREATE ROW TYPE addr_typ ( > > > Street CHARACTER VARYING (25) > > > City CHARACTER VARYING(20) > > > State CHARACTER (2) > > > PostalCode CHARACTER VARYING (9) > > > ) ; > > > > > CREATE ROW TYPE addr_typ ( > > > * > > > > > ERROR at line 1: > > > ORA-00901: invalid CREATE command > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Oracle PL/SQL" group. > > > To post to this group, send email to Oracle-PLSQL@googlegroups.com > > > To unsubscribe from this group, send email to > > > oracle-plsql-unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/Oracle-PLSQL?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Oracle PL/SQL" group. > To post to this group, send email to Oracle-PLSQL@googlegroups.com > To unsubscribe from this group, send email to > oracle-plsql-unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/Oracle-PLSQL?hl=en > -- You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to Oracle-PLSQL@googlegroups.com To unsubscribe from this group, send email to oracle-plsql-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en