Unix Technical Forum

Using the Object Browser

This is a discussion on Using the Object Browser within the Oracle Miscellaneous forums, part of the Oracle Database category; --> I have a table set up with a few fields CREATE TABLE "books" ( "ISBN" VARCHAR2(20) NOT NULL ENABLE, ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 10:17 AM
jctown@nb.sympatico.ca
 
Posts: n/a
Default Using the Object Browser

I have a table set up with a few fields

CREATE TABLE "books"
( "ISBN" VARCHAR2(20) NOT NULL ENABLE,
"Title" VARCHAR2(50) NOT NULL ENABLE,
"Author" VARCHAR2(100) NOT NULL ENABLE,
"Publisher" VARCHAR2(100) NOT NULL ENABLE,
"Subject" VARCHAR2(30),
"Pages" NUMBER
)

When I try to add a row using Insert Row from the Orfacle Database
Express Edition Web Page,
the ISBN, which is supposed to be unique per book (so I want to use it
as a Primary Key once the table is loaded) somehow changes to a
different value after I am done adding a new row. There are no
constraints or indexes on the table as I removed them thinking they
might be the cause of my problem. However I have had no luck in
identifying the cause. So I have to edit each row after I add it and
change the ISBN to the value I originally typed in. This seems a bit
odd to me so I am wondering what I can look at or check to see what *I*
have done wrong.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 10:18 AM
Brian Peasland
 
Posts: n/a
Default Re: Using the Object Browser

jctown@nb.sympatico.ca wrote:
> I have a table set up with a few fields
>
> CREATE TABLE "books"
> ( "ISBN" VARCHAR2(20) NOT NULL ENABLE,
> "Title" VARCHAR2(50) NOT NULL ENABLE,
> "Author" VARCHAR2(100) NOT NULL ENABLE,
> "Publisher" VARCHAR2(100) NOT NULL ENABLE,
> "Subject" VARCHAR2(30),
> "Pages" NUMBER
> )


It is not a good idea to use double quotes when defining a table or
column name, as shown above. Oracle will make the table or column name
case-sensitive, which is not the default for an Oracle database.
Therefore, you will *always* have to use double quotes in your SQL
statements as follows:

SELECT "Title","Author" FROM "books";

Remove the double quotes and the table and column names default to upper
case.

> When I try to add a row using Insert Row from the Orfacle Database
> Express Edition Web Page,
> the ISBN, which is supposed to be unique per book (so I want to use it
> as a Primary Key once the table is loaded) somehow changes to a
> different value after I am done adding a new row. There are no
> constraints or indexes on the table as I removed them thinking they
> might be the cause of my problem. However I have had no luck in
> identifying the cause. So I have to edit each row after I add it and
> change the ISBN to the value I originally typed in. This seems a bit
> odd to me so I am wondering what I can look at or check to see what *I*
> have done wrong.
>


Constraints or indexes would not change the values inserted into a
table. However, a trigger on the table would potentially change the
value. Have you checked to see if a trigger exists which might be
modifying the ISBN value?

HTH,
Brian

--
================================================== =================

Brian Peasland
dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 10:19 AM
jctown@nb.sympatico.ca
 
Posts: n/a
Default Re: Using the Object Browser


Brian Peasland wrote:
> jctown@nb.sympatico.ca wrote:
> > I have a table set up with a few fields
> >
> > CREATE TABLE "books"
> > ( "ISBN" VARCHAR2(20) NOT NULL ENABLE,
> > "Title" VARCHAR2(50) NOT NULL ENABLE,
> > "Author" VARCHAR2(100) NOT NULL ENABLE,
> > "Publisher" VARCHAR2(100) NOT NULL ENABLE,
> > "Subject" VARCHAR2(30),
> > "Pages" NUMBER
> > )

>
> It is not a good idea to use double quotes when defining a table or
> column name, as shown above. Oracle will make the table or column name
> case-sensitive, which is not the default for an Oracle database.
> Therefore, you will *always* have to use double quotes in your SQL
> statements as follows:
>
> SELECT "Title","Author" FROM "books";
>
> Remove the double quotes and the table and column names default to upper
> case.
>
> > When I try to add a row using Insert Row from the Orfacle Database
> > Express Edition Web Page,
> > the ISBN, which is supposed to be unique per book (so I want to use it
> > as a Primary Key once the table is loaded) somehow changes to a
> > different value after I am done adding a new row. There are no
> > constraints or indexes on the table as I removed them thinking they
> > might be the cause of my problem. However I have had no luck in
> > identifying the cause. So I have to edit each row after I add it and
> > change the ISBN to the value I originally typed in. This seems a bit
> > odd to me so I am wondering what I can look at or check to see what *I*
> > have done wrong.
> >

>
> Constraints or indexes would not change the values inserted into a
> table. However, a trigger on the table would potentially change the
> value. Have you checked to see if a trigger exists which might be
> modifying the ISBN value?
>
> HTH,
> Brian
>


I used the Web Interface (apex) to create my table. when I specified
the column names,i said to "preserve case". that's what must have kept
the "" around the names. I had to go in a manually modifiy every
column so that it didn't have the "" around the name.
> --
> ================================================== =================
>
> Brian Peasland
> dba@nospam.peasland.net
> http://www.peasland.net
>
> Remove the "nospam." from the email address to email me.
>
>
> "I can give it to you cheap, quick, and good.
> Now pick two out of the three" - Unknown


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com