Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie question

Re: Newbie question

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Mon, 06 Feb 2006 20:33:01 +0100
Message-ID: <ds87im$je4$1@news3.zwoll1.ov.home.nl>


lothar.behrens_at_lollisoft.de wrote:
> This is a table for postgreSQL:
>
> CREATE TABLE column_types
> (
> id serial,
> name char(30) NOT NULL,
> tablename char(30) NOT NULL,
> ro BOOL DEFAULT false,
> specialColumn BOOL DEFAULT false,
> controlType char(30) DEFAULT ''
> );
>
> How does this look like in Oracle ?
>
> Where can I get an online book about beginning with Oracle 10g XE ?
>
> Thanks, Lothar
>

Would serial be some sort of auto number column?

create table column_types (

id		number	NOT NULL, -- assuming this is the PK column.
name		varchar2(30) NOT NULL,
tablename 	varchar2(30) NOT NULL,
ro 		varchar2(1) DEFAULT 'N' NOT NULL,
Specialcolumn   varchar2(1) DEFAULT 'N' NOT NULL,
controltype	varchar2(30) NULL

);

Oracle does not have true boolean columns (it *does* have the logic), as with most languages, so implement with either a character type column ('Y' or 'N') or a numeric type (0/1)

An empty string is an anomaly for Oracle, and treated as NULL.

But -greatly wandering and speculating here- what do you plan to do with a table, called column_types? Creating a table that holds table/column definitions? Writing dynamic sql around that, to create tables "on the fly"? Considered A Bad idea (tm)

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Mon Feb 06 2006 - 13:33:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US