1 Replies - 445 Views - Last Post: 27 November 2017 - 07:58 AM

#1 sadboys   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 75
  • Joined: 10-August 15

Basic question about Oracle DB

Posted 27 November 2017 - 07:23 AM

This is the first time I've used a Oracle db, I have downloaded an oracle script db and I'm getting two errors:

Syntax Error: "E_BOOK" (double quoted text) is not a valid input here.
Syntax Error: "CALLNO" (double quoted text) is not a valid input here.

The script that I have downloaded
CREATE TABLE  "E_BOOK" 
   (  "CALLNO" VARCHAR2(4000), 
	"NAME" VARCHAR2(4000), 
	"AUTHOR" VARCHAR2(4000), 
	"PUBLISHER" VARCHAR2(4000), 
	"QUANTITY" NUMBER, 
	"ISSUED" NUMBER, 
	 CONSTRAINT "E_BOOK_PK" PRIMARY KEY ("CALLNO") ENABLE
   )
/
CREATE TABLE  "E_LIBRARIAN" 
   (	"ID" NUMBER, 
	"NAME" VARCHAR2(4000), 
	"PASSWORD" VARCHAR2(4000), 
	"EMAIL" VARCHAR2(4000), 
	"MOBILE" NUMBER, 
	 CONSTRAINT "E_LIBRARIAN_PK" PRIMARY KEY ("ID") ENABLE
   )
   
/
Note: ID must be generated through sequence in E_LIBRARIAN table.

CREATE TABLE  "E_ISSUEBOOK" 
   (	"CALLNO" VARCHAR2(4000) NOT NULL ENABLE, 
	"STUDENTID" VARCHAR2(4000) NOT NULL ENABLE, 
	"STUDENTNAME" VARCHAR2(4000), 
	"STUDENTMOBILE" NUMBER, 
	"ISSUEDDATE" DATE, 
	"RETURNSTATUS" VARCHAR2(4000)
   )
/






Is This A Good Question/Topic? 0
  • +

Replies To: Basic question about Oracle DB

#2 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7397
  • View blog
  • Posts: 15,330
  • Joined: 16-October 07

Re: Basic question about Oracle DB

Posted 27 November 2017 - 07:58 AM

This worked fine on 10g and 11g... Ok, two things.

First, what oracle client are you using to execute the script? If you don't have it, I'd recommend the standard Oracle SQL Developer: http://www.oracle.co...view/index.html

Second, why the hell do you have double quotes, anyway? You don't need them. They are most likely an artifact of a DDL generation tool of some kind. I suspect your client is probably just choking on the quotes because, well, they're poor practice.

As to the code in general, what's with the E_*? How the hell would I ever be able to guess that the PK of E_BOOK is CALLNO? And why the hell is it VARCHAR2(4000)?!? Come to think of it, a PK that size might cause some Oracle versions balk if only on the basis of sanity. MSSQL actually has a hard cap on key size, something like 900, I think.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1