EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bots (https://www.eqemulator.org/forums/forumdisplay.php?f=676)
-   -   Rev1054-Bots.sql syntax error (https://www.eqemulator.org/forums/showthread.php?t=30927)

Nightlord 03-29-2010 09:02 PM

Rev1054-Bots.sql syntax error
 
Updated my database from rev.1180a to database rev. 1265 and when I try to source Rev1054-Bots.sql it complains that there are two syntax errors in this. Anyone else get this error message?

Code:

alter table bots
add column `LastZoneId` smallint(6) NOT NULL DEFAULT '0';

CREATE TABLE IF NOT EXISTS `botguildmembers` (
  `char_id` int(11) NOT NULL default '0',
  `guild_id` mediumint(8) unsigned NOT NULL default '0',
  `rank` tinyint(3) unsigned NOT NULL default '0',
  `tribute_enable` tinyint(3) unsigned NOT NULL default '0',
  `total_tribute` int(10) unsigned NOT NULL default '0',
  `last_tribute` int(10) unsigned NOT NULL default '0',
  `banker` tinyint(3) unsigned NOT NULL default '0',
  `public_note` text NULL,
  PRIMARY KEY  (`char_id`)
) ENGINE=InnoDB;

DROP VIEW IF EXISTS `vwGuildMembers`;
CREATE VIEW IF NOT EXISTS `vwGuildMembers` AS
  select 'C' as mobtype,
cm.char_id,
cm.guild_id,
cm.rank,
cm.tribute_enable,
cm.total_tribute,
cm.last_tribute,
cm.banker,
cm.public_note
from guild_members as cm
union all
select 'B' as mobtype,
bm.char_id,
bm.guild_id,
bm.rank,
bm.tribute_enable,
bm.total_tribute,
bm.last_tribute,
bm.banker,
bm.public_note
from botguildmembers as bm;

DROP VIEW IF EXISTS `vwBotCharacterMobs`;
CREATE VIEW IF NOT EXISTS `vwBotCharacterMobs` AS
  select 'C' as mobtype,
c.id,
c.name,
c.class,
c.level,
c.timelaston,
c.zoneid
from character_ as c
union all
select 'B' as mobtype,
b.BotID as id,
b.Name as name,
b.Class as class,
b.BotLevel as level,
0 as timelaston,
0 as zoneid
from bots as b;

ALTER TABLE `guild_members` DROP PRIMARY KEY;

Anyone spot the errors here? :confused:

gaeorn 03-29-2010 10:35 PM

CREATE VIEW does not allow IF NOT EXISTS. Remove that portion of the view creation lines and it should work.

Nightlord 03-29-2010 10:54 PM

That worked!
Thanks gaeorn.


All times are GMT -4. The time now is 03:14 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.