Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Using the Object Browser
jctown_at_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_at_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" - UnknownReceived on Tue Sep 05 2006 - 07:09:47 CDT