MySQL Forums
Forum List  »  InnoDB

ERROR 1005: Can't create table (errno: 150)
Posted by: Pradeep Max
Date: July 07, 2008 09:00AM

1) i Executed the command "Show create table ledger"

2) it returned me the below SQL_Querey,
----------------------------------------
CREATE TABLE "ledger" (
"VoucherCode" int(11) NOT NULL default '0',
"VoucherNo" varchar(50) NOT NULL default '',
"EntryDate" date default NULL,
"EffectiveDate" date default NULL,
"ChequeDate" date default NULL,
"AccountCode" int(11) NOT NULL default '0',
"AgainstAccountCode" int(11) default NULL,
"TopEntry" char(1) default NULL,
"ForeignDebitAmount" double NOT NULL default '0',
"ForeignCreditAmount" double NOT NULL default '0',
"CurrencyCode" varchar(50) NOT NULL default '',
"CurrencyRate" double NOT NULL default '0',
"HomeDebitAmount" double NOT NULL default '0',
"HomeCreditAmount" double NOT NULL default '0',
"Narration" varchar(255) default NULL,
"CurrencyStatus" char(1) default NULL,
"IsItOpeningBalance" tinyint(1) NOT NULL default '0',
"Department" int(11) NOT NULL default '0',
"JobNo" int(11) NOT NULL default '0',
"OrderNo" varchar(50) NOT NULL default '',
"Area" int(11) NOT NULL default '0',
"Salesman" int(11) NOT NULL default '0',
"InvoiceNo" varchar(50) NOT NULL default '',
"InvoiceDate" date default NULL,
"ChequeNo" varchar(50) NOT NULL default '',
"FloatDays" int(11) NOT NULL default '0',
"BankName" varchar(50) NOT NULL default '',
"BranchName" varchar(50) NOT NULL default '',
"DueDays" int(11) NOT NULL default '0',
"DueDate" date default NULL,
"RealisedGainLoss" tinyint(4) NOT NULL default '0',
"OffsetReference" tinyint(1) NOT NULL default '0',
"OffsetStatus" varchar(10) NOT NULL default '',
"OffsetAmount" varchar(20) NOT NULL default '',
"OffsetPay" varchar(50) NOT NULL default '',
"OffsetParty" int(11) NOT NULL default '0',
"ReceivedBy" varchar(50) NOT NULL default '',
"Entered" int(11) NOT NULL default '0',
"Verified" int(11) NOT NULL default '0',
"ModifiedDate" date default NULL,
"ModifiedBy" int(11) NOT NULL default '0',
"DeletedBy" int(11) default NULL,
"TemplateName" varchar(50) NOT NULL default '',
"TemplateDescription" varchar(100) NOT NULL default '',
"ChequeReturnVoucherNo" varchar(50) NOT NULL default '',
"ChequeReturnVoucherCode" int(11) NOT NULL default '0',
"ChequeReturn" tinyint(4) NOT NULL default '0',
"DeleteStatus" tinyint(4) NOT NULL default '0',
"TaxLocked" tinyint(1) NOT NULL default '0',
"SortOrder" bigint(11) NOT NULL auto_increment,
"Remarks" varchar(255) NOT NULL default '',
"Terms" int(11) NOT NULL default '0',
"ContactPerson" varchar(50) NOT NULL default '',
"TaxEntered" tinyint(4) NOT NULL default '0',
PRIMARY KEY ("SortOrder"),
KEY "Agewise" ("VoucherCode","VoucherNo","EntryDate","EffectiveDate","AccountCode"),
KEY "OpeningBalance" ("AccountCode","IsItOpeningBalance"),
KEY "AgainstAccountCode" ("AgainstAccountCode"),
KEY "CurrencyCode" ("CurrencyCode"),
KEY "Ledger" ("AccountCode","EntryDate"),
KEY "Entered" ("Entered","Verified","VoucherNo","VoucherCode"),
KEY "Auth" ("VoucherNo","VoucherCode","TopEntry","AccountCode"),
KEY "Date" ("EntryDate","AccountCode","AgainstAccountCode","VoucherCode"),
KEY "PDC" ("ChequeDate","VoucherNo","VoucherCode"),
KEY "Journals" ("VoucherCode","AccountCode","EntryDate"),
CONSTRAINT "ledger_ibfk_1" FOREIGN KEY ("AccountCode") REFERENCES "groupaccounts" ("Code"),
CONSTRAINT "ledger_ibfk_2" FOREIGN KEY ("AgainstAccountCode") REFERENCES "groupaccounts" ("Code") ON UPDATE NO ACTION,
CONSTRAINT "ledger_ibfk_3" FOREIGN KEY ("VoucherCode") REFERENCES "documenttype" ("AutoNo"),
CONSTRAINT "ledger_ibfk_4" FOREIGN KEY ("CurrencyCode") REFERENCES "currencymaster" ("Code")
)
------------------------------------------


3) then i modified the "ledger" in the SQL_Querey into "ledger2"

4) and Executed it,..

5) it raises an Error [1005-Can't Create table ..(errorno:105)

Please help me to do this,.....



Edited 1 time(s). Last edit at 07/07/2008 09:14AM by Pradeep Max.

Options: ReplyQuote


Subject
Views
Written By
Posted
650067
March 24, 2005 01:20PM
ERROR 1005: Can't create table (errno: 150)
73495
July 07, 2008 09:00AM
5604
October 09, 2012 09:48PM
3794
December 19, 2011 10:13PM
9319
May 09, 2006 06:01PM
8492
November 15, 2006 02:05PM
7476
T D
February 01, 2008 06:47AM
9339
August 27, 2008 08:08AM
9834
December 03, 2008 10:15AM
6301
May 01, 2009 07:39AM
3556
August 29, 2011 04:46PM
5154
s l
December 15, 2009 01:48PM
5072
December 22, 2009 02:54AM
3308
February 18, 2011 08:55AM
4006
May 24, 2011 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.