On Sunday, August 19, 2012 6:47:47 PM UTC-6, happytoday 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...@googlegroups.com<javascript:> > > > To unsubscribe from this group, send email to > > > oracle-plsql...@googlegroups.com <javascript:> > > > For more options, visit this group at > > >http://groups.google.com/group/Oracle-PLSQL?hl=en >
"SQL for Dummies" covers a number of RDBMS engines, DB2 included, which is where the command you quote is valid. Oracle has no 'CREATE ROW TYPE' command so the database is reporting, correctly, that the syntax is invalid. You need to remember that the title of the book is "SQL for Dummies", not "SQL*Plus for Dummies". The text should have clearly identified the database engine (DB2) where that command is valid. Also a quick search on google will also provide the necessary information on where you can use that syntax: https://www.google.com/#hl=en&output=search&sclient=psy-ab&q=create+row+type&oq=create+row+type&gs_l=hp.3..0i30l6j0i5i30l2j0i8i30l2.486.2994.1.3464.15.14.0.0.0.1.345.2526.0j12j1j1.14.0.les%3B..0.0...1c.gBMdAkqRqfw&psj=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=57c6d279542b17f9&biw=1920&bih=879 I'm sorry to burst your bubble but the error has a known reason -- the code won't work in Oracle. David Fitzjarrell -- 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