3 Replies - 356 Views - Last Post: 29 June 2011 - 09:51 PM Rate Topic: -----

#1 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

ERROR IN CREATING TABLE.

Posted 29 June 2011 - 08:49 PM

HI ALL,

I can not figure any erro out from this coding.
CREATE TABLE  'CLASSDB'.'THREAD' (`TR_ID' INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`TR_TITLE` VARCHAR( 10 ) NOT NULL ,
`TR_POST` TEXT NOT NULL,
'TR_DATE' DEFAULT NOW()NOT NULL
) ENGINE = InnoDB;




can u find any error ?

please help me..
thx in advance,
menuka.
Is This A Good Question/Topic? 0
  • +

Replies To: ERROR IN CREATING TABLE.

#2 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1819
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: ERROR IN CREATING TABLE.

Posted 29 June 2011 - 09:11 PM

Why you use those single quotes in entity names? These are variables and must be valid identifier. Remove quotes and your query will be like
 CREATE TABLE NewTable ( Column1 varchar(20)primary key,......) 

Any way, what DBMS are you using?
Was This Post Helpful? 1
  • +
  • -

#3 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: ERROR IN CREATING TABLE.

Posted 29 June 2011 - 09:37 PM

thx now it works.
i use mysql.

i am new to DB.
ENGINE = InnoDB

what does this mean and how to decide which engine most suitable for my data base connection...

thx
Was This Post Helpful? 0
  • +
  • -

#4 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1819
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: ERROR IN CREATING TABLE.

Posted 29 June 2011 - 09:51 PM

Ok, I am not using mySQL(I use MS SQL Server & Oracle) so dont know about mySql engines but this may help:
http://dev.mysql.com...ge-engines.html

Quote

InnoDB: A transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data. InnoDB row-level locking (without escalation to coarser granularity locks) and Oracle-style consistent nonlocking reads increase multi-user concurrency and performance. InnoDB stores user data in clustered indexes to reduce I/O for common queries based on primary keys. To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints.
And it is the default one, and always default are not bad

This post has been edited by smohd: 29 June 2011 - 10:13 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1