Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 7 Jahren, 9 Monaten
Letzter Beitrag:
vor 7 Jahren, 9 Monaten
Beteiligte Autoren:
issah, Rich, Shahine

WB - 14 MySQL Script

Startbeitrag von Rich am 30.01.2010 23:52

WebDev 14 created a MySQL script from the analysis.

When I run the script as a query in NaviCat for MySQL I get the following error.

"1046 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-- Integrity Constraints
ALTER TABLE 'ORGCONTS' ADD FOREIGN KEY('ORGID') REFER' at line 1

Here is the script at that point:

--Integrity Constraints
ALTER TABLE `ORGCONTS` ADD FOREIGN KEY (`ORGID`) REFERENCES `ORGS` (`ID`);
ALTER TABLE `AEOWNERCONTACTS` ADD FOREIGN KEY (`CompanyId`) REFERENCES `AEOwner` (`CompanyId`);
ALTER TABLE `PROJECTS` ADD FOREIGN KEY (`OwnerId`) REFERENCES `ORGS` (`ID`);
ALTER TABLE `USERS` ADD FOREIGN KEY (`CompanyId`) REFERENCES `ORGS` (`ID`);
ALTER TABLE `USERPRJS` ADD FOREIGN KEY (`USERID`) REFERENCES `USERS` (`ID`);
ALTER TABLE `RFIS` ADD FOREIGN KEY (`PROJECTID`) REFERENCES `PROJECTS` (`ProjectId`);
ALTER TABLE `ASIS` ADD FOREIGN KEY (`PROJECTID`) REFERENCES `PROJECTS` (`ProjectId`);

Can anyone explain what is wrong? :confused:

Antworten:

Are your tables MyIsam or Innodb.

Only innodb supports foreign keys, Myisam does not. Always use innodb tables with windev for best compatibility.

regards

issah

von issah - am 01.02.2010 13:55
What Issah has said is absolutely true. Innodb is a transaction-safe engine and has many advance features. However in my experience when you move from MyIsam to Innodb the performance of your application really suffers.

There are people who insist that Innodb is just as fast as MyIsam. That I have to say has not been my experience.

If speed is important then I would stick with MyIsam and hand-write the SQL statements and queries. I would also hand-write the queries if you have outer-joins or calculations based on date, time fields.



Regards

Shahine




von Shahine - am 01.02.2010 14:59
There is a loss of speed when you convert from MyIsam to Innodb, however the question is "by how much?"

You will have to weigh the loss of speed vrs the use of constraints, record locking, single file database and a general loss of features and compatibility to windev.

I think the speed loss is negligible but its your call.

If you do a search of myisam vs innodb on google, the general consensus is that:

"performance ranged negligibly in favour of MyISAM to negligibly in favour of InnoDB, to VASTLY in favour of InnoDB. In the end, most people go to InnoDB as the default."

von issah - am 01.02.2010 17:45
issah,

The tables are Innodb.

Any other suggestions?


von Rich - am 01.02.2010 23:32
The problem is not the "alter table line" but rather the "-- integrity constraints" line. Make sure there is a space between the double dash and the word integrity ie. "-- integrity" and not "--integrity".

I hope thats it.

issah

von issah - am 02.02.2010 10:52
issah,

That did it! :rp:


von Rich - am 02.02.2010 18:23
You were held captive by a space.

issah

von issah - am 03.02.2010 09:37
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.